On Thursday 26 June 2014 19:49:21 Holger Marzen wrote:
> I tested some more. The sfz-file begins with:
> 
> <group>
> seq_length=2
> ampeg_decay=37
> ampeg_sustain=0.001
> ampeg_release=0.4
> loop_mode=loop_continuous
> <region>
> sample=1_E_a.wav
> lokey=0 hikey=28
> [...]
> 
> I noticed that if I set seq_length=1 the clicks don't happen.
> 
> The clicks only happen when
> - seq_length=2
> - the same note gets play twice, so that it cycles through the 2 samples
> 
> Is this a known bug? Is there a workaround by changing some parms in the
> sfz-file?

I am not an SFZ expert, so maybe Andreas or Grigor can comment better on it.

seq_* opcodes seems to define "round robin" selection for regions in the SFZ 
format. I just had a short look at current SFZ code, and as far as I could see 
it right now, round robin selection in the SFZ engine could indeed be buggy.

bool Region::OnKey(const Query& q) [src/engines/sfz/sfz.cpp]

is called by the SFZ engine on each region, when a new note was triggered, to 
check which region shall be used and played. However that method ATM assumes 
to be called only once and due to this increments the round robin counter at 
the end of its call. The SFZ engine however calls this in a while loop:

        while (::sfz::Region* region = q.next()) {
                                                        
[src/engines/sfz/Engine.cpp, line 110]

which seems to cause the misbehavior you encountered. That is, that it falsely 
also triggers the 2nd region you have there at the same time.

So IMO the round robin counter should be incremented after that loop, but not 
inside Region::OnKey().

CU
Christian

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel

Reply via email to