blue book examples

This commit is contained in:
benfry
2011-01-26 20:26:16 +00:00
parent a5fb67810a
commit cd888bc239
927 changed files with 36898 additions and 0 deletions
@@ -0,0 +1,14 @@
import processing.sound.*;
// Notes range from 0 to 127 as in the MIDI specification
int[] notes = { 60, 62, 64, 65, 67, 69, 71, 72, 74 };
void setup() {
noLoop(); // No drawing in this sketch, so we don't need to run the draw() loop
}
void keyPressed() {
if ((key >= '1') && (key <= '9')) {
// Use the key as an index into the array of notes
Sound.playTone(notes[key - '1'], 500, 80);
}
}