Hey, I’m following Rory Walsh’s tutorial on a simple Csound sequencer, 5min in when he pressed play a sequence was generated but when I pressed play it was saying “if metro“ was an invalid input. Did i write it wrong or is there an alternative I could use? Any help would be appreciated, thank you!!
; Initialize the global variables.
gkNotes init 32
gkNotesCat init 8
instr SEQUENCER
Kcnt init 0
kNoteIndex init 0
while Kcnt < 8 do
gkNotes[Kcnt] = 60+Kcnt
Kcnt+=1
od
if metro[1] == 1 then
event "i", "SYNTH", 0, .5, gkNotes[kNoteIndex]
kNoteIndex = kNoteIndex<6 7 kNoteIndex+1 : 0
endif
I fixed that and some other errors in my original code but now I have “Parsing failed due to syntax errors
Stopping on parser failure
cannot compile orchestra“
It doesn’t specify the line in question and I double checked my work to the tutorial, is there anything I’m missing? Here is what I have now
<Cabbage>
form caption("Mango") size(400, 300), guiMode("queue") pluginId("def1")
rslider bounds(296, 162, 100, 100), channel("gain"), range(0, 1, 0, 1, .01), text("Gain"), trackerColour("lime"), outlineColour(0, 0, 0, 50), textColour("black")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d
</CsOptions>
<CsInstruments>
; Initialize the global variables.
gkNotes[] init 32
gkNotesCat init 8
instr SEQUENCER
Kcnt init 0
kNoteIndex init 0
while Kcnt < 8 do
gkNotes[Kcnt] = 60+Kcnt
Kcnt+=1
od
if metro(1) == 1 then
event "i", "SYNTH", 0, .5, gkNotes[kNoteIndex]
kNoteIndex = kNoteIndex<6 ? kNoteIndex+1 : 0
endif
endin
instr SYNTH
a1 expon 1, p3, 0.01
aOut oscili, a1, cpsmidinn(p4)
out aOut\*aOut
endin
</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
;starts instrument 1 and runs it for a week
i"SEQUENCER" 0 [60*60*24*7]
</CsScore>
</CsoundSynthesizer>