Cabbage Logo
Back to Cabbage Site

Why does my code hang when compiling?

My code doesn’t give syntax errors, it just hangs Cabbage. Is there something wrong with my loop?

	<CsInstruments>	
		sr=44100 ;set sample rate of entire vst
		ksmps = 32 ;k cycle
		nchnls = 1 ;mono output
		0dbfs = 1
		
		;instrumentMidiReader will be triggered by keyboard widget
		instr 1, instrumentMidiReader
;			kMidiEventType, kMidiEvent2 ,k3,k4 = midiin() ;put midi data into variables TODO
;			kEnv madsr .1, .2, .6, .4
;			aOut vco2 p5, p4
;			outs aOut*kEnv, aOut*kEnv
		endin 
			
		opcode assignMidiChannelsToTheReaderInstrument, 0, 0
                    iCount init 0
                    while iCount < 128 do
                       massign iCount, 1 ;assign instrumentMidiReader to midi channel iCount
                       iCount += 1
                    od
                endop
        	
		assignMidiChannelsToTheReaderInstrument()

Never mind, I needed to put 16 for midi not 128 or Cabbage breaks. But I can’t see a delete button for questions.

You should be able to delete a post, there is a ‘bin’ icon that you can hit. But thanks for posting the solution. That’s better than deleting the origin post :wink:

Nope, there’s no bin icon I can see on the post, only on comments

That’s odd. I’ve looked through the settings but can’t see anything that might disable you from deleting a post. I just checked in other discourse forums and I seem to have the option there even though I’m not an administrator. Odd, I’ll keep looking.