Skip to content

Commit

Permalink
Quick nudge for onset/offset in sampleseq
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-thompson committed Jan 11, 2024
1 parent b4a8ed6 commit acf1757
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/packages/offline-renderer/elementary-wasm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/packages/web-renderer/raw/elementary-wasm.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion runtime/elem/builtins/SampleSeq.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ namespace elem
readers[activeReader].disengage();
activeReader = (activeReader + 1) & (readers.size() - 1);

readers[activeReader].engage(prevEvent->first);
// Here a value of 1.0 is considered an onset, and anything else
// considered an offset.
if (detail::fpEqual(prevEvent->second, FloatType(1.0))) {
readers[activeReader].engage(prevEvent->first);
}
}
}

Expand Down

0 comments on commit acf1757

Please sign in to comment.