Skip to content

.connect(outputNum != 0) does not work, cannot split signal #1390

@rachel-bridge

Description

@rachel-bridge

Describe the bug

Say I have a Sampler and I would like to create a note and pan it in two directions simultaneously. Or, you know, put any two different effects on different channels.

Only the effect connected to output #0 is making any sound. Description below.

To Reproduce

If you leave this code as-is, you hear nothing. If you connect panner2 to output 0 of split (split.connect(panner2, 0, 0);), you hear the tone and effect of panner2. If you instead set split.connect(panner1, 0, 0);, you hear the effect of panner1. If you set both to connect to output 0, you hear both simultaneously on the same channel, and they cancel out.

// On user button click, calls `onButtonClick()` and `Tone.getTransport().start()`

const tone1 = new Tone.Sampler({
  urls: {D1: 'audio_tracks/clean_d_str_pick.mp3'}
});
const tone2 = new Tone.Sampler({
  urls: {D1: 'audio_tracks/clean_d_str_pick.mp3'}
});


function onButtonClick() {
  const panner1 = new Tone.Panner(-1).toDestination();
  const panner2 = new Tone.Panner(-1).toDestination();

  const signal1 = new Tone.Signal({
      value: 0,
      units: "number"
  }).connect(panner1.pan);
  signal1.rampTo(-1, 1.75);
  const signal2 = new Tone.Signal({
      value: 0,
      units: "number"
  }).connect(panner2.pan);
  signal2.rampTo(1, 1);

  const split = new Tone.Split(3);


  tone1.connect(split, 0, 0);
  tone2.connect(split, 0, 0);

  split.connect(panner1, 1, 0);
  split.connect(panner2, 2, 0);

  tone1.triggerAttackRelease("D1", 2);
  tone2.triggerAttackRelease("D1", 2);
}

Expected behavior
If you connect an effect to the 2nd output of a Split object, you hear something. I expect the Split object to split a signal into multiple channels that are all usable.

What I've tried
Everything suggested in the template for this bug report. Using different effects. Using Channel objects instead of Panner. Sending different things to Destination at different times (every combination I could think of).

Additional context
Double checked: split does have enough outputs in this example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions