Browse Source

add REC/OVERBUB/EREASE

develop
Carmine De Rosa 5 years ago
parent
commit
edf82ba01b
  1. 9
      Processing/TESTS/Sampler/Sampler.pde
  2. 9
      Processing/TESTS/Sampler/SetBeat.pde
  3. 2
      Processing/TESTS/Sampler/controllerStatus.pde

9
Processing/TESTS/Sampler/Sampler.pde

@ -48,6 +48,15 @@ void draw() {
beat++; beat++;
if(beat>=divider){beat=0;} if(beat>=divider){beat=0;}
// End of beat
if(beat==0) {
if(doRec == false) {
controller[1] = "UNSET";
}
doRec = false;
}
if(ereaseRow>0 && doErease && beat==0) { if(ereaseRow>0 && doErease && beat==0) {
for(int x=0; x<divider; x++) { for(int x=0; x<divider; x++) {
samples[ereaseRow-1][x] = false; samples[ereaseRow-1][x] = false;

9
Processing/TESTS/Sampler/SetBeat.pde

@ -1,5 +1,6 @@
int ereaseRow = 0; int ereaseRow = 0;
boolean doErease = false; boolean doErease = false;
boolean doRec = false;
void setBeat(int index, int sample) { void setBeat(int index, int sample) {
samples[sample][index] = true; samples[sample][index] = true;
@ -14,11 +15,17 @@ void keyPressed() {
controller[0] = controller[0] == "PLAY" ? "STOP" : "PLAY"; controller[0] = controller[0] == "PLAY" ? "STOP" : "PLAY";
beat=0; beat=0;
} }
if(key == 'r') {
controller[1] = controller[1] == "UNSET" ? "REC/OVERDUB" : "UNSET";
doRec = true;
}
} else { } else {
int sample = keyCode-65; int sample = keyCode-65;
doErease = ereaseRow>0; doErease = ereaseRow>0;
if(sample >= 0 && sample < numSounds && !doErease) { if(sample >= 0 && sample < numSounds && !doErease) {
setBeat(beat, sample);
if(controller[1] != "EREASE" && controller[1] != "UNSET") {
setBeat(beat, sample);
}
} }
} }
} }

2
Processing/TESTS/Sampler/controllerStatus.pde

@ -1,4 +1,4 @@
String[] controller = {"STOP", "REC", "BANK", "PATTERN"};
String[] controller = {"STOP", "UNSET", "BANK", "PATTERN"};
void printControllerStatus() { void printControllerStatus() {

Loading…
Cancel
Save