Skip to content

Instantly share code, notes, and snippets.

@pstoica
Forked from ohmygodwin/soundugh.java
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pstoica/11361482 to your computer and use it in GitHub Desktop.
Save pstoica/11361482 to your computer and use it in GitHub Desktop.
import arb.soundcipher.*;
SoundCipher midi = new SoundCipher(this);
int beat;
void setup() {
frameRate(8);
beat = 0;
}
void draw() {
float[] pitches = {60, 64, 66, 67, 62, 71, 69, 61, 65, 63, 68, 70};
midi.playNote(pitches[beat], random(50, 100), random(.25, 1));
beat = (beat + 1) % pitches.length; // mod so it goes back to 0 after passing 11
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment