hydrogen-music / hydrogen

The advanced drum machine for Linux, macOS, and Windows
http://www.hydrogen-music.org
GNU General Public License v2.0
1.01k stars 172 forks source link

Rendering issues of notes with user-defined lengths #1873

Closed theGreatWhiteShark closed 8 months ago

theGreatWhiteShark commented 9 months ago

When toying with user-defined note lengths and samples provided in #1852 I came across a couple of rendering issues:

cme commented 9 months ago

Agree with this reasoning ADSR: changing the length of the note should effectively move the Release point, and also filtering.

I guess I would recommend that before doing anything much else in renderNote*, it would probably be wise to just entirely remove renderNoteNoResample to avoid duplication of effort. It's slower than the NoResample variant, but not that much slower. Optimisation without duplication can be a later activity (which I plan to do!)

theGreatWhiteShark commented 9 months ago

I guess I would recommend that before doing anything much else in renderNote*, it would probably be wise to just entirely remove renderNoteNoResample to avoid duplication of effort.

Any volunteer? 😄 But you are right, of course. Just hoped I could implement the drumkit map stuff without large detours. But sample rendering is too important to postpone it till 1.3.0.

I would start by checking/adding some unit tests. They should step on our toes if just a single frame of rendered audio is different. So we can at least check for unintended side effects while refactoring.

theGreatWhiteShark commented 9 months ago

There is another issue with the notes having custom lengths:

Defining a length

long

and shrinking the pattern so it ends prior to the note

short

leaves the note length unaffected. It will ring on.

I think it would feel more natural if the custom note length is truncated at the end of the pattern.