Bidirectional looping problem

You're new to the LinuxSampler world? You don't know where to start and nothing works? Here's the place to ask for help.

Bidirectional looping problem

Postby io7m » Tue Oct 03, 2017 11:22 am

Hello.

I have the following:

http://ataxia.io7m.com/2017/10/03/fish_kit.gig

It's an experimental drum kit that uses bidirectional looping to indefinitely extend "percussion" sounds.

The problem: Bidirectional looping seems not to work for most samples. I seem to get ordinary forward looping. It's particularly noticeable on the ride cymbal samples around C4, because they have a flanging effect applied to them and it's very obvious upon listening that the sample is being looped only in the forward direction.

Is there something I'm doing wrong?
io7m
Newbie
 
Posts: 4
Joined: Tue Oct 03, 2017 11:03 am

Re: Bidirectional looping problem

Postby plusminus » Wed Oct 04, 2017 6:28 am

linuxsampler loop size needs to be in around 32000 for bidirectional loop
to kick in. You can make adjustments before compiling if you're building your own.
Read here:
https://www.linuxsampler.org/debian.html

while building instruments in gigedit, If my loop sizes are less than 32000 (usually percussions or hits),
I'll open the sample in audacity, copy and paste making the sample twice as long then reversing the pasted part.
I'll set the loop direction in gigedit to foward. You'll never hear the difference ;) .
plusminus
Newbie
 
Posts: 19
Joined: Tue Jun 21, 2016 3:32 am

Re: Bidirectional looping problem

Postby io7m » Wed Oct 04, 2017 11:17 am

plusminus wrote:linuxsampler loop size needs to be in around 32000 for bidirectional loop
to kick in.


OK, thanks!

When you say that it has to be around 32000 before looping kicks in, do you mean that the total sample length has to be >= 32000, or do you mean that the loop start point has to be at >= 32000 samples?

What's the rationale for having that minimum length? I've developed a few samplers in my time via tools like Pure Data and it seems rather odd that there'd be a minimum length at all...

plusminus wrote:while building instruments in gigedit, If my loop sizes are less than 32000 (usually percussions or hits),
I'll open the sample in audacity, copy and paste making the sample twice as long then reversing the pasted part.
I'll set the loop direction in gigedit to foward. You'll never hear the difference ;) .


Got it.
io7m
Newbie
 
Posts: 4
Joined: Tue Oct 03, 2017 11:03 am

Re: Bidirectional looping problem

Postby io7m » Wed Oct 04, 2017 5:06 pm

I've just realized you said "loop size", as in the number of samples between the loop start and loop end points.
io7m
Newbie
 
Posts: 4
Joined: Tue Oct 03, 2017 11:03 am

Re: Bidirectional looping problem

Postby plusminus » Wed Oct 04, 2017 10:42 pm

io7m wrote:I've just realized you said "loop size", as in the number of samples between the loop start and loop end points.

Sorry, i should of emphasized on that .
I also meant to say the loop size samples have to be around 32000 or greater (not in or around) for loop size to kick in.
Why this is?... i dont know. maybe sample caching.
I halved the number in "--enable-preload-samples=65536" during compile (going back to the link in my last post) allowing for smaller loop size and bidirectional looping, but with that came stream errors. I know i can find a sweet spot but I find experimenting (in audacity) by lengthening the sample; e.g. copy,paste and reversing the later half, produces interesting results with forward or bidirectional looping.
plusminus
Newbie
 
Posts: 19
Joined: Tue Jun 21, 2016 3:32 am

Re: Bidirectional looping problem

Postby io7m » Wed Oct 04, 2017 11:34 pm

Small script I'm using to preprocess samples in the manner you describe:

Code: Select all
#!/bin/sh

if [ $# -ne 2 ]
then
  echo "usage: in out" 2>&1
  exit 1
fi

FILE_IN="$1"
shift
FILE_OUT="$1"
shift

LOOP_START='0.3'
LOOP_END='0.35'

TEMPORARIES=`mktemp -d` || exit 1
trap "rm -rv $TEMPORARIES" EXIT || exit 1

#
# First, trim all leading and trailing silence from the sample.
#

TRIMMED=`mktemp -p "${TEMPORARIES}" initial_trim.XXXXXXXX.wav` || exit 1
sox -V6 "${FILE_IN}" "${TRIMMED}" silence 1 0.001 1% reverse silence 1 0.001 1% reverse || exit 1

#
# Then, measure the trimmed sample and work out where the loop
# start and loop end points should be.
#

TIME=`soxi -D "${TRIMMED}"` || exit 1
LOOP_TIME_START=`echo "${TIME} * ${LOOP_START}" | bc -l` || exit 1
LOOP_TIME_END=`echo "${TIME} * ${LOOP_END}" | bc -l` || exit 1

#
# Now, cut out the piece of audio between the start and end loop
# points, reverse it, and then concatenate copies of the ordinary
# and reversed pieces to a truncated copy of the original sample.
#

SPLIT_FORWARDS=`mktemp -p "${TEMPORARIES}" half_f.XXXXXXXX.wav` || exit 1
SPLIT_BACKWARDS=`mktemp -p "${TEMPORARIES}" half_r.XXXXXXXX.wav` || exit 1
SPLIT_INITIAL=`mktemp -p "${TEMPORARIES}" init.XXXXXXXX.wav` || exit 1

sox -V6 "${TRIMMED}" "${SPLIT_INITIAL}" trim 0 "${LOOP_TIME_START}" || exit 1
sox -V6 "${TRIMMED}" "${SPLIT_FORWARDS}" trim "${LOOP_TIME_START}" "${LOOP_TIME_END}" || exit 1
sox -V6 "${SPLIT_FORWARDS}" "${SPLIT_BACKWARDS}" reverse || exit 1

SEQUENCE="${SPLIT_INITIAL} ${SPLIT_FORWARDS}"
SEQUENCE="${SEQUENCE} ${SPLIT_BACKWARDS} ${SPLIT_FORWARDS}"
SEQUENCE="${SEQUENCE} ${SPLIT_BACKWARDS} ${SPLIT_FORWARDS}"
SEQUENCE="${SEQUENCE} ${SPLIT_BACKWARDS} ${SPLIT_FORWARDS}"
SEQUENCE="${SEQUENCE} ${SPLIT_BACKWARDS} ${SPLIT_FORWARDS}"
SEQUENCE="${SEQUENCE} ${SPLIT_BACKWARDS} ${SPLIT_FORWARDS}"
SEQUENCE="${SEQUENCE} ${SPLIT_BACKWARDS} ${SPLIT_FORWARDS}"
SEQUENCE="${SEQUENCE} ${SPLIT_BACKWARDS} ${SPLIT_FORWARDS}"
SEQUENCE="${SEQUENCE} ${SPLIT_BACKWARDS}"

sox -V6 ${SEQUENCE} "${FILE_OUT}" || exit 1
io7m
Newbie
 
Posts: 4
Joined: Tue Oct 03, 2017 11:03 am

Re: Bidirectional looping problem

Postby plusminus » Thu Oct 05, 2017 2:58 am

How is this utilized?
Edit: never mind. i installed sox and it works!! This is great :mrgreen:
Thanks for this.
plusminus
Newbie
 
Posts: 19
Joined: Tue Jun 21, 2016 3:32 am


Return to Newbies & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron