Skip to content

Conversation

@theGreatWhiteShark
Copy link
Contributor

Previously, Hydrogen did change the length of notes with custom lengths when editing pitch in PianoRollEditor as well as adjusted the length of a recorded note for the selected instrument based on its pitch.

Probably the original motivation was to keep the ratio of total sample length to custom note length constant since pitch shifting within Hydrogen will affect the length of the rendered note. But it results in awkward UX, like yielding different lengths for all notes when recording a chord for the selected instrument, and gives the users a hard time when using the custom length feature to send both MIDI NOTE_ON and NOTE_OFF messages while dealing with different pitches.

The main reason for this inconsistency was that the note length displayed in the pattern editor was not the actual one. Note::m_nLength itself did not change when pitch-shifting a note. Instead, the scaling of the note length was done entirely within the Sampler and the pattern editor tried to indicate it.

Now, the Sampler takes the whole custom note length into account. Regardless of pitch and sample rate.

Some audio test reference files had to be adjusted because they rendered a pitch-shifted (via instrument) note of custom length at the end.

`Sampler::renderNote` was renamed to `Sampler::handleNote` since it does
more than just rendering. It also takes care of sending the
corresponding MIDI NOTE_ON and NOTE_OFF messages.

`Sampler::renderNoteResample` -> `Sampler::renderNote` because the name
is an artifact from previous refactoring when there was still
`renderNoteNoResample` (or similar). Nowadays, this function is used to
render all notes.
both `Component` and its index are no longer used within the method.

In addition, all shared pointers provided as input are now checked for
validity.
Previously, Hydrogen did change the length of notes with custom lengths
when editing pitch in `PianoRollEditor` as well as adjusted the length
of a recorded note for the selected instrument based on its pitch.

Probably the original motivation was to keep the ratio of total sample
length to custom note length constant since pitch shifting within
Hydrogen will affect the length of the rendered note. But it results in
awkward UX, like yielding different lengths for all notes when recording
a chord for the selected instrument, and gives the users a hard time
when using the custom length feature to send both MIDI NOTE_ON and
NOTE_OFF messages while dealing with different pitches.

The main reason for this inconsistency was that the note length
displayed in the pattern editor was not the actual one.
`Note::m_nLength` itself did not change when pitch-shifting a note.
Instead, the scaling of the note length was done entirely within the
`Sampler` and the pattern editor tried to indicate it.

Now, the `Sampler` takes the whole custom note length into account.
Regardless of pitch and sample rate.

Some audio test reference files had to be adjusted because they rendered
a pitch-shifted (via instrument) note of custom length at the end.
as they would not result in any output anyway
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

Successfully merging this pull request may close these issues.

1 participant