-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
title/subject is the error message i get when running the following code (example 20-7 from learning processing, 2nd edition by daniel shiffman):
i'm running processing 3.3.7 in os x el capitan version 10.11.6 on a mid-2015 mac book pro.
`import processing.sound.*;
SinOsc osc;
Env envelope;
int[] scale = { 60, 62, 64, 65, 67, 69, 71, 72 };
int note = 0;
void setup() {
size(200, 200);
osc = new SinOsc(this);
envelope = new Env(this);
}
void draw() {
background(255);
if (frameCount % 60 == 0) {
osc.play(translateMIDI(scale[note]), 1);
envelope.play(osc, 0.01, 0.5, 1, 0.5);
note = (note + 1) % scale.length;
}
}
float translateMIDI(int note) {
return pow(2, ((note-69)/12.0))*440;
}`
Metadata
Metadata
Assignees
Labels
No labels