korginc / logue-sdk

This repository contains all the files and tools needed to build custom oscillators and effects for the prologue synthesizer.
BSD 3-Clause "New" or "Revised" License
835 stars 306 forks source link

OSC_NOTEOFF not invoked until all keys are released #30

Open dj-turkish-ice-cream opened 4 years ago

dj-turkish-ice-cream commented 4 years ago

OSC_NOTEOFF documentation says it is "Called whenever a note off event occurs." This is a bit vague, but arguably the behavior should mirror midi note off events.

When multiple keys are held down and released one-by-one, the release of each key produces a midi note off event. However, when these midi messages are passed to the NTK1, OSC_NOTEOFF is only invoked when the last held note is released.

To Reproduce I used sendmidi to send the midi commands below.

  1. Replace the OSC_NOTEOFF code of the Waves oscillator to turn on bit crush:

    s_waves.params.bitcrush = clip01f(1.5f);
    s_waves.state.flags |= Waves::k_flag_bitcrush;
  2. Compile, load and select oscillator.

  3. Send midi note on 50. Sound starts as expected.

  4. Send midi note on 51. Pitch goes up one semitone as expected.

  5. Send midi note off 51. Expected: Pitch goes down one semitone, bitcrush is enabled. Actual: Pitch goes down one semitone, bitcrush is not enabled - i.e. OSC_NOTEOFF is not invoked.

  6. Send midi note off 50. Sound stops as expected. Bitcrush is enabled (can be verified by setting EG to Open).

etienne-korg commented 4 years ago

The NTS-1 handles MIDI notes in legato mode. Will interpret this as a request for non-legato mode.

dukesrg commented 4 years ago

@etienne-korg Passing user_osc_param_t in NOTE_ON/NOTE_OFF and in OSC_CYCLE is really confusing, you need to clarify the behaviour in current documentation.

I suspect #26 is of the similar nature.