Skip to content

Commit

Permalink
Unconditionally connect played back units to output (refs #95)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinstadler committed Mar 19, 2024
1 parent 75e4d7b commit efe6524
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/processing/sound/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -528,18 +528,16 @@ protected void disconnectFromOutput(int channel, UnitSource source, int part) {
}

protected void play(UnitSource source) {
// check if unit is already connected
// add unit to synth
UnitGenerator generator = source.getUnitGenerator();
if (!this.addedUnits.contains(generator)) {
this.synth.add(generator);
this.addedUnits.add(generator);
for (int i = 0; i < source.getOutput().getNumParts(); i++) {
this.connectToOutput((this.outputChannel + i) % this.synth.getAudioDeviceManager().getMaxOutputChannels(this.outputDevice), source, i);
this.add(generator);
// and connect to output(s)
for (int i = 0; i < source.getOutput().getNumParts(); i++) {
this.connectToOutput((this.outputChannel + i) % this.synth.getAudioDeviceManager().getMaxOutputChannels(this.outputDevice), source, i);
// source.getOutput().connect(i, this.volume[(this.outputChannel + i) % this.synth.getAudioDeviceManager().getMaxOutputChannels(this.outputDevice)].inputA, 0);
if (this.multiChannelMode) {
// only add the first (left) channel
break;
}
if (this.multiChannelMode) {
// only add the first (left) channel
break;
}
}
}
Expand Down

0 comments on commit efe6524

Please sign in to comment.