Author |
Message |
happilylazy
Joined: Oct 08, 2015 Posts: 4 Location: Croatia
|
Posted: Thu Oct 08, 2015 2:39 am Post subject:
Generate MIDI clock messages from Chuck |
 |
|
I am trying to sync through MIDI my Chuck patches and some hardware equipment. The reason is that Chuck generates music and I jam to it with instruments connected to effects and samplers. The problem is that those samplers and effects are BMP dependent and need this information to perform.
How can I send MIDI clock messages from Chuck?
I can't seam to find a way of doing this with MidiOut send object. I am able to send/receive out other MidiMsg's like notes and such.
I am using Win7. |
|
Back to top
|
|
 |
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
|
Back to top
|
|
 |
happilylazy
Joined: Oct 08, 2015 Posts: 4 Location: Croatia
|
Posted: Fri Oct 09, 2015 1:14 am Post subject:
|
 |
|
Thank you for the info, I got the code but found out that I have a more basic problem to solve, before I implement the clock.
I can't seam to send MIDI messages at all to any of my devices.
A small example.
I want to send B2 MIDI:(47, 100, 100). I have checked in the Device Browser > MIDI > Output and there I have my MOTU hub listed with 5 ports.
But the messages are not sent (devices are not reacting and the message indicator on my MOTU hub is not lighting up). I have tested with Pure Data and the messages are working there.
Is there a catch to do this or I am doing something wrong?
Code: | MidiOut mout;
MidiMsg msg;
// check if port is open
if( !mout.open( 0 ) ) me.exit();
// fill the message with data
47 => msg.data1;
100 => msg.data2;
100 => msg.data3;
// bugs after this point can be sent
// to the manufacturer of your synth
while( true )
{
mout.send( msg );
// allow 2 seconds to pass
2::second => now;
} |
|
|
Back to top
|
|
 |
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Fri Oct 09, 2015 3:18 am Post subject:
|
 |
|
The argument to mout.open(...) needs to match the id you get when you run chuck like this:
That will list all your midi and audio devices. Does that match the id you're using? _________________ Antimon's Window
@soundcloud @Flattr home - you can't explain music |
|
Back to top
|
|
 |
happilylazy
Joined: Oct 08, 2015 Posts: 4 Location: Croatia
|
Posted: Mon Oct 12, 2015 12:28 am Post subject:
|
 |
|
There are not many IDs listed there after running chuck --probe, just ports. Anyway, using 0 with mout.open(...) is the only number where Chuck doesn't crash. So, is using 0 OK, or am I sending MIDI msg to wrong device?
Code: | [chuck]: ------( chuck -- 5 MIDI inputs )------
[chuck]: [0] : "micro lite: Port 1"
[chuck]: [1] : "micro lite: Port 2"
[chuck]: [2] : "micro lite: Port 3"
[chuck]: [3] : "micro lite: Port 4"
[chuck]: [4] : "micro lite: Port 5"
[chuck]:
[chuck]: ------( chuck -- 6 MIDI outputs )-----
[chuck]: [0] : "Microsoft GS Wavetable Synth"
[chuck]: [1] : "micro lite: Port 1"
[chuck]: [2] : "micro lite: Port 2"
[chuck]: [3] : "micro lite: Port 3"
[chuck]: [4] : "micro lite: Port 4"
[chuck]: [5] : "micro lite: Port 5" |
|
|
Back to top
|
|
 |
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Mon Oct 12, 2015 1:30 pm Post subject:
|
 |
|
The lines listed under this heading:
Code: | [chuck]: ------( chuck -- 6 MIDI outputs )-----
|
each correspond to a midi port in your system. The numbers in brackets are what you use when calling mout.open(). Zero seems to be an internal windows synth thingie, which is probably not what you want. I am guessing that you have a MOTU micro lite MIDI interface? You should be able to use numbers one through five to access each midi out port on that device in turn.
If you get a crash when you use 1 through 5, what does it say on the prompt? Maybe it isn't the actual mout.open(1) line that is crashing, but something further down? Try removing lines and/or add log lines to pinpoint the exact place where you get a crash, and see if you can figure out what is going wrong. Maybe post the console output here.
If we get stuck or if you just want a faster response, I can recommend the chuck users's mailing list, where the guys who make chuck and other knowledgeable folk listen in and make helpful replies, faster than me.
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users _________________ Antimon's Window
@soundcloud @Flattr home - you can't explain music |
|
Back to top
|
|
 |
happilylazy
Joined: Oct 08, 2015 Posts: 4 Location: Croatia
|
Posted: Fri Oct 16, 2015 7:25 am Post subject:
|
 |
|
@Antimon: Thank you so much for the help, I got it to work for the clock message. Works perfect, without glitch or errors.
The ID's you pointed out really helped. |
|
Back to top
|
|
 |
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
|
Back to top
|
|
 |
|