Cabbage Logo
Back to Cabbage Site

Is it possible to make midiarp only read from a specific MIDI channel?

Trying to write a program which has uses MIDI channel 1 to trigger a synth, MIDI channel 2 to trigger a sample player, while MIDI channel 3 is reserved for sending notes into midiarp which is in an alwayson instrument definition. The way midiarp works right now, it reads from every midi channel even if you use massign, which causes the arpeggio to trigger regardless of MIDI channel. Is there a way to make the midiarp opcode read exclusively from channel 5?

Hi @toretalgo, welcome to the forum :slight_smile:

I don’t think so, that would involve a change at the opcode level. Can you find an issue on the Csound github issue tracker?

Can’t find anything on the Github issue tracker relating to my issue, unfortunately.
Is there any workaround for the issue you know of, or should I just scrap the idea for now?

I was suggesting that you create a new issue so that we can tackle it when we get a chance. What operating system are you using? Even if we do update the Csound opcode you’ll still have to wait for a new release to test it. Unless you are building Csound yourself?

My bad, I misunderstood what you said. Been in a bit of a coding haze lately so my mind is not completely with me haha.

I’ve been thinking about a solution for the past day now, I think it might be possible to use midiin to populate either an array or a function table with the note values based on some conditionals. That is, when the MIDI channel is the desired one, populate an array or function table on note-on events, whilst you would delete those specific entries upon note-off events from the same MIDI channel. Then iterate through that f.table/array to create an arpeggio from chords. I might try to realise this idea as an UDO at a later date.

Thanks anyway for quick response! Despite having potentially found a solution, I might consider submitting a ticket to the Csound Github issue tracker, since selective listening would be a very nice feature to have at the opcode level.

Yeah this is basically what the midi arp opcode called does. I’m kicking myself that I didn’t add a midi channel option to it when I wrote it, it seems so obvious now :see_no_evil:

I did create a prototype UDO when I was writing the opcode, I’ll have a look for it and see if I can find it.

I did create a prototype UDO when I was writing the opcode, I’ll have a look for it and see if I can find it.

If you can find it then I would be extremely grateful! If not then I don’t mind spending some extra hours crunching code trying to work it out myself :slight_smile:

I spent some time looking through old files but I couldn’t find it. I have a feeling it was on a Linux partition that has since been overwritten :roll_eyes: