Subject: Re: [linux-audio-user] virtual sampler
From: Juan Linietsky (coding_AT_reduz.com.ar)
Date: Thu Mar 21 2002 - 21:16:20 EET
On Thu, 21 Mar 2002 18:12:38 +0000
Nick D <nixx_AT_nixx.org.uk> wrote:
> On Thu, 21 Mar 2002 14:05:09 -0300
> Juan Linietsky <coding_AT_reduz.com.ar> wrote:
> > Ah, let me clarify on the "cpu hog" usage. When I make music, i tend to
> > mix several voices together, like a drum track, bass, some low pad, strings or normal pads, arrangements such as trumpets, brasses, resonators, bellpads, waves, etc, maybe lead instruments, or a piano,
> > organ,rhodes,etc. This needs a huge amount of simultaneous channel playback, around 50,60 or so if i'm using proper falloff in the envelopes (not abrupt). Trackers have been supporting this (since impulse tracker), for many years now, but usually people that writes some kind of synth engine (wavetable or oscilator based) never seems to go for speed (poliphony). ...
> I don't think that's necessarily the case.. getting these things to run >fast is far from easy given the amount of computation involved, and >having something which works is surely more important? plus, if there >_were_ a documented way of getting much better performance, surely >everyone would use it? i certainly would ;-)
It's not hard, basically, the idea is using fixed point math,
so you can easily take advantage of integer math being much faster.
There's also many factors that will affect the performance of your app
such as avoiding the use of stack in critical zones, avoiding large
precomputed tables due to cache size/associability restriction,
using "register" in values that hold the arithmetical operations (yes it does work! i think gcc moves the variable to eax instead of using ebp offset), and ensure that your code is simple enough so gcc can do a good work optimizing it. MMX is also nice for speeding up because it can manage 64bits and many useful complex arithmetial operations, I havent checked 3Dnow, simd, etc but i'm sure that those can be even more useful.
This archive was generated by hypermail 2b28 : Thu Mar 21 2002 - 21:02:36 EET