[PD-dev] Re: [PD] midiout broken

IOhannes m zmoelnig zmoelnig at iem.at
Tue Nov 15 10:01:58 CET 2005


(moving this thread to pd-dev where i think it belongs)

federico wrote:
> günter geiger ha scritto:
> 
>> On Sun, 13 Nov 2005, federico wrote:
>>  
>>
>>> I don't see any changes from my local version.
>>> last time I checked midiout functionality with alsa_midi, note and
>>> controllers worked ok, but system exclusive were not transmitted.
>>> in fact I discovered that sys_alsa_putmidibyte never gets called (!).
>>> in addition I am not sure if a message can be sent to alsa byte-per-byte
>>> instead of passing the entire buffer, i should look at the docs...
>>>   
>>
>>
>> I fear that in order to make midiout work with ALSA one has to implement
>> a midi parser and send the single events. Thats why Miller says its
>> "wrong-headed".
>>
>> Somone should really try to figure out how raw midi streams can be
>> sent via the ALSA sequencer interface, maybe there's a way.
>>  
>>
> this patch was submitted time ago.
> what does tries to fix?
> it simply parses for system exclusive messages (they begin with 0xf0 and 
> end with 0xf7) so we put everithing that comes between 0xf0...0xf7 in a 
> buffer, and when receiving the 0xf7 byte (end-of-sysex) we send the 
> entire buffer to alsa.
> this should be the right way of doing it.
> since note&controllers worked, i think it is okay sending them like we 
> actually do.
> 
> however when I tried this didn't work because sys_alsa_putmidibyte 
> doesn't gets called.
> how do I re-enable it?
> 

look at the patch i have submitted yesterday to the patch-tracker.
it does exactly this: enable that calling of sys_alsa_putmidibyte() from 
within [midiout] (depending on which midi-api is used)


however, i am not totally convinced of wrapping [midiout] into "real" 
sysex-blocks.
for this i would suggest a separate [sysexout]-object.


the old code does work fine (_if_ sys_alsa_putmidibyte() gets called!)
the memory leak, günter was referring too, could be fixed by just _not_ 
allocating dataptr without freeing it.

the attached stupid little patch seems to work here (again i just tested 
it with aconnecting the pd's midiout with pd's midiin)


mfg.asd.r
IOhannes
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: midiout_alsa.patch
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20051115/3deb800c/attachment.asc>


More information about the Pd-dev mailing list