Skip to content

Repeated note can cause unnatural truncation #446

@dpwe

Description

@dpwe

MIDI events identify notes (in note-on/note-off events) only by their note number, so it's not possible to separately keep track of two notes with the same pitch (on the same channel) in terms of associating their note-ons and note-offs. You can receive two note-ons for the same pitch without an intervening note-off, in which case we simply retrigger the same voice.

However, if the note has a long decay (high sustain value), and the second note has a much lower velocity (strike strength), this retriggering can lead to an abrupt and noticeable decrease in amplitude.

This is very noticeable in the additive piano voice, with pedaling (midi.Synth.sustain()). A strong strike in the low register will start a long-sounding note, but a subsequent soft note on the same key will abruptly switch it to the soft sound, which can sound unnatural. A real piano would not behave like this - a soft strike to an already-sounding note with the pedal down would not make it quieter.

This could be avoided by allowing repeated notes at the same pitch to be allocated to different voices. Then any subsequent note-offs to that pitch would need to apply to all the voices allocated to that note. So midi.Synth.note_of_voice[midi_note] would need to be a list, not a scalar.

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