Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFZ engines controller screens and cc mappings reordered #1335

Open
johannesmenzel opened this issue Jan 22, 2025 · 2 comments
Open

SFZ engines controller screens and cc mappings reordered #1335

johannesmenzel opened this issue Jan 22, 2025 · 2 comments

Comments

@johannesmenzel
Copy link

Is your feature request related to a problem? Please describe.
I would like to have most common midi cc controllers found in sfz scripts in the sfizz/linux sampler chain controller screen. What's most needed is a complete set of ADSR, basic LFO controls (mainly for vibrato controls for example when mod wheel is occupied for dynamics) and effect sends. Other considerations are mentioned in the code below as comments. Although some midi controllers might differenciate amp and filter adsr for sfz focused on real world instrument samples just basic adsr might be enough. I also changed the order and grouping a bit.

Describe the solution you'd like
Respective engines like zynthian_engine_sfizz.py could be edited like this:

# ---------------------------------------------------------------------------
# Controllers & Screens
# ---------------------------------------------------------------------------
# SFZ Default MIDI Controllers (modulators)
_ctrls = [
    ['modulation wheel', 1, 0],
    ['volume', 7, 127], 
    # default to 127 to match sfz loudness to synth processors, assuming 
    # sfz creators prevent clipping at vol. 127
    ['pan', 10, 64],
    ['expression', 11, 127],

    ['env. attack', {'value': 64, 'midi_cc': 73, 'envelope': 'attack'}],
    ['env. decay', {'value': 64, 'midi_cc': 75, 'envelope': 'decay'}], 
    # having complete ADSR seems nice.
    ['env. sustain', {'value': 64, 'midi_cc': 79, 'envelope': 'sustain'}], 
    # like above. CC debatable, not in MIDI reference, but that is how Arturia 
    # for example handles this
    ['env. release', {'value': 64, 'midi_cc': 72, 'envelope': 'release'}]

    ['filter cutoff', 74, 127],
    # should default to open filter
    ['filter resonance', 71, 0], 
    # should default to no resonance
    ['lfo rate', 76, 64],
    # can call that lfo or vibrato, which might be more suitable for sfz 
    # real world instruments. Can control vibrato if modwheel occupied by
    # dynamic crossfading
    ['lfo depth', 77, 0],
    # like above, default to no modulation

    ['sustain', 64, 'off', ['off', 'on']],
    ['sostenuto', 66, 'off', ['off', 'on']],
    ['legato', 68, 'off', ['off', 'on']],
    ['breath', 2, 127],

    ['portamento on/off', 65, 'off', ['off', 'on']],
    ['portamento time-coarse', 5, 0],
    ['portamento time-fine', 37, 0],
    ['portamento amount', 84, 0], 
    # because why not

    ['reverb', 91, 0],
    # not sure if sfizz handles these. otherwise: default to zero send level
    ['tremolo', 92, 0], 
    ['chorus', 93, 0], 
    ['phaser', 95, 0], 
]

# Controller Screens
_ctrl_screens = [
    ['main', ['volume', 'pan', 'modulation wheel', 'expression']],
    ['envelope', ['env. attack', 'env. decay',
                         'env. sustain', 'env. release']]
    ['filter/lfo', ['filter cutoff', 'filter resonance',
                         'lfo rate', 'lfo depth']]
    ['pedals', ['legato', 'breath', 'sostenuto', 'sustain']],
    ['portamento', ['portamento on/off',
                    'portamento time-coarse', 'portamento time-fine', 'portamento amount']],
    ['effects', ['reverb', 'tremolo', 'chorus', 'phaser']],
]

This would result in the following contorller screens:
main: volume, pan, modulation wheel, expression
envelope: env. attack, env. decay, env. sustain, env. release
filter/lfo: filter cutoff, filter resonance, lfo rate, lfo depth
pedals: legato, breath, sostenuto, sustain
portamento: portamento on/off, portamento time-coarse, portamento time-fine, portamento amount
effects: reverb, tremolo, chorus, phaser

Describe alternatives you've considered
Alternatively, if possible, Zynthian could display hardcoded cc in sfz files, either only if labeled by label_ccN= or in any case some parameter is modulated by ***_ccN=. I'd prefer the first solution because one might consider the sfz creator thoughtfully exposed a parameter to the user. If already present in engine script it would override the existing one with the labeled cc. So, for example, if someone labeled label_cc1=Dynamics and set the default value from set_cc1=127, it would be displayed on the controller screen as "Dynamics", mapped to CC1 with default to max instead of "Mod Wheel", CC1, default: 0. If set_ccN isn't present, it falls back to the default value in the engine declaration.

Additional context
You sometimes use different setups under different circumstances. For example I use a Keylab 88 at home, a Keystep on vacations and the old M-Audio 88 from the other band in the reheasal room. So all these controller differ in reachable controllers. Having the most basic sfz parameters mapped inside Zynthian would be great.

@johannesmenzel
Copy link
Author

By the way, this issue is somehow a duplicate of this issue #181

@johannesmenzel
Copy link
Author

For now, the effect page can be left out. I read through the sfizz documentation and found out that effects are basically working, but cc related opcodes are unsupported yet (like reverb_wetccN)

The others would be still highly appreciated, even more because I found out that sfizz in zynthian doesn't take cc not present on these pages even when hardcoded in sfz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant