electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time

poster

Please visit the chat
 Forum index » Instruments and Equipment » MIDI Controllers and Interfaces
Generate MIDI clock messages from Chuck
Post new topic   Reply to topic Moderators: jksuperstar
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
happilylazy



Joined: Oct 08, 2015
Posts: 4
Location: Croatia

PostPosted: Thu Oct 08, 2015 2:39 am    Post subject: Generate MIDI clock messages from Chuck Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4146
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Thu Oct 08, 2015 11:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

welcome happilylazy!

I remembered grappling with this earlier, so I found this old thread:

http://electro-music.com/forum/viewtopic.php?highlight=clock&t=40772

Hope it gives some insight! It may be that developments have been made in ChucK to make this stuff easier these days, but I can't remember that I have heard anything in particular that would suggest that that is the case.

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
happilylazy



Joined: Oct 08, 2015
Posts: 4
Location: Croatia

PostPosted: Fri Oct 09, 2015 1:14 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4146
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Fri Oct 09, 2015 3:18 am    Post subject: Reply with quote  Mark this post and the followings unread

The argument to mout.open(...) needs to match the id you get when you run chuck like this:

Code:

chuck --probe


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
View user's profile Send private message Visit poster's website
happilylazy



Joined: Oct 08, 2015
Posts: 4
Location: Croatia

PostPosted: Mon Oct 12, 2015 12:28 am    Post subject: Reply with quote  Mark this post and the followings unread

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
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4146
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Mon Oct 12, 2015 1:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

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. Smile

https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
happilylazy



Joined: Oct 08, 2015
Posts: 4
Location: Croatia

PostPosted: Fri Oct 16, 2015 7:25 am    Post subject: Reply with quote  Mark this post and the followings unread

@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
View user's profile Send private message
Antimon



Joined: Jan 18, 2005
Posts: 4146
Location: Sweden
Audio files: 371
G2 patch files: 100

PostPosted: Fri Oct 16, 2015 12:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

That's great to hear! Very Happy Happy chucking and clocking!
_________________
Antimon's Window
@soundcloud @Flattr home - you can't explain music
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: jksuperstar
Page 1 of 1 [8 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » Instruments and Equipment » MIDI Controllers and Interfaces
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use