Re: [LAU] makesfz.sh

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux Audio Users <linux-audio-user@...>, <linuxsampler-devel@...>
Date: Monday, January 23, 2012 - 3:26 am

--00235429c5eca3de4104b729970f
Content-Type: text/plain; charset=ISO-8859-1

Hi Linux audio users and the LS devs!

I've just updated my little wav-2-sfz sample definition file creation
script who's home is at:

http://bb.linuxsampler.org/viewtopic.php?f=7&t=667&sid=dc0c0ef3ec00363d7...

The new and likely final feature update is that now you have the option of
creating one sfz per wav or creating one sfz that maps all your wavs - I
seem to only ever want to do one or the other when homebrewing simple sfz
files.

I can see I'm going to get a lot of use out of this script now that I've
started to use Linuxsampler/qsampler so I'd like to see this script or
maybe an improved version of it included with future Linux audio distros if
it doesn't get integrated into linuxsampler or qsampler.

Thanks!

Dan

#!/bin/bash
#
# makesfz.sh
#
# Running 'makesfz.sh' with no or any other parameter than 1 will create a
.sfz
# file for every wav file in the present dir. mapping the wav to MIDI note
0.
#
# Alternatively, 'makesfz.sh 1' reads all wav files in the current dir and
creates
# a single .sfz named after the present folder mapping each sample to a
MIDI note.
#
#
# by Dan MacDonald 2012

key=0

if [ "$1" = "1" ]; then

rm -f ${PWD##*/}.sfz
echo -e "# This file was auto-generated by
makesfz.sh\n\n\nloop_mode=one_shot\n" > ${PWD##*/}.sfz

for wavs in *.wav

do
echo -e "\nsample=$wavs\nkey=$key\nlovel=0 hivel=127\n" >>
${PWD##*/}.sfz
key=$(($key+1))
done

else

for wavs in *.wav

do
echo -e "# This file was auto-generated by
makesfz.sh\n\n\nloop_mode=one_shot\n" > $wavs.sfz
echo -e "\nsample=$wavs\nkey=0\nlovel=0 hivel=127\n" >> $wavs.sfz
done

fi

On Sat, Dec 31, 2011 at 2:48 PM, Dan MacDonald wrote:

> Glad tidings I bring the free audio realm for 2012!

--00235429c5eca3de4104b729970f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Linux audio users and the LS devs!I've just updated my littl=
e wav-2-sfz sample definition file creation script who's home is at:http://bb.linuxsampler.org/view=
topic.php?f=3D7&t=3D667&sid=3Ddc0c0ef3ec00363d761700c0ef41a91f
<=
br>
The new and likely final feature update is that now you have the option=
of creating one sfz per wav or creating one sfz that maps all your wavs - =
I seem to only ever want to do one or the other when homebrewing simple sfz=
files.
I can see I'm going to get a lot of use out of this script now that=
I've started to use Linuxsampler/qsampler so I'd like to see this =
script or maybe an improved version of it included with future Linux audio =
distros if it doesn't get integrated into linuxsampler or qsampler.
Thanks!Dan#!/bin/bash## makesfz=
.sh## Running 'makesfz.sh' with no or any other parameter t=
han 1 will create a .sfz# file for every wav file in the present dir. m=
apping the wav to MIDI note 0.
## Alternatively, 'makesfz.sh 1' reads all wav files in the cur=
rent dir and creates# a single .sfz named after the present folder mapp=
ing each sample to a MIDI note.### by Dan MacDonald 2012
key=3D0if [ "$1" =3D "1" ]; thenrm =
-f ${PWD##*/}.sfzecho -e "# This file was auto-generated by makesf=
z.sh\n\n<group>\nloop_mode=3Done_shot\n" > ${PWD##*/}.sfz=

for wavs in *.wavdoecho -e "<region>\nsample=3D$wavs=
\nkey=3D$key\nlovel=3D0 hivel=3D127\n" >> ${PWD##*/}.sfzkey=
=3D$(($key+1))doneelsefor wavs in *.wavdoec=
ho -e "# This file was auto-generated by makesfz.sh\n\n<group>\n=
loop_mode=3Done_shot\n" > $wavs.sfz
echo -e "<region>\nsample=3D$wavs\nkey=3D0\nlovel=3D0 hivel=3D12=
7\n" >> $wavs.sfzdonefi<=
div class=3D"gmail_quote">On Sat, Dec 31, 2011 at 2:48 PM, Dan MacDonald <allcoms@gmail.com<=
/a>> wrote:
Glad tidings I bring the free audio realm fo=
r 2012!

After seeming years of guru meditations on this problem, I have
finally come across a method of easily using a folder of wav samples
to create sfz drum kits that can be used with Linuxsampler under
qtractor, A3, OOM or what haveth ye for DAW!!

I came across a perl script that almost sounded like it would do what
I want here
http:=
//www.drealm.info/sfz/
but I failed to get that to
work and I don't know perl to fix it yet and nor do I think I'll
bother but I will write a bash script to create a .sfz looking like so
by simply running said script in the folder containing the wav files
for your kit. Hence if you ran makesfz.sh within a dir containing
001-bassdrum.wav and 002-snaredrum.wav we would get the following
output:

<region>
sample=3D001-bassdrum.wav
key=3D0
lovel=3D0 hivel=3D127

<region>
sample=3D002-snaredrum.wav
key=3D1
lovel=3D0 hivel=3D127

I do expect someone here will have wrote such a script and added bells
already so may they be so kind as to share it so then we may add it to
the LinuxSampler online resources or get it bundled with the app
itself?

All the best for 2012!

danboid

--00235429c5eca3de4104b729970f--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAU] makesfz.sh, Dan MacDonald, (Sat Dec 31, 2:49 pm)
Re: [LAU] makesfz.sh, Dan MacDonald, (Mon Jan 23, 3:26 am)