Skip to content

Conversation

@steve-mackinnon
Copy link

This splits out a shared utility called BufferReader that handles the sample reading portion of the various sample nodes, and updates the samples nodes to use it in place of custom implementations.

BufferReader handles:

  • Interpolated sample reading
  • Triggering
  • Looping
  • Start and end trimming of the source sample
  • Fading audio in and out when playback starts and stops

Copy link
Contributor

@nick-thompson nick-thompson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!


// Note: this is set to 1.1 ms to preserve backwards compatibility. Historically, a gain fade with
// a step size of 0.02 was used for SampleSeqNode, which comes out to roughly 1.1 ms at 44100 Hz.
static constexpr double FadeTime = 1.1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅 that certainly wasn't intentional

@nick-thompson nick-thompson merged commit 364015a into elemaudio:develop Jan 9, 2026
4 checks passed
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.

2 participants