tim-janik / anklang

MIDI and Audio Synthesizer and Composer
https://anklang.testbit.eu/
Mozilla Public License 2.0
55 stars 4 forks source link

Show drumkit key labels for liquidsfz #60

Open swesterfeld opened 6 months ago

swesterfeld commented 6 months ago

For hydrogen drumkits (and sfz drumkits which use the label_keyN opcode), liquidsfz supports querying a label for each key using the Synth::list_keys() API. Example using the liquidsfz cli:

$ liquidsfz /usr/share/hydrogen/data/drumkits/GMRockKit/drumkit.xml 
Preloaded 86 samples, 7.4 MB. 

Supported Controls:
 - CC #7 - Volume [ default 100 ]
 - CC #10 - Pan [ default 64 ]

Type 'quit' to quit, 'help' for help.
liquidsfz> keys
36 Kick
37 Stick
38 Snare
39 Hand Clap
40 Snare Rimshot
41 Floor Tom
42 Hat Closed
43 Tom 2
44 Hat Pedal
45 Tom 1
46 Hat Open
47 Cowbell
48 Ride
49 Crash
50 Ride 2
51 Splash
52 Hat Semi-Open
53 Bell

It would improve usability for the user if that information could be shown in the UI, maybe via a toggle to switch from drum mode (showing key names for each note, omitting all notes which have no sample assigned to it) and normal piano key mode.

Note that not unfortunately all sfzs which are drumkits have labels though, as not all of them use the label_keyN opcode. Maybe for the ones we are especially interested in we could redistribute patched sfzs via our to-be-written sample downloader or submit missing opcodes upstream.