SFZ Automatic Creator

Link to good samples/soundfonts at http://wiki.linuxaudio.org/wiki/free_audio_data

Moderators: MattKingUSA, khz

frostfall
Established Member
Posts: 14
Joined: Tue Oct 10, 2017 9:10 am

SFZ Automatic Creator

Postby frostfall » Wed Oct 18, 2017 5:15 pm

Hello,

I would like share a small python script I made to automatically create a sfz with the wave files of a folder. You have to specify the sfz filename as first parameter, and the wave folder as the 2nd parameter.

Here is the script :

Code: Select all

#!/usr/bin/python
import sys,glob
if (len(sys.argv)<3):
    print "Usage sfzcreator.sh name.sfz folder"
    sys.exit(0)
keyCounter=36
handle = open(sys.argv[1], "w");
allfiles=glob.glob(sys.argv[2]+'*.wav')
allfiles.sort()
for filename in allfiles:
    handle.write("<region>\nsample="+filename+"\nkey=" +str(keyCounter)+"\n")
    keyCounter+=1
handle.close();


I find it always useful to auto create a sfz when I download a bunch of wave sounds :)

User avatar
Lyberta
Established Member
Posts: 650
Joined: Sat Nov 01, 2014 8:15 pm
Location: The Internet
Contact:

Re: SFZ Automatic Creator

Postby Lyberta » Thu Oct 19, 2017 5:51 am

So how does it assign notes?

frostfall
Established Member
Posts: 14
Joined: Tue Oct 10, 2017 9:10 am

Re: SFZ Automatic Creator

Postby frostfall » Thu Oct 19, 2017 9:16 am

Lyberta wrote:So how does it assign notes?


The notes are created from key 36 (check this website : http://www.mildon.me/apps/oneshot, put your mouse on the keyboard and it will show in the corner which note is which key) and then every new wave file has a number ++ (37, 38 etc...)

it is interesting when you have a lot of waves effect. Of cours if your goal is to create an instrument (1 wave = multiple notes), it's not the good tool.


Return to “Samplers & samples”

Who is online

Users browsing this forum: No registered users and 2 guests