Sound In Space Week 4

For the quad assignment, I wanted to explore clicking sounds and timing a bit more. I wanted to make intentionally timed events for this assignment. For the last assignment, I was unable to time a series of tones to play at certain intervals, but I was able to accomplish that this time with Tone.Loop. A series of tones are played with different note durations (I’m unsure if this is the right word) and frequencies at different times. The first 90 seconds, the frequencies increase in value within the range of 27.5 Hz to 7040 Hz and increase in note duration (1n to 16n). The last 90 seconds, the frequencies decrease in value (within the same range that they increased) and increase in note duration. To achieve more variety, I utilized the panner and changed the panner values in order to hopefully trigger different speakers of the quad setup.

Hopefully this works on a quad setup, due to some extenuating circumstances, I was unable to test it before this was due. This piece is meant to be played with the speakers in a ring facing outward from the center. Since I got some sort of timing to work, the piece ends after around 180 seconds. Click here for a link to my sketch.

const channels = 4;

const output = new Tone.MultiChannelOutput(channels);

const panner = new Tone.MultiChannelPanner(channels);
panner.connect(output);

const osc1 = new Tone.Synth({
  oscillator: {
    type: 'sine',
    modulationFrequency: .1
  },
  envelope: {
    attack: 0,
    decay: 0.01,
    sustain: 0,
    release: 0.01,
  }
}).connect(panner);
osc.volume.value = -0

var loop1 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(27.5, '1n');
  console.log(time);

}, "1n").start(0).stop(90);

var loop2 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(55, '2n');
  console.log(time);

}, "2n").start(10).stop(90);

var loop3 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(110, '3n');
  console.log(time);

}, "3n").start(20).stop(90);

var loop4 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(220, '4n');
  console.log(time);

}, "4n").start(30).stop(90);

var loop5 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(440, '5n');
  console.log(time);

}, "5n").start(40).stop(90);

var loop6 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(880, '6n');
  console.log(time);

}, "6n").start(50).stop(90);

var loop7 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(1760, '7n');
  console.log(time);

}, "7n").start(60).stop(90);

var loop8 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(3520, '8n');
  console.log(time);

}, "8n").start(70).stop(90);

var loop9 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(7040, '16n');
  console.log(time);

}, "16n").start(80).stop(90);

var loop11 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(27.5, '16n');
  console.log(time);

}, "16n").start(170).stop(180);
var loop21 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(55, '8n');
  console.log(time);

}, "8n").start(160).stop(180);

var loop31 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(110, '7n');
  console.log(time);

}, "7n").start(150).stop(180);
var loop41 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(220, '6n');
  console.log(time);

}, "6n").start(140).stop(180);
var loop51 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(440, '5n');
  console.log(time);

}, "5n").start(130).stop(180);

var loop61 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(880, '4n');
  console.log(time);

}, "4n").start(120).stop(180);
var loop71 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(1760, '3n');
  console.log(time);
}, "3n").start(110).stop(180);

var loop81 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(3520, '2n');
  console.log(time);
}, "2n").start(100).stop(180);

var loop91 = new Tone.Loop(function(time) {
  osc1.triggerAttackRelease(7040, '1n');
  console.log(time);

}, "1n").start(90).stop(180);

Tone.Transport.start();

const pannerValues1 = [-0.75, -0.25, 0.25, 0.75, 0.25, -0.25]
let pannerIndex1 = 0

const loop89 = new Tone.Loop(time => {
  panner.pan.rampTo(pannerValues1[pannerIndex1], 0.1, time)
  pannerIndex1 = (pannerIndex1 + 1) % pannerValues1.length
}, 0.5).start(0).stop(30);

const pannerValues2 = [0.75, 0.25, -0.25, -0.75, -0.25, 0.25]
let pannerIndex2 = 0

const loop891 = new Tone.Loop(time => {
  panner.pan.rampTo(pannerValues2[pannerIndex2], 0.1, time)
  pannerIndex2 = (pannerIndex2 + 1) % pannerValues2.length
}, 0.5).start(60).stop(120);

const pannerValues = [0.25, 0.75, -0.75, -0.25, 0.25, 0.75]
let pannerIndex = 0

const loop90 = new Tone.Loop(time => {
  panner.pan.rampTo(pannerValues[pannerIndex], 0.1, time)
  pannerIndex = (pannerIndex + 1) % pannerValues.length
}, 0.5).start(30).stop(60);

const pannerValues3 = [-0.25, -0.75, 0.75, 0.25, -0.25, -0.75]
let pannerIndex3 = 0
const loop901 = new Tone.Loop(time => {
  panner.pan.rampTo(pannerValues3[pannerIndex3], 0.1, time)
  pannerIndex3 = (pannerIndex3 + 1) % pannerValues3.length
}, 0.5).start(120).stop(180);