processing-sound-archive icon indicating copy to clipboard operation
processing-sound-archive copied to clipboard

ERROR: /node/free: Node 34 not found

Open toxasma opened this issue 7 years ago • 2 comments

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; }`

toxasma avatar Apr 04 '18 18:04 toxasma

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

bnew avatar Apr 24 '18 21:04 bnew

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;
	}

tawAsh1 avatar May 14 '18 05:05 tawAsh1