[chuck-users] multiple midi ports

Kassen signal.automatique at gmail.com
Sat Oct 30 22:54:17 EDT 2010


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20101031/4d1952a5/attachment.html>


More information about the chuck-users mailing list