Skip to content

Commit

Permalink
Implemented randomness adjustment for all channels through programmin…
Browse files Browse the repository at this point in the history
…g inputs
  • Loading branch information
goldfish committed Feb 22, 2009
1 parent 9bd9354 commit 91ff5d6
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion beat_maker.pde
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ unsigned long tempoCheck;
unsigned long nextPoll;
unsigned long stepTime;
unsigned long tempoLEDoff;
int pollInterval = 50;
int pollInterval = 75;

int currentStep = 0;
byte kPattern[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Expand Down Expand Up @@ -226,6 +226,25 @@ void loop() {
pCymbals = pCymbalsRead;
digitalWrite( pCymbalsLED, pCymbals );
}

// poll programming inputs
int progReadValue = analogRead( progPot );
if ( digitalRead( progRandomSW ) ){
if( pKick ){
kickRandomness = progReadValue;
}
if( pSnare ){
snareRandomness = progReadValue;
}
if( pToms ){
tomsRandomness = progReadValue;
}
if( pCymbals ){
cymbalsRandomness = progReadValue;
}
}
/// progVolumeSW
/// progPanSW

// check and update tempo if needed <-- yeah, it looks weird, but it gives a good range
tempoCheck = 2 * ( minTempo - analogRead( tempoPot ) );
Expand Down

0 comments on commit 91ff5d6

Please sign in to comment.