mc.edge~ help needed

reesa's icon

Hi all,

I am trying to use the voice index outlet of mc.edge~ in combination with a stored list of MIDI values. I have 50 channels of audio using mc, I want to get the voice number of any channel that has an onset event, send that voice index to zl.lookup, which then gives me a stored MIDI value for use in a poly~.

However mc.edge~ only seems to be able to output single values from the voice index at a time and not a list of simultaneously received values from an mc signal.

What other possibilities would I have to detect multichannel onset events and give me a list of voice values?

I am not sure I can combine single values into a list because the incoming information is too variable. Perhaps if we said 'if these multiple voice index numbers arrived within 2ms then make a list and output'?

Thanks in advance.

Source Audio's icon

from edge~ help file

reesa's icon

Great, thank you I will give this a spin.

reesa's icon

I have a follow up question.

I now have my two lists which I need to combine and reformat for the poly~.

I have a MIDI value and a voice value.

42.643233 2

Need to reformat the lists like this,

42.643233, target 2,

I'm unsure to to achieve this.

When the patch is running the list length can vary from 1 MIDI value + 1 voice value ... to up to 50 of each.

I have attached a bit of code with the essential problem.

Thank you!

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

correct message would be target 2, 42.643233

because you first have to set target, then send a value.

you could also use coll with embedded note values

reesa's icon

Thanks! I did not see that coll solution at first. I am constantly changing the MIDI values so I will stay with the structure I have now I think which is basically an mc.snapshot <> mc.makelist pair and zl.lookup.

Lastly, normally commas separate messages but they seem to be vital in the final list here for the poly~ to understand what is going on...

How to add commas into the formatting?

reesa's icon

getting close. I think a prepend will do the trick

prepend ,
Wil's icon

chiming in

you can use [sprintf} to get commas

might want to reconsider zl.len -> zl.group


reesa's icon

Thanks. I tried using sprintf earlier but it didn't seem happy with lists. I think now there is a structure to iterate through the list in pairs then group values again before sending to the poly~ things will be happier.

Wil's icon

not sure what you are doing- but I might use this later

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

I don't see why should you group messages at all ?

if you change midi values all the time, dump them into coll.

if you use full lists with 50 midi values , insert listfunnel 1

to store them into coll.

Can't be simpler.

reesa's icon

OK I will try that out. Thanks.

reesa's icon

Also Wil, how unlikely is it that you know Raphael Marsonet?! He is a good friend of mine from university in Sydney way back in the day.

Wil's icon

Small world! I did quite a few performances with Raphael when he was in Korea!

After thinking about it - (I do poly~ completely different) - I agree with SOURCE AUDIO

reesa's icon

OK did a coll version and I agree it's nice and elegant.

The overall patch seems to be working well now.

Detecting onsets using mc.delta~ is being strange. I can worry about that next :)

Big thanks.

Source Audio's icon

rememeber that example I posted triggered on phasor cycle, not audio onset

this is not optimal way :

this is all it needs:

reesa's icon

Hi. Sorry i am a bit confused by the last message.

Source Audio's icon

Confused ?

Can you describe what could I try to explain better ?

Is it about edge~ detecting or target message ?

reesa's icon

OK I see what you mean now. I had not put a comma in the message and so it was not working.

target $1, $2 

Wil's icon

I think he means this :)

reesa's icon

yep I did that. All is clear once again :)

Thank you both for all the assistance.