[LAD] Program design: C++ -> SHM -> Python

Olivier Guilyardi list at samalyse.com
Mon Dec 27 11:51:09 UTC 2010


On 12/26/2010 01:37 PM, Harry Van Haaren wrote:
> 
> 
> On Sun, Dec 26, 2010 at 11:20 AM, <fons at kokkinizita.net
> <mailto:fons at kokkinizita.net>> wrote:
> 
>     Depends entirely on if the delay is acceptable or not. You can send
>     it as
>     a binary blob - encoding each sample would be quite a waste of time.
> 
> 
> I should have specified: The data will be the Sample played back by the
> engine,
> and it will be sent to the GUI, to be able to show the waveform /
> spectral etc info.
> 
> IMO: Delay acceptable yes. Binary blob is good advice, thanks.

If you want to display a live waveform/spectrum while receiving data through
OSC, then I recommend that each packet is timestamped, so that you can
synchronize the graphics with audio output.

Also, if you don't need sample-level zooming in your waveform, you could send
peaks of blocks of a fixed size. Streaming the entire sample data through OSC
could be heavy IMO. Similarly, for the spectrum, you could compute it in the
engine, and send frequency peaks through OSC.

But for all that, you'll need accurate timestamps for each packet. Such accurate
timestamps can be tricky to produce. I made a small library for this purpose:
http://code.google.com/p/libtimefilter/

--
  Olivier




More information about the Linux-audio-dev mailing list