Triggering random samples without repeating the same one back-to-back

Discussion on the SFZ implementation and opcodes available in the ARIA engine.

Moderators: eric_telemaque, davidv

davidh
Posts: 1
Joined: Fri Dec 04, 2015 2:18 pm

Triggering random samples without repeating the same one back-to-back

Postby davidh » Fri Dec 04, 2015 3:06 pm

I have a multi-sample that I am putting together. I have four samples for each note. I don't want to use round-robin because that will result in the same sequence being used over and over again (eg. 1-2-3-4-1-2-3-4-1-2-3-4-etc). This is really noticeable when you have long string of the same note being repeated over and over again. I also don't want to use random because then sometimes you'll get the same note repeated (eg. 1-3-4-2-2-1-3-2-4-4-etc.) This is also pretty noticeable.

Here's what I would like: Each time I hit the C4 key, for example, I would like to pick a C4 sample at random, but I want to make sure that the one that gets chosen is not the same as whichever one was picked the last time.

Is this possible with the .sfz format?

pljones
Posts: 100
Joined: Wed Oct 15, 2014 2:05 pm

Re: Triggering random samples without repeating the same one back-to-back

Postby pljones » Fri Dec 04, 2015 6:17 pm

So...

When last was A, then pick from B, C, D
When last was B, then pick from A, C, D
When last was C, then pick from A, B, D
When last was D, then pick from A, B, C

You're not interested in the note number and sequence won't help... group/off_by don't help (often a life line)...

Hm... And no inspiration from Simon Cann's book. Sorry, I can't think of anything for this one...

The only other way I thought to look at it was to have the last region affect the probabilities of picking the next region by having the probability of itself be zero but I don't see a way to do that, either. (i.e. each region would have probability of (1/(n-1)) except that the playing region would acquire a probability of zero for the next trigger event.)

michaelwayneharwood
Posts: 14
Joined: Fri Nov 27, 2015 12:04 pm

Re: Triggering random samples without repeating the same one back-to-back

Postby michaelwayneharwood » Fri Dec 04, 2015 11:33 pm

This should provide the exact result you are looking for:

Code: Select all

seq_length=2
<region> sample=note-rr1.wav lorand=0 hirand=.5 seq_position=1
<region> sample=note-rr2.wav lorand=.5 hirand=1 seq_position=1
<region> sample=note-rr3.wav lorand=0 hirand=.5 seq_position=2
<region> sample=note-rr4.wav lorand=.5 hirand=1 seq_position=2


*edit for clarification*

What the above code should do is this:

The sequence counter will continually shift from the value 1 to the value 2. When it's in position 1 either note-rr1 or note-rr2 will be played (each receiving a 50% chance), and in position 2 either note-rr3 or note-rr4 will be played (also a 50% chance). No two notes will ever repeat, and a fairly random scattering of round robins should be achieved.

pljones
Posts: 100
Joined: Wed Oct 15, 2014 2:05 pm

Re: Triggering random samples without repeating the same one back-to-back

Postby pljones » Sat Dec 05, 2015 3:27 am

Yep, that'll cover all notes evenly, nicely. I wish I could get something similar to do the A followed by B, C or D... You have to keep each sequence position exclusive (as you've done), though, to avoid the possibility of repeats.

michaelwayneharwood
Posts: 14
Joined: Fri Nov 27, 2015 12:04 pm

Re: Triggering random samples without repeating the same one back-to-back

Postby michaelwayneharwood » Sat Dec 05, 2015 10:07 am

To clarify you would like to do something like:

When last was A, then pick from B, C, D
When last was B, then pick from A, C, D
When last was C, then pick from A, B, D
When last was D, then pick from A, B, C

pljones
Posts: 100
Joined: Wed Oct 15, 2014 2:05 pm

Re: Triggering random samples without repeating the same one back-to-back

Postby pljones » Sat Dec 05, 2015 12:55 pm

Yeah... it's a tricky one.

michaelwayneharwood
Posts: 14
Joined: Fri Nov 27, 2015 12:04 pm

Re: Triggering random samples without repeating the same one back-to-back

Postby michaelwayneharwood » Sat Dec 05, 2015 8:28 pm

@plhones - This is one of the situations where the SFZ format itself may not include the necessary built-in tools to do *exactly* what you want to do, but in my mind the original problem can be solved. The issue stated originally, please and correct me if I am wrong, is the desire to eliminate duplicate samples being played back to back, and avoid the machine gun effect.

The solution you wish to implement is a good one, but I can't see a way to code a simple or easy to follow implementation. If you come up with a solution I would *love* to see the code.

eric_telemaque
Posts: 215
Joined: Tue Jan 31, 2012 1:10 pm

Re: Triggering random samples without repeating the same one back-to-back

Postby eric_telemaque » Mon Dec 07, 2015 11:23 am

A trick I've seen in some orchestral libraries to alleviate the machine gun effect is the use of tiny pitch or EQ variations driven by an extremely slow LFO using a random wave.

So even when the same sample is triggered twice, it's timbre changes slightly. You can use that in conjunction with the methods above so you never hear exactly the same sound twice.
Éric Patenaude,
Plogue Art et Technologie Inc. Montreal.
http://www.plogue.com


Return to “SFZ Programming”

Who is online

Users browsing this forum: No registered users and 2 guests