Posted by
Brad Fuller-3 on
May 12, 2007; 3:21am
URL: https://forum.world.st/modules-plugins-primitives-and-MIDIPlugin-tp134208p134209.html
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.htmlhttp://wiki.squeak.org/squeak/356http://wiki.squeak.org/squeak/2444more info on the squeak side: VMMaker:
http://wiki.squeak.org/squeak/2105http://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