Author |
Message |
mario.buoninfante
Joined: Jul 12, 2016 Posts: 17 Location: Salerno - Italy
|
Posted: Thu Aug 10, 2017 5:37 am Post subject:
Midi Sysex/RealTime/PrgCh messages |
 |
|
Hi all,
does anybody know why ChucK doesn't deal with anything but Note On/Off and CC's?
that's weird cause it uses RtMidi that implements the full MIDI protocol.
is there any particular reason?
cheers,
Mario |
|
Back to top
|
|
 |
MusicMan11712
Joined: Aug 08, 2009 Posts: 1082 Location: Out scouting . . .
|
Posted: Thu Aug 10, 2017 5:49 am Post subject:
|
 |
|
I haven't looked at or used ChucK midi in years; so, I am not sure if they ever fixed the issues from several years ago. The best thing to do is to look at how ChucK implements midi (i.e., look at the source code). I seem to recall it is based on 3-byte structures--even if you try to use 2-byte or 1-byte midi commands. From my experience, don't even try sysex--the order of sending 3-byte commands scrambles sysex.
I seem to recall that 2-byte CC commands worked, though I think I might have written some on-the-fly CC thinning code to avoid a lot of processing.
Other than experimenting, I basically used ChucK for on-the-fly PC-based midi routing.
As you probably know you can hardcode midi ports based on Chuck --probe's listing. If you do that, powerup order [the order your PC enumerates midi devices] will affect the device offsets. Or, you can get more elaborate to assign device offsets to be independent of powerup order.
Unless Chuck's Midi code has been fix in the past 5-7 years, don't waste your time trying to do sysex--just my opinion.
Steve
http://electro-music.com/forum/topic-37351.html |
|
Back to top
|
|
 |
mario.buoninfante
Joined: Jul 12, 2016 Posts: 17 Location: Salerno - Italy
|
Posted: Thu Aug 10, 2017 6:32 am Post subject:
|
 |
|
Hi Steve,
thanks for your reply. Honestly I'd like to see a "normal implementation", I don't really want to force ChucK's behavior, trying several tricks (I know several guys have done this).
I know what you mean, and I know this is an old topic. unfortunately I'm not a C++ programmer (I used to deal with scripting language and audio language - including ChucK of course ), so I can't help too much in this case (Gee, I'd really like to!). but having a look at the source code, yes, it seems that everything has to be contained within a 3 bytes array. but I can't figure out why this decision was taken.
ChucK's implementation is based on RtMidi, that deals with the entire MIDI protocol. that means they left out those messages on purpose. weird.
I mean, nowadays having a strong MIDI implementation is essential for an Audio Midi programming language, and this is one of the few stuff that ChucK doesn't have. in my humble opinion this is one of the most flexible programming language (clear syntax, time based, STK audio generators, deals with Faust, offer the possibility to live code, etc.), and I'm seeing some important steps (kadenze courses, few updates on github, etc.), but I don't know why, I always have the feeling that it should be pushed further! as I said, at the moment I can't contribute to it (at least talking about source code - I can contribute only at a higher level: ChucK libraries, advertising it, creating music with it, etc.), I'm about to study C++, but of course it takes time before I can active contribute developing it (but it's really on my schedule! - I need get rid of this restrictions ). but anyway, on ChucK Programming Language group on Facebook one guy told me will take a look at it (of course whenever he'll have time). so, I'll give a shout as soon as I hear something from him.
cheers,
Mario |
|
Back to top
|
|
 |
feltworkshop
Joined: Dec 16, 2015 Posts: 3 Location: Sydney, Australia
|
Posted: Wed Jul 18, 2018 3:38 am Post subject:
Re: Midi Sysex/RealTime/PrgCh messages |
 |
|
mario.buoninfante wrote: | Hi all,
does anybody know why ChucK doesn't deal with anything but Note On/Off and CC's?
|
hey I know I'm a year late (re-activating my account along with old ChucK code) but I can send & receive MIDI clock & transport msgs - these and note/CC stuff do everything I need to do at pres. although my needs are fairly basic (live-coding for MIDI synths).
I can post some code snippets.
A |
|
Back to top
|
|
 |
mario.buoninfante
Joined: Jul 12, 2016 Posts: 17 Location: Salerno - Italy
|
Posted: Thu Jul 19, 2018 1:01 pm Post subject:
|
 |
|
Hi,
yap it actually seems to receive everything but sysex and send everything but sysex and real time.
I hope this will get soon fixed. as I said several times I thing it's crucial to have a complete MIDI implementation, otherwise it would be difficult to deal with a lot of gears.
cheers,
Mario |
|
Back to top
|
|
 |
MusicMan11712
Joined: Aug 08, 2009 Posts: 1082 Location: Out scouting . . .
|
Posted: Mon Jul 30, 2018 6:47 pm Post subject:
|
 |
|
It's been a while since I looked at ChucK's midi code. I do remember running tests to see if it would be possible for it to do sysex. I could be wrong, but I seem to recall that the structures used a 3-byte format and that trying to cram sysex into a series of 3-byte structures messed up the order of sysex data.
Again, this was a few years back and I haven't done anything much with ChucK in recent years.
IIRC, 1-byte and 2-byte midi commands just use the 1st one or two bytes of the 3-byte structure. If I am remembering correctly, that would explain why 1-byte and 2-byte midi commands seem to work.
Don't trust my memory, though--I highly recommend looking at the midi code in ChucK. IIRC, the coder(s) knew midi was not fully developed and even had a comment (something like "figure out what's going on here").
Steve |
|
Back to top
|
|
 |
|