|
From: <be...@ga...> - 2004-05-15 10:58:37
|
Christian and I talked about how speed up the (LP/HP/BP etc) filter code.
Currently it's suboptimal because UpdateFilter() does an if() and a %
at each sample.
The a better method is to use the sythesis matrix like for pitch
and volume.
some issues: currently LS does use two separate filter instances
in case of stereo samples, but this wastes CPU since AFAIK
in other samplers filters on stereo samples are applied equally
on both the left and right channel. So you still need to run this code:
inline bq_t Apply(const bq_t x) {
bq_t y;
y = this->b0 * x + this->b1 * this->x1 + this->b2 * this->x2 +
this->a1 * this->y1 + this->a2 * this->y2;
KillDenormal(y);
this->x2 = this->x1;
this->x1 = x;
this->y2 = this->y1;
this->y1 = y;
return y;
}
two times (for each of the stereo channels), but
the coefficients can be shared thus if the filter code gets implemented
into the event synthesis matrix then instead of transfering 10 coefficients
at time two times (a1,a2,b0,b1,b2) you need only 5 and the L1/L2 cache
will say a big thank you :)
I'm still curious if transfering 5 coefficients/sample from memory is
faster than placing a conditional in the event loop and check for filter
updates which recalculate these coefficients (filter events should be
relatively sparse).
As said more benchmarking is needed here, but in the meanwhile since
Christian's event matrix is already working fine I'd say he should go ahead
with his solution. (but Christian make sure to use shared coefficients for left
and right filters).
At a later stage to speed up things further we can write a SIMD version of the
filter (SSE etc) which is especially useful in the stereo case where full
parallelism can be achieved.
http://www.northernsounds.com/ubbthreads/showflat.php?Cat=&Number=162226&page=0&view=collapsed&sb=5&o=&fpart=1#162226
Even if I'm currently not contributing code (only some ideas) at least I do some
PR for LS :)
Rui, I told northernsounds.com users that you are writing a very nice GUI, don't
disappoint them :)
Mark: about the ML archives, you are right, for some strange reason the last
months are missing (while on other projects the archives are ok).
Anyway I think the SF.net archives are buggy anyway so we should probably
simply subscribe an other ML archiving site to
About initializing LS via the LSCP, this is what Christian wrote some time ago:
> The easiest way currently is to write a LSCP script and to send it via
> netcat to the running sampler:
>
> cat yourscript.lscp | nc -t localhost 8888
you must construct your own yourscript.lscp
I'm not sure if it makes sense to ship some default lscp script for now.
perhaps some 1-2 channel example but it would need to be tweaked by the user
anyway. If you want after some experimenting you could contribute such a script
and some small README how to tweak it as the lscp PDF is a bit heavy to read :)
PS2: there is still this nasty aliasing bug in LS,
enable cubic interpolation (happens with linear too but let's use cubic
to rule out problems in the low quality interpolation code) load a piano sample
and play high notes at very low velocities, keep them sustained, you clearly
hear an aliasing noise floor which will fade away when the voice finishes
playing.
I tried to track it down (tried to remove the envelope section, did check
the mixing code) but I did not find the cause yet.
If some GSt user has some time, he could you produce a few .GIG files a non
looped pure sinewave at 0dB (full scale), 30secs of lenght, both a mono and a
stereo version. make a version with 440Hz root note and one with 3520Hz. (which
equals to 440Hz shifted up 3 octaves).
So basically 4 GIGs. In this case we can benchmark the quality of the
interpolator too. (take the 440Hz sample, play it at high pitches and check
the output, take the 3520Hz sample and play it at low pitches to see if the
wave's shape looks still good.
You can zip them together and mail them me at
sb...@ga... (I have no space limits).
and then I'll make them available on the LS site so that other people
can perform tests too.
thanks,
Benno
http://www.linuxsampler.org
-------------------------------------------------
This mail sent through http://www.gardena.net
|
|
From: Rui N. C. <rn...@rn...> - 2004-05-15 12:40:46
|
Hi Benno, > > Rui, I told northernsounds.com users that you are writing a very nice > GUI, don't disappoint them :) > I'm working on something that works in the first place; whether it's nice it's kind of subjective ;) But,... tada... I have already something that you can look at: It's qsampler! OK. It's still in prototypical alpha stage i.e. it doesn't do anything useful, but it surely is something you can preview for the intended look-and-feel right now. Qsampler's project is hosted on sourceforge.net and it's preliminar CVS repository can be checked out through anonymous (pserver) CVS with the following instructions: cvs -d:pserver:ano...@cv...:/cvsroot/qsampler login when prompted for a password, you'll know what to do: just hit enter. First, you'll need to install the liblscp package. This is for LinuxSampler Control Protocol support library, which qsampler is based: cvs -z3 -d:pserver:ano...@cv...:/cvsroot/qsampler co liblscp cd liblscp make -f Makefile.cvs ./configure make make install cd .. This will install liblscp.so under /usr/local/lib, so be sure to have it registered on your shared library path. Then, you'll may try with qsampler itself. cvs -z3 -d:pserver:ano...@cv...:/cvsroot/qsampler co qsampler cd qsampler make -f Makefile.cvs ./configure make then run ./qsampler and you'll see what I've been cookin' :) These instructions are for linux of course. But win32 support is also in the box. If someone want to try Hope you enjoy, -- rncbc aka Rui Nuno Capela rn...@rn... |
|
From: Mark K. <mk...@co...> - 2004-05-15 17:00:10
|
Rui Nuno Capela wrote:
>
> This will install liblscp.so under /usr/local/lib, so be sure to have it
> registered on your shared library path.
>
Hi,
Everything built, but I do not understand what this step means.
Where is registration done for my shared library path?
Cannot run qsampler due to just this strp I think...
Thanks,
Mark
|
|
From: Rui N. C. <rn...@rn...> - 2004-05-16 00:12:11
|
Mark, >> >> This will install liblscp.so under /usr/local/lib, so be sure to >> have it registered on your shared library path. >> > > Hi, > Everything built, but I do not understand what this step means. > Where is registration done for my shared library path? > > Cannot run qsampler due to just this strp I think... > This registration thing means that /usr/local/lib must be either on the shared object cache, as listed in /etc/ld.so.conf file, or in LD_LIBRARY_PATH environment variable search path. If you edit the former, remember to run ldconfig (as root). FWIW as a quick-start, just enter the following command line under the qsampler build directory: LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ./qsampler Feel free to report any difficulties you may find. Cheers. -- rncbc aka Rui Nuno Capela rn...@rn... |
|
From: Marek P. <ma...@na...> - 2004-05-16 10:16:28
|
On Sun, 2004-05-16 at 02:09, Rui Nuno Capela wrote: > Mark, > > >> > >> This will install liblscp.so under /usr/local/lib, so be sure to > >> have it registered on your shared library path. > >> > > > > Hi, > > Everything built, but I do not understand what this step means. > > Where is registration done for my shared library path? > > > > Cannot run qsampler due to just this strp I think... > > > > This registration thing means that /usr/local/lib must be either on the > shared object cache, as listed in /etc/ld.so.conf file, or in > LD_LIBRARY_PATH environment variable search path. If you edit the former, > remember to run ldconfig (as root). > > FWIW as a quick-start, just enter the following command line under the > qsampler build directory: > > LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH ./qsampler > > Feel free to report any difficulties you may find. > Isn't that globally solved with the --prefix configure option? I did --prefix=/usr since i have it all there - instead of /usr/local. Marek |
|
From: Mark K. <mk...@co...> - 2004-05-16 17:04:07
|
Rui Nuno Capela wrote:
> This registration thing means that /usr/local/lib must be either on the
> shared object cache, as listed in /etc/ld.so.conf file,
Hi,
There actually seemed to be two requirements going this way:
1) /usr/local/lib in /etc/ld.so.conf
which was already true in my case, but that wasn't enough.
2) Run ldconfig to update whatever database is keeping track of the
entries that /etc/ld.so.conf is pointing to.
After doing both of those I was able to get qsampler to display last
evening.
Sorry for ht eslow replies but I don't have Internet access and am just
stopping by my office once or twice on the weekends to catch up.
- Mark
|
|
From: Christian S. <chr...@ep...> - 2004-05-15 16:30:17
|
Es geschah am Samstag, 15. Mai 2004 12:58 als be...@ga... schrieb:
> some issues: currently LS does use two separate filter instances
> in case of stereo samples, but this wastes CPU since AFAIK
> in other samplers filters on stereo samples are applied equally
> on both the left and right channel. So you still need to run this code:
>
>
> inline bq_t Apply(const bq_t x) {
> bq_t y;
>
> y = this->b0 * x + this->b1 * this->x1 + this->b2 *
> this->x2 + this->a1 * this->y1 + this->a2 * this->y2;
> KillDenormal(y);
> this->x2 = this->x1;
> this->x1 = x;
> this->y2 = this->y1;
> this->y1 = y;
>
> return y;
> }
>
> two times (for each of the stereo channels), but
> the coefficients can be shared thus if the filter code gets implemented
> into the event synthesis matrix then instead of transfering 10 coefficients
> at time two times (a1,a2,b0,b1,b2) you need only 5 and the L1/L2 cache
> will say a big thank you :)
Benno, again: the point is not mono / stereo, the point is that the
Gigasampler filter always consists of two biquad filters to create the 4
filter poles. Maybe with another filter algo there other ways but AFAIK not
with biquads. Correct me Steve if I'm telling something incorrect!
So, a Gigasampler LP filter in LS is actually one biquad BP + one biquad LP, a
Gigasampler BP in LS are two biquad BPs and a Gigasampler HP is... guess
it... yes, a biquad BP + a biquad HP. Means we still need 10 coefficients!
Anyway, I think we'll stick with the matrix idea and let all (10) filter
coefficients be calculated outside the render loop and within the render loop
we just read those 10 coefficients from the synthesis parameter matrix.
I think there will be machines where one approach might be more efficient than
the other one, so in long term of course the user will be able to choose
between e.g. either the matrix or in-loop event solution, preferebly done
automatically by some benchmarking routine on his host, controllable by a
nice GUI.
CU
Christian
P.S. I guess for the not yet implemented so called "turbo low pass" filter of
Gigasampler, we'll need even 3 biquad filters, means 15 filter coefficients,
not sure yet
|
|
From: <be...@ga...> - 2004-05-15 17:34:33
|
Scrive Christian Schoenebeck <chr...@ep...>: > > Benno, again: the point is not mono / stereo, the point is that the > Gigasampler filter always consists of two biquad filters to create the 4 > filter poles. Maybe with another filter algo there other ways but AFAIK not > with biquads. Correct me Steve if I'm telling something incorrect! sorry :) the other day when I talked to you I thought 10 coefficients meant 5 for left and 5 for right chan. But the current code base still does filterleft->apply() and filterright->apply() so the coeffs are not share yet. So please don't be too harsh with me :) > > So, a Gigasampler LP filter in LS is actually one biquad BP + one biquad LP, > a > Gigasampler BP in LS are two biquad BPs and a Gigasampler HP is... guess > it... yes, a biquad BP + a biquad HP. Means we still need 10 coefficients! ok, but isn't there a way to make the LPs with only one biquad LP ? My DSP math is a bit rusty (Steve where are you ? :) ), but if it would be possible to describe LPs and HPs with only one biquad then I guess the performance would be bigger (BP would not change I guess since you always need a LP + HP). > > Anyway, I think we'll stick with the matrix idea and let all (10) filter > coefficients be calculated outside the render loop and within the render loop > > we just read those 10 coefficients from the synthesis parameter matrix. It must be better than the current code anyway which places a if(counter % filter_update_interval) in the innermost loop :) > > I think there will be machines where one approach might be more efficient > than > the other one, so in long term of course the user will be able to choose > between e.g. either the matrix or in-loop event solution, preferebly done > automatically by some benchmarking routine on his host, controllable by a > nice GUI. I'm curious too about the performance. On a related note, today I made some benchmarks with and without filter enabled. without about 150 voices peak, with filter neabled 100-120 voices peak. Not bad I'd say. (I changed the % filter_update_interval in the if() into & filter_update_interval) since & is faster than % on most archs. the update_interval was set to 63 , fragmentsize 128 frames, jackd output. Athlon 2000 , Maxtor HD 80GB. I expected much worse performance with the filter enabled and since it's already excellent now it can only get better :) This is a piece from Chopin I rendered with the filter enabled. http://www.linuxsampler.org/misc/chopin1.mp3 more infos at the end of this thread :) http://www.northernsounds.com/ubbthreads/showflat.php?Cat=&Number=162226&page=0&view=collapsed&sb=5&o=&fpart=1#162226 > > CU > Christian > > P.S. I guess for the not yet implemented so called "turbo low pass" filter of > > Gigasampler, we'll need even 3 biquad filters, means 15 filter coefficients, > > not sure yet I'd say for now since I assume most sample libs use the standard filters let make these sound well, the rest is not that important. Anyway I thought "Turbo" meant less CPU usage thus a simpler equation in involved while you here seem to imply that the equation for the turbo LP is more complex. Another thing we will need to think about is the ability of the voice to switch on/off the filters to save CPU. I'm not sure yet what would be the best way to implement it. Either through virtual C++ classes but while quite efficient (just a jmp asm instruction more over standard classes) that would probably make it hard to switch in real time. C++ function pointers are slower than C funcpointer and I guess it's probably better not to use them. I'm not sure yet. Only benchmarking can tell us the truth. The other alternative is switch() statements, they are translated into efficient jmp tables but they do not offer the flexibility of func tables. But I guess for filter on/off switch() is ok. cheers, Benno ------------------------------------------------- This mail sent through http://www.gardena.net |
|
From: Marek P. <ma...@na...> - 2004-05-16 09:33:21
|
Hi Rui, On Sat, 2004-05-15 at 14:39, Rui Nuno Capela wrote: > Hi Benno, > > > > > Rui, I told northernsounds.com users that you are writing a very nice > > GUI, don't disappoint them :) > > > > I'm working on something that works in the first place; whether it's nice > it's kind of subjective ;) > > But,... tada... I have already something that you can look at: > > It's qsampler! > > OK. It's still in prototypical alpha stage i.e. it doesn't do anything > useful, but it surely is something you can preview for the intended > look-and-feel right now. > > Qsampler's project is hosted on sourceforge.net and it's preliminar CVS > repository can be checked out through anonymous (pserver) CVS with the > following instructions: > > cvs -d:pserver:ano...@cv...:/cvsroot/qsampler login > > when prompted for a password, you'll know what to do: just hit enter. > > First, you'll need to install the liblscp package. This is for > LinuxSampler Control Protocol support library, which qsampler is based: > > cvs -z3 -d:pserver:ano...@cv...:/cvsroot/qsampler co > liblscp > cd liblscp > make -f Makefile.cvs > ./configure > make > make install > cd .. > > This will install liblscp.so under /usr/local/lib, so be sure to have it > registered on your shared library path. > > Then, you'll may try with qsampler itself. > > cvs -z3 -d:pserver:ano...@cv...:/cvsroot/qsampler co > qsampler > cd qsampler > make -f Makefile.cvs > ./configure > make I get the following when compiling qsampler: /qsamplerMessages.cpp: In member function `void qsamplerMessages::stdoutNotify(int)': src/qsamplerMessages.cpp:100: `::read' undeclared (first use here) src/qsamplerMessages.cpp: In member function `void qsamplerMessages::setCaptureEnabled(bool)': src/qsamplerMessages.cpp:153: `::close' undeclared (first use here) src/qsamplerMessages.cpp:162: `::pipe' undeclared (first use here) src/qsamplerMessages.cpp:163: `::dup2' undeclared (first use here) src/qsamplerMessages.cpp:163: `STDOUT_FILENO' undeclared (first use this function) src/qsamplerMessages.cpp:163: (Each undeclared identifier is reported only once for each function it appears in.) src/qsamplerMessages.cpp:164: `STDERR_FILENO' undeclared (first use this function) make[1]: *** [qsamplerMessages.o] Error 1 Marek |
|
From: Marek P. <ma...@na...> - 2004-05-16 09:56:57
|
On Sun, 2004-05-16 at 13:39, Marek Peteraj wrote: > Hi Rui, > > > On Sat, 2004-05-15 at 14:39, Rui Nuno Capela wrote: > > Hi Benno, > > > > > > > > Rui, I told northernsounds.com users that you are writing a very nice > > > GUI, don't disappoint them :) > > > > > > > I'm working on something that works in the first place; whether it's nice > > it's kind of subjective ;) > > > > But,... tada... I have already something that you can look at: > > > > It's qsampler! > > > > OK. It's still in prototypical alpha stage i.e. it doesn't do anything > > useful, but it surely is something you can preview for the intended > > look-and-feel right now. > > > > Qsampler's project is hosted on sourceforge.net and it's preliminar CVS > > repository can be checked out through anonymous (pserver) CVS with the > > following instructions: > > > > cvs -d:pserver:ano...@cv...:/cvsroot/qsampler login > > > > when prompted for a password, you'll know what to do: just hit enter. > > > > First, you'll need to install the liblscp package. This is for > > LinuxSampler Control Protocol support library, which qsampler is based: > > > > cvs -z3 -d:pserver:ano...@cv...:/cvsroot/qsampler co > > liblscp > > cd liblscp > > make -f Makefile.cvs > > ./configure > > make > > make install > > cd .. > > > > This will install liblscp.so under /usr/local/lib, so be sure to have it > > registered on your shared library path. > > > > Then, you'll may try with qsampler itself. > > > > cvs -z3 -d:pserver:ano...@cv...:/cvsroot/qsampler co > > qsampler > > cd qsampler > > make -f Makefile.cvs > > ./configure > > make > > I get the following when compiling qsampler: > /qsamplerMessages.cpp: In member function `void > qsamplerMessages::stdoutNotify(int)': > src/qsamplerMessages.cpp:100: `::read' undeclared (first use here) > src/qsamplerMessages.cpp: In member function `void > qsamplerMessages::setCaptureEnabled(bool)': > src/qsamplerMessages.cpp:153: `::close' undeclared (first use here) > src/qsamplerMessages.cpp:162: `::pipe' undeclared (first use here) > src/qsamplerMessages.cpp:163: `::dup2' undeclared (first use here) > src/qsamplerMessages.cpp:163: `STDOUT_FILENO' undeclared (first use this > function) > src/qsamplerMessages.cpp:163: (Each undeclared identifier is reported > only once > for each function it appears in.) > src/qsamplerMessages.cpp:164: `STDERR_FILENO' undeclared (first use this > function) > make[1]: *** [qsamplerMessages.o] Error 1 including <unistd.h> in qsamplerMessages.cpp solved the issue, good work! :) Marek |