On Monday, April 18, 2016 22:51:37 JP Cimalando wrote: > Hi, lately I've stumbled upon an old article that sings praise of > Akai S1000 samplers and the resampling algorithm it used. > This piqued my curiosity and inspired me to try implementing a sinc > resampler into LS for comparison.
Hi JP, interesting stuff! > I attach my code to the message, as patch against svn trunk. > Link to the article: http://martin78.com/samplers/akai-s1000-s1100/ > > -- some implementation notes: > * this is a N-point sinc resampler, where N is defined in code by > parameter SINC_NPTOTAL=SINC_NPBEFORE+SINC_NPAFTER > * code uses optimization to reduce the number of trig operations/sample > from N sin() to 1 sin() + 1 cos() > > As default I have used parameters NPBEFORE=1 NPAFTER=7, the number of > past and future samples used respectively. > This happens in some situations, with some samples of my set, to crash > LS with segfault, presumably because of out-of-bounds access by > getSample(). That suspicion is correct. > The question is: where in LS is defined how many past/future samples are > available to the resampling? > I note LS already has linear and cubic which require 2 and 4. How > to control this number? Akai S1000 supposedly has N=8, but I'd like to > also to try larger lengths. There is no such check. Branches in the synthesis core are always a bad thing, because they reduce runtime efficiency i.e. due to instruction pipelining issues, so we try to avoid branches there whenever possible. The trick is: all samples are loaded with a certain amount of additional NULL samples at their end (that is additional silence). That way the resampler will never bite beyond the scope of the allocated sample data. So you need to adjust some few files. grep for "LoadSampleDataWithNullSamplesExtension" and you will find the relevant locations. For example in file src/engines/gig/InstrumentResourceManager.cpp you find in line 676: const uint neededSilenceSamples = (maxSamplesPerCycle << CONFIG_MAX_PITCH) + 3; So the 3 here is too small for your patch. I guess you get the rest of it. Any plans to post some comparison audio files? CU Christian ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Linuxsampler-devel mailing list Linuxsampler-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel