[PD] pd-lork and midi on osX

Christof Ressi christof.ressi at gmx.at
Sun May 5 22:42:45 CEST 2019


on macOS, if you send too many MIDI messages *at once*, you fill up the internal buffer; portmidi will flush the buffer and sleep for a certain amount of time as a kind of speed limit. breaking up the messages into smaller packets and spreading them evenly across the timeframe helps to avoid that. I tested on an old Macbook with a virtual MIDI port and using a faster [metro] with smaller messages improves the behavior noticably. on Windows there is no difference because MIDI messages just go to midiOutShortMsg.

Christof

PS: I think you can actually disable the speedlimit with "#define LIMIT_RATE 0" in pmmacosxcm.c. This should give you the original Pd extended behavior.


> Gesendet: Sonntag, 05. Mai 2019 um 20:41 Uhr
> Von: "Lucas Cordiviola" <lucarda27 at hotmail.com>
> An: "cyrille henry" <ch at chnry.net>, "Christof Ressi" <christof.ressi at gmx.at>
> Cc: Pd-List <pd-list at lists.iem.at>
> Betreff: Re: [PD] pd-lork and midi on osX
>
> It probably helps as you might be filling the hardware buffer for the 
> next DMX frame.
> 
> 
> --
> 
> Mensaje telepatico asistido por maquinas.
> 
> On 5/5/2019 3:10 PM, cyrille henry wrote:
> > thanks for the suggestion,
> >
> > I don't understand why it will help, but I'll try in 2 week, when I 
> > get the computer again.
> >
> > cheers
> > c
> >
> >
> > Le 05/05/2019 à 12:50, Christof Ressi a écrit :
> >> I think I've found the issue: the portmidi version used in Pd vanilla 
> >> throttles the data rate on macOS, while the older version used by Pd 
> >> extended 0.43 doesn't! I'll post more details on GitHub. I think my 
> >> suggestion of spreading your messages across several ticks will help.
> >>
> >> Christof
> >>
> >>
> >>> Gesendet: Sonntag, 05. Mai 2019 um 11:40 Uhr
> >>> Von: "cyrille henry" <ch at chnry.net>
> >>> An: "Christof Ressi" <christof.ressi at gmx.at>, Pd-List 
> >>> <pd-list at lists.iem.at>
> >>> Betreff: Re: Aw: [PD] pd-lork and midi on osX
> >>>
> >>> hello,
> >>>
> >>> Thanks for looking at this problem.
> >>>
> >>> The test patch is very similar to my situation.
> >>> I use a DMX interface that is visible by a computer as a midi device 
> >>> over a USB connection. It allow to control lighting device from any 
> >>> musical software.
> >>> This interface use class compliant usb/midi driver and control 2 dmx 
> >>> univers (i.e 1024 lighting devices)
> >>>
> >>> a DMX frame is about 20ms. So I need to send 1024 value every 20ms.
> >>> 10 years ago, windows drivers did allow only 1 midi message every 
> >>> ms, so it was not possible to use this interface on windows. But I 
> >>> was working fine on osX and linux.
> >>> I did not test on windows since. It still work on linux. It works on 
> >>> pd-extended on osX but not with pd vanilla 0.49 on osX. I did not 
> >>> test any other pd version on osX because I don't have a mac at home. 
> >>> I'll make more test in few weeks.
> >>> (when I says that it did not work, I mean that you can't send 1024 
> >>> value every 20ms, but you can send 100 every 20ms)
> >>>
> >>> If you try my test patch with a USB/MIDI interface, you will face 
> >>> problems : midi is to slow, so pd will hang or data will be lost.
> >>> You should only use this test patch with something that can receive 
> >>> midi that fast : a virtual port, or a hardware that did not convert 
> >>> this data to midi informations.
> >>>
> >>> I will try sending 50 messages every ms, but "almost gone" is not 
> >>> satisfying.
> >>>
> >>> cheers
> >>> Cyrille
> >>>
> >>>
> >>> Le 04/05/2019 à 03:11, Christof Ressi a écrit :
> >>>> Hi, I don't know what your actual patch looks like, but I noticed 
> >>>> that when I spread the MIDI messages evenly by sending 50 messages 
> >>>> every 1 ms instead of 1024 every 20 ms, the delay on my USB 
> >>>> interface is almost gone. Maybe this improves your situation. The 
> >>>> real problem, however, is that sending MIDI on Windows and macOS 
> >>>> via portmidi is currently a blocking operation and this has to be 
> >>>> fixed.
> >>>>
> >>>> Christof
> >>>>
> >>>>
> >>>>> Gesendet: Freitag, 03. Mai 2019 um 10:19 Uhr
> >>>>> Von: "cyrille henry" <ch at chnry.net>
> >>>>> An: "pd-list at lists.iem.at" <pd-list at lists.iem.at>
> >>>>> Betreff: [PD] pd-lork and midi on osX
> >>>>>
> >>>>> Hello,
> >>>>> I'm trying to find a solution for my project where large amount of 
> >>>>> midi data should be send.
> >>>>> This bug prevent me to use latest vanilla : 
> >>>>> https://github.com/pure-data/pure-data/issues/581
> >>>>> and I want to avoid using pd-extended.
> >>>>>
> >>>>> The final project will run on osX, but I don't have a computer to 
> >>>>> test on this platform.
> >>>>> Can someone tell me if pd-l2ork will do a better job at sending 
> >>>>> midi data at fast rate?
> >>>>>
> >>>>> thanks
> >>>>> Cyrille
> >>>>>
> >>>>>
> >>>>>
> >>>>> _______________________________________________
> >>>>> Pd-list at lists.iem.at mailing list
> >>>>> UNSUBSCRIBE and account-management -> 
> >>>>> https://lists.puredata.info/listinfo/pd-list
> >>>>>
> >>>>
> >>>
> >>
> >
> >
> >
> > _______________________________________________
> > Pd-list at lists.iem.at mailing list
> > UNSUBSCRIBE and account-management -> 
> > https://lists.puredata.info/listinfo/pd-list
>





More information about the Pd-list mailing list