modules, plugins, primitives, and MIDIPlugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

modules, plugins, primitives, and MIDIPlugin

dabrowsa@indiana.edu
Can someone briefly explain how MIDIPlugin is supposed to work?

In the code for SimpleMIDIPort I see the following method.

> primMIDIOpenPort: portNum readSemaIndex: readSemaIndex
> interfaceClockRate: interfaceClockRate "Open the given MIDI port. If
> non-zero, readSemaIndex specifies the index in the external objects
> array of a semaphore to be signalled when incoming MIDI data is
> available. Not all platforms support signalling the read semaphore.
> InterfaceClockRate specifies the clock rate of the external MIDI
> interface adaptor on Macintosh computers; it is ignored on other
> platforms."
>
> <primitive: 'primitiveMIDIOpenPort' module: 'MIDIPlugin'> self
> primitiveFailed.
I'm guessing that the line "<primitive: 'primitiveMIDIOpenPort' module:
'MIDIPlugin'> self" is call to something external to the current squeak
image.

When I try to execute the primMIDIOpenPort method I get a
"primitivefailed" error message.  Is this because my current image can't
find the external resource?

I'm running Ubuntu 7.04, and in the Squeak directory there is file
called "SqueakPlugin.image".  I tried copying that to same directory
with my squeak image file, but it doesn't help.  Am I supposed to
somehow load the plugin into my image before invoking the method?

Or do I have to compile my own VM with the MIDIPlugin source code to get
this working?


_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio

