Hi Linux audio users and the LS devs!<br><br>I&#39;ve just updated my little wav-2-sfz sample definition file creation script who&#39;s home is at:<br><br><a href="http://bb.linuxsampler.org/viewtopic.php?f=7&amp;t=667&amp;sid=dc0c0ef3ec00363d761700c0ef41a91f">http://bb.linuxsampler.org/viewtopic.php?f=7&amp;t=667&amp;sid=dc0c0ef3ec00363d761700c0ef41a91f</a><br>
<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.<br>
<br>I can see I&#39;m going to get a lot of use out of this script now that I&#39;ve started to use Linuxsampler/qsampler so I&#39;d like to see this script or maybe an improved version of it included with future Linux audio distros if it doesn&#39;t get integrated into linuxsampler or qsampler.<br>
<br>Thanks!<br><br>Dan<br><br><br><br><br><br>#!/bin/bash<br>#<br># makesfz.sh<br>#<br># Running &#39;makesfz.sh&#39; with no or any other parameter than 1 will create a .sfz<br># file for every wav file in the present dir. mapping the wav to MIDI note 0.<br>
#<br># Alternatively, &#39;makesfz.sh 1&#39; reads all wav files in the current dir and creates<br># a single .sfz named after the present folder mapping each sample to a MIDI note.<br>#<br>#<br># by Dan MacDonald 2012<br>
<br>key=0<br><br>if [ &quot;$1&quot; = &quot;1&quot; ]; then<br><br>rm -f ${PWD##*/}.sfz<br>echo -e &quot;# This file was auto-generated by makesfz.sh\n\n&lt;group&gt;\nloop_mode=one_shot\n&quot; &gt; ${PWD##*/}.sfz<br><br>
for wavs in *.wav<br><br>do<br>echo -e &quot;&lt;region&gt;\nsample=$wavs\nkey=$key\nlovel=0 hivel=127\n&quot; &gt;&gt; ${PWD##*/}.sfz<br>key=$(($key+1))<br>done<br><br>else<br><br>for wavs in *.wav<br><br>do<br>echo -e &quot;# This file was auto-generated by makesfz.sh\n\n&lt;group&gt;\nloop_mode=one_shot\n&quot; &gt; $wavs.sfz<br>
echo -e &quot;&lt;region&gt;\nsample=$wavs\nkey=0\nlovel=0 hivel=127\n&quot; &gt;&gt; $wavs.sfz<br>done<br><br>fi<br><br><br><br><br><br><br><div class="gmail_quote">On Sat, Dec 31, 2011 at 2:48 PM, Dan MacDonald <span dir="ltr">&lt;<a href="mailto:allcoms@gmail.com">allcoms@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Glad tidings I bring the free audio realm for 2012!<br>
<br>
After seeming years of guru meditations on this problem, I have<br>
finally come across a method of easily using a folder of wav samples<br>
to create sfz drum kits that can be used with Linuxsampler under<br>
qtractor, A3, OOM or what haveth ye for DAW!!<br>
<br>
I came across a perl script that almost sounded like it would do what<br>
I want here <a href="http://www.drealm.info/sfz/" target="_blank">http://www.drealm.info/sfz/</a> but I failed to get that to<br>
work and I don&#39;t know perl to fix it yet and nor do I think I&#39;ll<br>
bother but I will write a bash script to create a .sfz looking like so<br>
by simply running said script in the folder containing the wav files<br>
for your kit. Hence if you ran makesfz.sh within a dir containing<br>
001-bassdrum.wav and 002-snaredrum.wav we would get the following<br>
output:<br>
<br>
<br>
<br>
&lt;region&gt;<br>
sample=001-bassdrum.wav<br>
key=0<br>
lovel=0 hivel=127<br>
<br>
&lt;region&gt;<br>
sample=002-snaredrum.wav<br>
key=1<br>
lovel=0 hivel=127<br>
<br>
<br>
<br>
I do expect someone here will have wrote such a script and added bells<br>
already so may they be so kind as to share it so then we may add it to<br>
the LinuxSampler online resources or get it bundled with the app<br>
itself?<br>
<br>
All the best for 2012!<br>
<br>
danboid<br>
</blockquote></div><br>