Skip to content

Commit

Permalink
combine additional channel waveforms
Browse files Browse the repository at this point in the history
ex. 17th channel goes to the first analyser etc.
  • Loading branch information
spessasus committed Mar 29, 2024
1 parent 3a41ffe commit 9f0b34e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/website/ui/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ export class Renderer
channel.gainController.connect(analyser);
this.channelAnalysers.push(analyser);
}

// connect more channels to the same analysers on add
synth.eventHandler.addEvent("newchannel", "renderer-new-channel", channel => {
const targetAnalyser = this.channelAnalysers[(synth.midiChannels.length - 1) % this.channelAnalysers.length];
channel.gainController.connect(targetAnalyser);
})
}

/**
Expand Down

0 comments on commit 9f0b34e

Please sign in to comment.