Hi rompler lovers!
I’ve implemented some improvements in the SFZ engines (aka sfizz & linuxsamplers) that will allow to configure custom controllers for each SFZ file. It works like this:
- When loading a SFZ file, the engine looks for a config file with the same name, but with “yml” extension (lowercase!). This file contains a full description of the custom controllers for this SFZ. Something like this:
sfz_file: "SCC Expressive Strings-Key Switch-CC1.sfz"
controllers:
custom:
articulation:
graph_path: 'note_on'
labels: ['legato (cc1)', 'legato (vel)', 'staccato (vel)', 'tremolo (cc1)', 'tremolo (vel)', 'leg/trem xfade', 'pizzicato (vel)']
ticks: [21, 22, 23, 105, 106, 107, 108]
expression wheel:
midi_cc: 1
value: 64
legato/trem xfade:
midi_cc: 67
value: 0
When the soundfont is loaded, you will get new pages of controllers according to the config, like this:
Note i have removed a lot of controllers from the default config because they didn’t work on most SFZs. I kept only the controllers that works on almost all SFZs.
Also note the “articulation” controller in this example. It’s a new type of controller that sends “note-on” messages and it’s specially thought for allowing “keyswitching” from the zynthian UI. It’s configured by setting the graph_path option to ‘note_on’, and then specifying the list of keyswitches (note numbers) as ticks and their labels.
-
If a yaml config file is not found for the SFZ file, then the engine will parse the SFZ code and look for these 2 opcodes:
- set_ccXX=YY
- label_ccXX=controller_name_without_spaces
where XX is the midi CC numbers and YY is the default value.
If found, the controllers will be added, creating custom pages as needed.
For instance, tried the recently shared “Leisureland_Mellotron” and this is the result:
I decided to not enable the 2 described mechanisms simultaneously, as it would be challenging, although not impossible. My reasoning is that once you decide to write a config file, you should include all the custom controllers on it to get it displayed with the right page names, etc. The parsing mechanism is an automatic but suboptimal mechanism, although it could be improved too.
You can test all this on vangelis branch (testing).
Enjoy!