3 changed files with 55 additions and 33 deletions
@ -1,27 +1,24 @@ |
|||||
int ereaseRow = 0; |
int ereaseRow = 0; |
||||
|
boolean doErease = false; |
||||
|
|
||||
void setBeat(int index, int sample) { |
void setBeat(int index, int sample) { |
||||
samples[sample][index] = true; |
samples[sample][index] = true; |
||||
} |
} |
||||
|
|
||||
|
|
||||
void keyPressed() { |
void keyPressed() { |
||||
|
println(keyCode); |
||||
if(keyCode >= 48 && keyCode < 53) { |
if(keyCode >= 48 && keyCode < 53) { |
||||
ereaseRow = keyCode-48; |
ereaseRow = keyCode-48; |
||||
println("Set ereaseRow"+ereaseRow); |
|
||||
|
} else if(keyCode >= 74) { |
||||
|
if(key == 'p') { |
||||
|
controller[0] = controller[0] == "PLAY" ? "STOP" : "PLAY"; |
||||
|
beat=0; |
||||
|
} |
||||
} else { |
} else { |
||||
int sample = keyCode-65; |
int sample = keyCode-65; |
||||
println(sample); |
|
||||
if(sample >= 0 && sample < numSounds) { |
|
||||
println("ereaseRow"+ereaseRow); |
|
||||
|
doErease = ereaseRow>0; |
||||
|
if(sample >= 0 && sample < numSounds && !doErease) { |
||||
setBeat(beat, sample); |
setBeat(beat, sample); |
||||
|
|
||||
if(ereaseRow>0) { |
|
||||
for(int x=0; x<divider; x++) { |
|
||||
samples[ereaseRow-1][x] = false; |
|
||||
} |
|
||||
//ereaseRow = 0; |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
@ -0,0 +1,16 @@ |
|||||
|
String[] controller = {"STOP", "REC", "BANK", "PATTERN"}; |
||||
|
|
||||
|
|
||||
|
void printControllerStatus() { |
||||
|
fill(200); |
||||
|
text("PLAY/STOP:", 10, height-75); |
||||
|
text("REC/OVERDUB/ERASE:", 10, height-55); |
||||
|
text("BANK:", 10, height-35); |
||||
|
text("PATTERN/BPM/SWING:", 10, height-15); |
||||
|
|
||||
|
fill(240); |
||||
|
text(controller[0], 180, height-75); |
||||
|
text(controller[1], 180, height-55); |
||||
|
text(controller[2], 180, height-35); |
||||
|
text(controller[3], 180, height-15); |
||||
|
} |
Loading…
Reference in new issue