confusion about MIDI, lists and numbers

Dave Clements's icon

Difficult one to explain.

If you create the 'midiparse' object and access the help file, you'll see that the MIDI messages used as an example as MIDI going into the object are all separated by commas:
eg. 144, 60, 80
(note/chn1 - 60 - vel80)

This causes the MIDI parse to recognise MIDI coming in.

However, if you make the message without the commas, it won't recognise it as MIDI. But if you connect that to a midiout object, it will!!

So is 'midiparse' just faulty? Or is there some specific info about the time delay between MIDI bytes that is relevant here?

Thanks

Dave Clements's icon

just bumping this cause i could really do with some info here. Please comment even if you're not sure so we can discuss and maybe find the answer.
Do MIDI messages require commas?

Source Audio's icon

Midi messages are serial protocol, and behave so.
Midiparse is meant to deal with real world midi,
which comes in byte by byte, not as list.
That's why it expects input to be single integer at a time.
Midiout will work with both, comma separated or not
messages, (it iters the list) so be happy not to be forced to enter all that commas.
As well You can send message 127 7 11 to ctlout
to send volume 127 on channel 11.
When one deals with messages one can use iter for lists to output items one by one,
or thresh for incoming ints to group them into list.

Roman Thilenius's icon

...unless you put a midiout object in "bytes" mode, where each byte is send seperatly.
but this is only useful during debugging, you should never build an app behaving like that.

btw, if you dont like midiparse then just build your own. you are free to interpret the data which midiin spits out like you want it to be. for example you could use [tresh 3] to collect notes into chords already, completely ignore the channel or whatever.