processing-sound-archive
processing-sound-archive copied to clipboard
ERROR: /node/free: Node 34 not found
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; }`
I'm having similar issues trying to do basic sound file io. I'm mostly getting this:
ERROR: /node/free: Node id -1 out of range
On mac 10.12.6 and processing 3.3.7
i'm also getting this "ERROR: /node/free: Node id -1 out of range". On mac 10.13.1 and processing 3.0b6.
I think the cause of the problem is that the handling of m_nodeId is strange in SoundFile.java. We need to consider about how to control the sound when we play two or more sounds.
public void stop(){
// if(m_isPlaying == 1 && m_nodeId[0] != -1) {
// m_engine.synthStop(m_nodeId);
// for(int i = 0; i < m_nodeId.length; i++) {
// m_nodeId[i] = -1;
// }
// }
m_engine.synthStop(m_nodeId);
for(int i = 0; i < m_nodeId.length; i++) {
m_nodeId[i] = -1;
}
m_isPlaying=0;
}