Skip to content

Notes that don't depend on velocity or envelopes still rely on note-on events #679

@dpwe

Description

@dpwe

The default amplitude coefficients are amp={'const': 1.0, 'vel': 1.0, 'eg0': 1.0}, meaning the overall scale is 1.0, the velocity is engaged to achieve a full dynamic range, and the first envelope generator (which defaults to a "note gate", i.e. goes to 1 at note-on and to 0 at note-off) is also fully engaged. Before a note-on, this osc is silent, as it should be. With a note-on (e.g. amy.send(osc=0, vel=1)) it starts sounding, and a note-off (vel=0) stops it.

But if we had amy.send(osc=0, freq=1000, amp={'const': 1.0, 'vel': 0, 'eg0': 0}, that would be an oscillator that did not depend on velocity or the envelope generator: It ought to start sounding right away and keep sounding until its amp was changed to something else.

In practice it does nothing until woken up with a nonzero velocity (amy.send(osc=0, vel=1)) whereupon it starts; the actual velocity is ignored, but because the event causes a note-on, the osc commences. A subsequent note-off does NOT stop it, because the osc is not dependent on velocity (or more precisely, the EG0 note-gate, which is the the thing that actually makes typical notes end when sent a velocity of zero - their velocities do not, actually, become zero, but that's a topic for another day).

We could give the illusion of oscs not needing note-ons oscs, if they don't depend on note-ons, by detecting that they don't depend on note-ons when amp coefs are modified, for instance by checking whether the new amp coefs would lead to a nonzero amp even without a note-on. (We do something like this for amp and env changes that might promote a STATUS_INAUDIBLE osc back into audibility). We could then generate an endogenous note-on as a consequence of the amp-coef change. It might lead to different confusing edge-cases though. In particular, it's hard to detect if the amp is nonzero for a note that hasn't been turned on yet. I had a particular problem when the new note had a mod_osc that also hadn't been turned on (because that depends on the modulated osc experiencing a note-on) so I couldn't poll its mod value to see what the msynth[osc]->amp would be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions