[chuck-users] multiple midi ports (solved) + chuck fourth

Thomas Girod girodt at gmail.com
Tue Nov 2 05:29:23 EDT 2010


@kassen & stefan

thank you guys for your advices, especially for the "chuck --probe"
thing - I finally managed to get where I wanted.

by the way, anyone with a launchpad can test the result:

http://github.com/jiyunatori/chuck/blob/master/fourth.ck

example: chuck fourth.ck:1:3:2:4

1 = launchpad midi port
3 = synth midi port
2 = starting octave
4 = interval between notes

a scale is built for each row of the controller by using the given
interval. the next row is the same scale shifted by one semitone.

have fun


On Sun, Oct 31, 2010 at 03:54:17AM +0100, Kassen wrote:
> Hey Tom!
> 
> 
> 
>     That's what I thought too, as it seemed logical. but it doesn't work.
> 
> 
> Ok. Well, that should work so we'll have to trace where it fails then....
>  
> 
>     Let's say I don't have any alsa-midi apps running. in qjackctl, I only
>     have "Midi Through" (in and out)
> 
> 
> And no hardware MIDI ports either, right?
>  
> 
> 
>     % chuck-jack test.ck:0
> 
>     this will create a new MidiIn and connect it to "Midi Through (out)".
> 
> 
> 
> Yes. good.
>  
> 
>     % chuck-jack test.ck:1
> 
>     this won't work, with this message :
> 
>     > [chuck]: MidiIn: couldn't open MIDI port 1...
> 
>     my conclusion: the port parameter to the MidiIn.open() function is not
>     the number of the port you open, but the port number of the source or
>     the target to which it is supposed to be connected.
> 
>     ... which isn't that useful, in my opinion.
> 
> 
> 
> I think I understand the issue. Inside of ChucK and in your code there are
> objects of type MidiIn. The objects are abstractions for hardware ports and/or
> virtual ports that might exist on your system. We link the objects to the ports
> using .open( int device ) These objects have names in our code, like "min" in
> your case; I tend to name mine after the controller or synth used which I find
> helps keep things clear. The objects in our code don't have numbers, typically.
> 
> The numbers you saw correspond to the number of the device. If you run this;
> 
> chuck --probe
> 
> (might be "chuck-jack --probe" in your case)
> At your terminal you will see a list of available soundcards and MIDI devices
> with their ID number. The MIDI stuff will be at the bottom of the output of
> that command. The numbers of those correspond to the numbers for devices to
> open using the .open() function. I suspect that you would only see a single
> input device there, with number "0". If so then that would explain the failure
> at opening the second devices (numbered at "1").
> 
> If that's right that would mean you only have a single virtual port on your
> system and no hardware attached (at least no working hardware). That would mean
> that -for once  ;¬) -  ChucK would be working fine and the question becomes
> what you were trying to do and how you could accomplish that.
> 
> Could you confirm this is all more or less right? If something is still unclear
> we can take another step back.
> 
> Yours,
> Kas.


More information about the chuck-users mailing list