Skip to content

Commit

Permalink
fix looping mode 3 on very short notes
Browse files Browse the repository at this point in the history
fixes #52
  • Loading branch information
spessasus committed Oct 3, 2024
1 parent 13c6f49 commit 1add6d3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SpessaSynth",
"version": "3.20.36.2",
"version": "3.20.36.3",
"type": "module",
"scripts": {
"start": "node src/website/server/server.js"
Expand Down
2 changes: 1 addition & 1 deletion src/spessasynth_lib/synthetizer/worklet_processor.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ export function renderVoice(
// if not in release, check if the release time is
if (currentTime >= voice.releaseStartTime)
{

// release the voice here
voice.isInRelease = true;
WorkletVolumeEnvelope.startRelease(voice);
WorkletModulationEnvelope.startRelease(voice);
if(voice.sample.loopingMode === 3)
{
voice.sample.isLooping = false;
}
}
}

Expand Down Expand Up @@ -264,8 +268,4 @@ export function releaseVoice(voice)
{
voice.releaseStartTime = voice.startTime + MIN_NOTE_LENGTH;
}
if(voice.sample.loopingMode === 3)
{
voice.sample.isLooping = false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,7 @@ export class WorkletLowpassFilter
filter.cutoffHz = absCentsToHz(filter.cutoffCents);

// fix cutoff on low frequencies (fluid_iir_filter.c line 392)
if(filter.cutoffHz > 0.45 * sampleRate)
{
filter.cutoffHz = 0.45 * sampleRate;
}
filter.cutoffHz = Math.min(filter.cutoffHz, 0.45 * sampleRate);

// adjust the filterQ (fluid_iir_filter.c line 204)
const qDb = (filter.reasonanceCb / 10) - 3.01;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const exportAudio = {
button: {
title: "Save",
title: "Save Audio",
description: "Save the composition to various formats"
},

Expand Down
2 changes: 1 addition & 1 deletion src/website/minified/demo_main.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/website/minified/local_main.min.js

Large diffs are not rendered by default.

0 comments on commit 1add6d3

Please sign in to comment.