SFZ Automatic Creator
Posted: 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 :
I find it always useful to auto create a sfz when I download a bunch of wave sounds
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();