nexus-js / ui

NexusUI: Web Audio Interfaces
http://nexus-js.github.io/ui/
844 stars 130 forks source link

Nexus oscilloscope connect #137

Closed luisarandas closed 4 years ago

luisarandas commented 5 years ago

Is it possible to have more than one oscilloscope connected to different things in the same context? For example one for the main master and other one only for a synthesiser from tone.js? Assuming Tone.context = Nexus.context; Best, Luis

tatecarson commented 4 years ago

I am not sure if you can connect it to the master, Tone.Master doesn't seem to work anymore. I am not sure how to access it. But this code attaching oscillators to separate nodes does work:

Tone.setContext(Nexus.context)

const tri = new Tone.Synth({
  oscillator:{
    type: "triangle"
  }
}).toMaster();

const test = new Tone.Synth({
  oscillator:{
    type: "triangle"
  }
}).toMaster();

const oscilTri = new Nexus.Add.Oscilloscope('#instrument')
oscilTri.connect(tri)

const oscilMaster = new Nexus.Add.Oscilloscope('#instrument')
oscilMaster.connect(test);