Created
November 27, 2012 15:56
-
-
Save fredeerock/4155021 to your computer and use it in GitHub Desktop.
Use processing to play samples.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ddf.minim.*; | |
Minim minim; | |
AudioSample kick; | |
AudioSample snare; | |
int val1 = 0; | |
void setup() { | |
minim = new Minim(this); | |
kick = minim.loadSample( "BD.mp3", 512); | |
snare = minim.loadSample("SD.wav", 512); | |
} | |
void draw() { | |
for(int i = 0; i < 100000; i++) { | |
if(i%1000==0){ | |
val1++; | |
} | |
} | |
if ( val1 > 50000 ) snare.trigger(); | |
if ( val1 > 0 ) kick.trigger(); | |
println(val1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment