My sfz works when I specify the key, but I need help to just use one note and automatically transpose

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

Moderators: MattKingUSA, khz

Post Reply
AndrewD
Established Member
Posts: 17
Joined: Sat Sep 09, 2017 2:35 pm

My sfz works when I specify the key, but I need help to just use one note and automatically transpose

Post by AndrewD »

Hello and thanks in advance for any assistance.

I had made an sfz that worked fine in the following format:

<region> key=72 sample=filename.wav
<region> key=73 sample=filename.wav
<region> key=74 sample=filename.wav
etc.

But some notes were slightly off on the recording, so I decided to take just one good note and use that for the whole sfz. I tried this format but it doesn't play in Carla:

<region>sample=filename.wav
pitch_keycenter=73
lokey=50
hikey=90

As you can see, the note is normally C#5/73, and I would like it to be automatically transposed to the surrounding keys (within the lokey and hikey limits), i.e. key 74 is one semitone higher than 73, key 75 is two semitones higher than 73, etc. The sfz loads in Carla, but the preview keyboard doesn't produce any sound when I run my mouse over it so there must be something wrong.

This is all very foreign to me and the internet explanations are all very confusing. What am I missing? Thanks!
frostfall
Established Member
Posts: 14
Joined: Tue Oct 10, 2017 9:10 am

Re: My sfz works when I specify the key, but I need help to just use one note and automatically transpose

Post by frostfall »

I have tried your example with free samples I downloaded (https://cymatics.fm/fx-toolkit-vol-5/) and it just work in Carla.
Here is my config file :
<region>
sample=./Cymatics - FX Toolkit Vol 5 - Future Bass Edition/Risers/Cymatics - Riser 34 - 160 BPM A.wav
pitch_keycenter=73
lokey=50
hikey=90
May be the path of your sample is wrong somehow?
AndrewD
Established Member
Posts: 17
Joined: Sat Sep 09, 2017 2:35 pm

Re: My sfz works when I specify the key, but I need help to just use one note and automatically transpose

Post by AndrewD »

How curious! Thanks for trying it. The file path can't be wrong because it's all in the same folder. I tried with a different .wav file in a new sfz but it still wouldn't work. Hmmm I have a mystery...
AndrewD
Established Member
Posts: 17
Joined: Sat Sep 09, 2017 2:35 pm

Re: My sfz works when I specify the key, but I need help to just use one note and automatically transpose

Post by AndrewD »

Well I found the problem. It appears you must never have characters touching "<region>", rather you must always have either a space or a line break after you write "<region>".

For example this won't work:

<region>sample=filename.wav pitch_keycenter=73

While this will work:

<region> sample=filename.wav

I knew it was something stupid. :)
frostfall
Established Member
Posts: 14
Joined: Tue Oct 10, 2017 9:10 am

Re: My sfz works when I specify the key, but I need help to just use one note and automatically transpose

Post by frostfall »

Good to know! And it explains why my version was working as I put the sample instruction in a new line :)
Post Reply