Cabbage Logo
Back to Cabbage Site

On the on/off of sequencer

Hi Rory:

I found out how to make the sequencer in the forum,
but I wanted to add a on/off for each sound, so I used this way, but my “mute” couldn’t turn it off, and I was playing the first sound all the time. How to fix it?arpe select 1.csd (7.4 KB)


and…Also, when I add a sequencer to my instrument, it doesn’t work. How can I fix it? :joy:chloe 5 Seq.csd (21.0 KB)

You need to check what note is plying, i.e, kNoteIndex and then apply the mute to it if needed.

In the simple arp example you had, the instrument was being triggered via MIDI, so it had p4 and p5 values passed to it. In this example, instrument 3 is not started via MIDI, but from the score. I think you should be starting it via MIDI as in the earlier example.

Well, ah… I’m sorry that I still haven’t succeeded. Theory I know… but I don’t know what’s wrong. If you have time, can you help me change it? Let me learn…And the case above…thanks

Start with the first example first. You can streaming note out of your apeggiator. The note that is being output is iNoteArray[nNoteIndex]. If kNoteIndex is 1, and you have that note muted, then don’t call the event opcode. You know what I mean?

WechatIMG1 1

???nononononono :joy:

I found a way!

in2 chnget “in2”
in3 chnget “in3”
in4 chnget “in4”
in5 chnget “in5”
in6 chnget “in6”

iamp1 chnget “iamp1”
iamp2 chnget “iamp2”
iamp3 chnget “iamp3”
iamp4 chnget “iamp4”
iamp5 chnget “iamp5”
iamp6 chnget “iamp6”

iNoteArray [] fillarray 0, in2, in3, in4, in5, in6
iAmpArray [] fillarray iamp1, iamp2, iamp3, iamp4, iamp5, iamp6

kNoteIndex init 0   
kAmpIndex init 0

if chnget:k("enableArp") == 1 then
    kTempo chnget "tempo"
    kMetro metro kTempo
    if kMetro == 1 then
        ;trigger sounds from instrument 1000, which in turns calls synth UDO..
        event "i", 4, 0, chnget:k("duration"), p4+iNoteArray[kNoteIndex], p5*iAmpArray[kAmpIndex]
        kNoteIndex = kNoteIndex<5 ? kNoteIndex + 1 : 0
        kAmpIndex = kAmpIndex<5 ? kAmpIndex + 1 : 0

The second, how to start No. 3 with MIDI?

You can use massign to trigger an instrument using MIDI data.

I made some attempts. Maybe my method is wrong. It has no function

In another case, it can have the effect of a sequencer, but there is a problem with pitch control.

I think the problem is you are lifting code from lots of different examples. This is going to make it really difficult to make one coherent instrument. :thinking: