(Uzi) send CC to selected midi channels | ctlout
Hi !
I'm looking for experienced users to give me their opinion about this subject.
I want to send random CC values to an external device. The CC parameter number is fixed, the value is randomised by an [expr random (0,127)] and I use a [ctlout] at the end. What changes is the midi channel.
For channel 1 to 8, I want to send a different value. And I want to simplify the patch and avoid duplicating the [ctlout] objects and having 8 of them for each CC parameter.
So, I started with this :
It works well if I want to send a different value for CC parameter X, to channel 1 to 8 consecutively. But sometimes, I'd like to bypass channel 3 and 4, or 5 and 6 for example.
I'd like to add an option to choose which channels are selected and then, to which channel a value should be sent.
I'd like to avoid doing it with [gates] etc. I thought I could populate a list in [coll], count the number of elements in the list (n), bang uzi (n) times etc. But I 'm sure there's a simple way to do this, maybe with the ZL objects (and I'm not familiar with them yet), that's why I ask for your help...
How would you do that ?
Thank you !
If I tweak your patch a bit then all you have to do is send a list of the channels you want to change.
Thank you for your reply Rick. But in this modification, the system sending (N) messages in a row is gone.
My question is how do I populate this list based on a selection made with checkboxes or toggle ?
I found this solution which gives me the number of bangs for uzi and the midi channel numbers concerned, based on checkboxes state. I don't know if it's very elegant and for some reason, the list length never falls back to zero when all toggles are off.
Now, I just have to find a way to 'connect' it to the rest of the patch.
I don't think you can get a list of size 0 in Max.
zl.filter doesn't output anything if it receives 0 0 0 0 0 0 0 0 as it filters out all datas in the list. To get a 0, you can do something like this:
With zl.sum you can find zero
Thanks a lot. I'm gonna adapt one of these solutions to my patch. In the meantime, I made this. That works almost fine. The zl.queue is not always updated, but close to the goal. Thanks again.
And this is the final patch. It works fine this time.
`