Thank you very much for the explanation, Roger. Regards, Cecilio Sameron
2014-12-22 5:35 GMT+01:00 Roger Dannenberg <[email protected]>: > You should allocate enough space for the largest message. In principle if > your are reading the buffer faster than the sysex message arrives, you > don't need the buffer to be that big, but it's obviously safer not to be so > time dependent. > > There's no reallocation for large buffers because memory allocation is not > typically a real-time operation. > > Remember that a buffer slot holds either a short midi message or 4 bytes > of a sysex message, so the buffer size is something like the maximum sysex > message length in bytes divided by 4. > > -Roger > > > > On 12/21/14 4:24 PM, cecilio wrote: > > Hi, > > I have a question about portmidi: how to decide buffer size for > Pm_OpenInput(). Most of the sysex messages are short, less than 50 bytes. > But SysEx is also used to transfer large chunks of memory, such as sending > synth patches and firmware updates. And in these cases, very large buffer > sizes are required. > > Should I define the buffer size for the maximum expected sysex message? Is > there a dynamic buffer allocation facility implemented in the library so > that each time the current SysEx packet is about to fill up the buffer, a > new one, larger, is allocated, and the old one copied into it? > > Thank you > Cecilio Salmeron > > > _______________________________________________ > media_api mailing > [email protected]http://lists.create.ucsb.edu/mailman/listinfo/media_api > > > _______________________________________________ > media_api mailing list > [email protected] > http://lists.create.ucsb.edu/mailman/listinfo/media_api > >
_______________________________________________ media_api mailing list [email protected] http://lists.create.ucsb.edu/mailman/listinfo/media_api