dabrowsa.vcf (222 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

Brad Fuller-3
Andrew Dabrowski wrote:

> Can someone briefly explain how MIDIPlugin is supposed to work?
>
> In the code for SimpleMIDIPort I see the following method.
>
>> primMIDIOpenPort: portNum readSemaIndex: readSemaIndex
>> interfaceClockRate: interfaceClockRate "Open the given MIDI port. If
>> non-zero, readSemaIndex specifies the index in the external objects
>> array of a semaphore to be signalled when incoming MIDI data is
>> available. Not all platforms support signalling the read semaphore.
>> InterfaceClockRate specifies the clock rate of the external MIDI
>> interface adaptor on Macintosh computers; it is ignored on other
>> platforms."
>>
>> <primitive: 'primitiveMIDIOpenPort' module: 'MIDIPlugin'> self
>> primitiveFailed.
>
> I'm guessing that the line "<primitive: 'primitiveMIDIOpenPort' module:
> 'MIDIPlugin'> self" is call to something external to the current squeak
> image.
>
> When I try to execute the primMIDIOpenPort method I get a
> "primitivefailed" error message.  Is this because my current image can't
> find the external resource?
>
> I'm running Ubuntu 7.04, and in the Squeak directory there is file
> called "SqueakPlugin.image".  I tried copying that to same directory
> with my squeak image file, but it doesn't help.  Am I supposed to
> somehow load the plugin into my image before invoking the method?
I don't know what that image is. But, a method with the "prim" prefix
will call a primitive which are either in the VM or in a dynamic library
that is loaded. In this case, the MIDIPlugin is needed. As I think I
mentioned before, Florian wrote an ALSA Midi port, which is in the OLPC
branch:
http://squeakvm.org/cgi-bin/viewcvs.cgi/branches/olpc/platforms/unix/plugins/MIDIPlugin/


If you have the standard VM package, you might have the midi plugin that
are just stubs. You can look in the svn repo for it to see what I mean.

If you want to use Florian's plugin, you probably need to build it. It's
not hard, just need to know some standard unix programming. There are
two parts to it: the squeak side and the C side.

In your case, all you need to do is compile his plugin and try it out.
Some light reading:
http://bike-nomad.com/squeak/writingPlugins.html
http://wiki.squeak.org/squeak/356
http://wiki.squeak.org/squeak/2444

more info on the squeak side: VMMaker:
http://wiki.squeak.org/squeak/2105
http://wiki.squeak.org/squeak/2444


>
> Or do I have to compile my own VM with the MIDIPlugin source code to get
> this working?
>
> _______________________________________________
> SqueakAudio mailing list
> [hidden email]
> http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
>  


--
brad fuller
 website:  www.bradfuller.com
 linkedin: http://www.linkedin.com/in/bradfuller
 +1 (408) 799-6124

_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

Stéphane Rollandin
it would be nice if someone could build a MIDI-enabled linux VM and
upload it somewhere on the web... well I could have it on my site.


Stef
_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

Cesare Marilungo
Stéphane Rollandin wrote:
> it would be nice if someone could build a MIDI-enabled linux VM and
> upload it somewhere on the web... well I could have it on my site.
>
>
I have built it. But I don't know how to test. I can't see the midi
ports when squeak is running.

c.
> Stef
> _______________________________________________
> SqueakAudio mailing list
> [hidden email]
> http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
>
>


--
http://www.cesaremarilungo.com

_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

Stéphane Rollandin
Cesare Marilungo wrote:

> Stéphane Rollandin wrote:
>> it would be nice if someone could build a MIDI-enabled linux VM and
>> upload it somewhere on the web... well I could have it on my site.
>>
>>
> I have built it. But I don't know how to test. I can't see the midi
> ports when squeak is running.
>
> c.
>> Stef
>> _______________________________________________
>> SqueakAudio mailing list
>> [hidden email]
>> http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
>>
>>
>
>

_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

Stéphane Rollandin
In reply to this post by Cesare Marilungo
sorry for the empty post... I meant:

SimpleMIDIPort outputPortNumFromUser

should pop up a menu with all available MIDI ports


Stef


Cesare Marilungo wrote:
> Stéphane Rollandin wrote:
>> it would be nice if someone could build a MIDI-enabled linux VM and
>> upload it somewhere on the web... well I could have it on my site.
>>
>>
> I have built it. But I don't know how to test. I can't see the midi
> ports when squeak is running.
_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

Cesare Marilungo
Stéphane Rollandin wrote:
> sorry for the empty post... I meant:
>
> SimpleMIDIPort outputPortNumFromUser
>
> should pop up a menu with all available MIDI ports
>
I get the menu and it lists a port, with some spurious characters. But
it's not visible from outside.

If I do:

SimpleMIDIPort openDefault

I finally see it. Anyway this is only an output port.

SimpleMIDIPort inputPortNumFromUser

returns nil. I guess it's not implemented yet in the plugin, Is it?

c.

>
> Stef
>
>
> Cesare Marilungo wrote:
>> Stéphane Rollandin wrote:
>>> it would be nice if someone could build a MIDI-enabled linux VM and
>>> upload it somewhere on the web... well I could have it on my site.
>>>
>>>
>> I have built it. But I don't know how to test. I can't see the midi
>> ports when squeak is running.
> _______________________________________________
> SqueakAudio mailing list
> [hidden email]
> http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
>
>


--
http://www.cesaremarilungo.com

_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

Stéphane Rollandin
Cesare Marilungo wrote:
> SimpleMIDIPort openDefault
>
> I finally see it. Anyway this is only an output port.

that's already something !

> SimpleMIDIPort inputPortNumFromUser
>
> returns nil. I guess it's not implemented yet in the plugin, Is it?

or you may not have a MIDI IN port in your system at all...

to me, it looks like it works. maybe Mr Dabrowski could try it with muO
and see if it can produce some sounds... could you send me the VM so
that I upload it on my site for people to test it ?


Stef


_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

Stéphane Rollandin
there is now a MIDI-enabled VM for linux at:
http://www.zogotounga.net/comp/squeak/sqgeo.htm

it was built by Cesare Marilungo


Stef
_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

dabrowsa@indiana.edu
In reply to this post by dabrowsa@indiana.edu
I've just tried it and it's working for me!  The only glitch I've
noticed so far is that when I use ScorePlayer, every time I hit "play"
the connection dies, and I have to use alsaconnect to reestablish the
connection.

For the record, this is what I do.  I select a midi file with the Squeak
file browser, then open it with ScorePlayer.  I open inspector of the
ScorePlayerMorph instance, from which I open an inspector of the
ScorePlayer instance.  From that ScorePlayer inspector I can set the
midiPort variable to "SimpleMIDIPort openDefault", then make the
connection (outside squeak) using alsaconnect to my midi hardware.



> Date: Tue, 15 May 2007 19:10:15 +0200
> From: St?phane Rollandin <[hidden email]>
> Subject: Re: [SqueakAudio] modules, plugins, primitives, and
> MIDIPlugin
> Cc: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> there is now a MIDI-enabled VM for linux at:
> http://www.zogotounga.net/comp/squeak/sqgeo.htm
>
> it was built by Cesare Marilungo
>
>
> Stef
>

_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio

dabrowsa.vcf (222 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

Cesare Marilungo
Andrew Dabrowski wrote:
> I've just tried it and it's working for me!  The only glitch I've
> noticed so far is that when I use ScorePlayer, every time I hit "play"
> the connection dies, and I have to use alsaconnect to reestablish the
> connection.
It happens here too. I don't know if it's ScorePlayer or the midi
plugin's fault.

The action selector for the Play button is ScorePlayer resumePlaying
which in turn calls startMidiPlaying. Here an existing Process instance
is terminated and a new one is created. I guess this makes the
connection drop.

c.

>
> For the record, this is what I do.  I select a midi file with the
> Squeak file browser, then open it with ScorePlayer.  I open inspector
> of the ScorePlayerMorph instance, from which I open an inspector of
> the ScorePlayer instance.  From that ScorePlayer inspector I can set
> the midiPort variable to "SimpleMIDIPort openDefault", then make the
> connection (outside squeak) using alsaconnect to my midi hardware.
>
>
>
>> Date: Tue, 15 May 2007 19:10:15 +0200
>> From: St?phane Rollandin <[hidden email]>
>> Subject: Re: [SqueakAudio] modules, plugins, primitives, and
>>     MIDIPlugin
>> Cc: [hidden email]
>> Message-ID: <[hidden email]>
>> Content-Type: text/plain; charset=UTF-8; format=flowed
>>
>> there is now a MIDI-enabled VM for linux at:
>> http://www.zogotounga.net/comp/squeak/sqgeo.htm
>>
>> it was built by Cesare Marilungo
>>
>>
>> Stef
>>
> _______________________________________________
> SqueakAudio mailing list
> [hidden email]
> http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
>  


--
http://www.cesaremarilungo.com

_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

dabrowsa@indiana.edu
In reply to this post by dabrowsa@indiana.edu
>

> Andrew Dabrowski wrote:
> > I've just tried it and it's working for me!  The only glitch I've
> > noticed so far is that when I use ScorePlayer, every time I hit "play"
> > the connection dies, and I have to use alsaconnect to reestablish the
> > connection.
> It happens here too. I don't know if it's ScorePlayer or the midi
> plugin's fault.
>
> The action selector for the Play button is ScorePlayer resumePlaying
> which in turn calls startMidiPlaying. Here an existing Process instance
> is terminated and a new one is created. I guess this makes the
> connection drop.
>
>  
It seems that if I comment out the line "midiPort ensureOpen" in the
startMIDIPlaying method of the ScorePlayer then I can pause resume
without this problem.


_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio

dabrowsa.vcf (222 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin

Brad Fuller-3
In reply to this post by Stéphane Rollandin
Stéphane Rollandin wrote:
> there is now a MIDI-enabled VM for linux at:
> http://www.zogotounga.net/comp/squeak/sqgeo.htm
>
> it was built by Cesare Marilungo
>
That's great. Can we move this code into the main so that it will be
available? What do we need to do to make this available for all? I guess
this is a question for Ian.
_______________________________________________
SqueakAudio mailing list
[hidden email]
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Reply | Threaded
Open this post in threaded view
|

Re: modules, plugins, primitives, and MIDIPlugin - MIDI In yet?

Stan Shepherd
In reply to this post by Cesare Marilungo
Cesare Marilungo wrote
Stéphane Rollandin wrote:
> sorry for the empty post... I meant:
>
> SimpleMIDIPort outputPortNumFromUser
>
> should pop up a menu with all available MIDI ports
>
I get the menu and it lists a port, with some spurious characters. But
it's not visible from outside.

If I do:

SimpleMIDIPort openDefault

I finally see it. Anyway this is only an output port.

SimpleMIDIPort inputPortNumFromUser

returns nil. I guess it's not implemented yet in the plugin, Is it?

c.

>
> Stef
>
>
> Cesare Marilungo wrote:
>> Stéphane Rollandin wrote:
>>> it would be nice if someone could build a MIDI-enabled linux VM and
>>> upload it somewhere on the web... well I could have it on my site.
>>>
>>>
>> I have built it. But I don't know how to test. I can't see the midi
>> ports when squeak is running.
> _______________________________________________
> SqueakAudio mailing list
> SqueakAudio@create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
>
>


--
http://www.cesaremarilungo.com

_______________________________________________
SqueakAudio mailing list
SqueakAudio@create.ucsb.edu
http://www.create.ucsb.edu/mailman/listinfo/squeakaudio
Hi, Am I right in thinking the current status is still no MIDI in under Linux?

Thanks,    ...Stan