diff --git a/Processing/Sampler/Sampler.pde b/Processing/Sampler/Sampler.pde index 322baec..2554b2a 100644 --- a/Processing/Sampler/Sampler.pde +++ b/Processing/Sampler/Sampler.pde @@ -14,6 +14,7 @@ int duration = 0; int beat = 0; String patternLabel = "NO PATTERN"; +String bpmLabel = "UNSET"; String swingLabel = "100%"; boolean[][] samples; diff --git a/Processing/Sampler/SetBeat.pde b/Processing/Sampler/SetBeat.pde index 88902e2..484bf29 100644 --- a/Processing/Sampler/SetBeat.pde +++ b/Processing/Sampler/SetBeat.pde @@ -30,6 +30,10 @@ void keyPressed() { controller[1] = controller[1] == "UNSET" ? "REC/OVERDUB" : "UNSET"; doRec = true; } + if(key == 's') { // BPM + bpmLabel = "CHOOSE..."; + chooseBPM = true; + } if(key == 'o') { // PATTERN choosePattern = true; controller[0] = "STOP"; @@ -48,9 +52,16 @@ void keyPressed() { if(code >= 0 && !doErease) { if(chooseBank) { - controller[2] = "BANK" + (code+1); - setData(); + controller[2] = banksLabels[code]; + bank = code+1; chooseBank = false; + setData(); + + } else if(chooseBPM) { + bpmLabel = bpmsArray[code]+""; + bpm = bpmsArray[code]; + chooseBPM = false; + setData(); } else if(choosePattern) { pattern = code; @@ -60,11 +71,13 @@ void keyPressed() { numSounds = soundNumbersArray[code]; divider = dividersArray[code]; bank = banksArray[code]; + bpm = bpmPatArray[code]; + bpmLabel = bpmPatArray[code]+""; numTracks = numSounds; - controller[2] = "BANK" + banksArray[code]; + controller[2] = banksLabels[code]; setData(); - } else if(controller[1] != "EREASE" && controller[1] != "UNSET") { + } else if(controller[1] != "EREASE" && controller[1] != "UNSET" && controller[0] != "STOP") { setBeat(beat, code); } } diff --git a/Processing/Sampler/controllerStatus.pde b/Processing/Sampler/controllerStatus.pde index 863f86e..5108958 100644 --- a/Processing/Sampler/controllerStatus.pde +++ b/Processing/Sampler/controllerStatus.pde @@ -20,7 +20,7 @@ void printControllerStatus() { fill(240); text(patternLabel, (width/2)+100, height-75); - text(bpm, (width/2)+100, height-55); + text(bpmLabel, (width/2)+100, height-55); text(swing, (width/2)+100, height-35); stroke(200); diff --git a/Processing/Sampler/data/BANK3/1.wav b/Processing/Sampler/data/BANK3/1.wav new file mode 100644 index 0000000..35c8175 Binary files /dev/null and b/Processing/Sampler/data/BANK3/1.wav differ diff --git a/Processing/Sampler/data/BANK3/2.wav b/Processing/Sampler/data/BANK3/2.wav new file mode 100644 index 0000000..32bd834 Binary files /dev/null and b/Processing/Sampler/data/BANK3/2.wav differ diff --git a/Processing/Sampler/data/BANK3/3.wav b/Processing/Sampler/data/BANK3/3.wav new file mode 100644 index 0000000..101c110 Binary files /dev/null and b/Processing/Sampler/data/BANK3/3.wav differ diff --git a/Processing/Sampler/data/BANK3/4.wav b/Processing/Sampler/data/BANK3/4.wav new file mode 100644 index 0000000..f997096 Binary files /dev/null and b/Processing/Sampler/data/BANK3/4.wav differ diff --git a/Processing/Sampler/data/BANK3/5.wav b/Processing/Sampler/data/BANK3/5.wav new file mode 100644 index 0000000..6641aed Binary files /dev/null and b/Processing/Sampler/data/BANK3/5.wav differ diff --git a/Processing/Sampler/data/BANK4/1.wav b/Processing/Sampler/data/BANK4/1.wav new file mode 100644 index 0000000..35c8175 Binary files /dev/null and b/Processing/Sampler/data/BANK4/1.wav differ diff --git a/Processing/Sampler/data/BANK4/2.wav b/Processing/Sampler/data/BANK4/2.wav new file mode 100644 index 0000000..32bd834 Binary files /dev/null and b/Processing/Sampler/data/BANK4/2.wav differ diff --git a/Processing/Sampler/data/BANK4/3.wav b/Processing/Sampler/data/BANK4/3.wav new file mode 100644 index 0000000..101c110 Binary files /dev/null and b/Processing/Sampler/data/BANK4/3.wav differ diff --git a/Processing/Sampler/data/BANK4/4.wav b/Processing/Sampler/data/BANK4/4.wav new file mode 100644 index 0000000..f997096 Binary files /dev/null and b/Processing/Sampler/data/BANK4/4.wav differ diff --git a/Processing/Sampler/data/BANK4/5.wav b/Processing/Sampler/data/BANK4/5.wav new file mode 100644 index 0000000..6641aed Binary files /dev/null and b/Processing/Sampler/data/BANK4/5.wav differ diff --git a/Processing/Sampler/data/data.json b/Processing/Sampler/data/data.json index 714208a..e20803f 100644 --- a/Processing/Sampler/data/data.json +++ b/Processing/Sampler/data/data.json @@ -5,6 +5,7 @@ "numSounds": 5, "divider": 8, "bank": 1, + "bpm": 280, "pattern": [ [true, false, true, false, true, false, true, false], [true, false, false, true, false, true, false, false], @@ -18,11 +19,26 @@ "numSounds": 3, "divider": 6, "bank": 2, + "bpm": 180, "pattern": [ [false, true, false, true, false, true], [false, false, true, false, false, true], [false, false, false, true, false, false] ] } + ], + + "banks": [ + {"name": "Bank1"}, + {"name": "Drum"}, + {"name": "Electric"}, + {"name": "Bank 123"} + ], + + "bpm": [ + {"value": 80}, + {"value": 120}, + {"value": 180}, + {"value": 280} ] } diff --git a/Processing/Sampler/loadData.pde b/Processing/Sampler/loadData.pde index 26768e1..41dc4e1 100644 --- a/Processing/Sampler/loadData.pde +++ b/Processing/Sampler/loadData.pde @@ -1,7 +1,10 @@ String[] patternLabels = {}; +String[] banksLabels = {}; int[] soundNumbersArray = {}; int[] dividersArray = {}; int[] banksArray = {}; +int[] bpmPatArray = {}; +int[] bpmsArray = {}; boolean[][][] patternsArray = {}; void loadData() { @@ -10,17 +13,31 @@ void loadData() { json = loadJSONObject("data.json"); JSONArray pattsArray = json.getJSONArray("patterns"); + JSONArray bnksArray = json.getJSONArray("banks"); + JSONArray bpmArray = json.getJSONArray("bpm"); + + for(int bpm=0; bpm