How to use the tonal.Note.freq function in tonal

To help you get started, we’ve selected a few tonal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kylestetz / slang / classes / Osc.js View on Github external
schedule(start, stop, note, envelopeMode) {
		const osc = context.createOscillator();

		osc.type = typeMap[this.type.next()];

		let noteMidiValue = typeof note === 'string' ? Note.midi(note) : note;
		osc.frequency.setValueAtTime(
			Note.freq(Note.fromMidi(noteMidiValue + this.detune.next())),
			context.currentTime,
			0
		);

		osc.start(start);
		// Envelope mode is a flag that an ADSR envelope will pass
		// into Osc if it is controlling this Block. This is the
		// only reasonable way to solve the problem of the envelope
		// needing to control the stop time.
		if (!envelopeMode) osc.stop(stop);

		osc.onended = () => {
			osc.disconnect();
		};

		// Envelope mode returns the osc without setting stop, while
github generative-music / generative.fm / src / pieces / a-viable-system.js View on Github external
(currentLowest, note) =>
      Note.freq(note) < Note.freq(currentLowest) ? note : currentLowest,
    Infinity
github generative-music / generative.fm / src / pieces / a-viable-system.js View on Github external
(currentHighest, note) =>
      Note.freq(note) > Note.freq(currentHighest) ? note : currentHighest,
    -Infinity
github generative-music / pieces-alex-bainter / packages / piece-a-viable-system / src / piece.js View on Github external
(currentHighest, note) =>
      Note.freq(note) > Note.freq(currentHighest) ? note : currentHighest,
    -Infinity
github generative-music / pieces-alex-bainter / packages / piece-apoapsis / src / piece.js View on Github external
({ samples }) => {
      if (Tone.context !== audioContext) {
        Tone.setContext(audioContext);
      }
      const noise = new Tone.Noise('brown');
      const eq = new Tone.EQ3(-15, -Infinity, -Infinity).connect(destination);
      eq.lowFrequency.value = Note.freq('C1');
      const lfo = new Tone.LFO({
        min: -50,
        max: -15,
        frequency: Math.random() / 100,
        phase: 45,
      });
      lfo.connect(eq.low);
      noise.connect(eq);
      lfo.start();

      const delay1 = new Tone.FeedbackDelay({
        feedback: 0.7,
        delayTime: 0.2,
        wet: 0.5,
      });
      const delay2 = new Tone.FeedbackDelay({
github generative-music / pieces-alex-bainter / packages / piece-a-viable-system / src / piece.js View on Github external
(currentLowest, note) =>
      Note.freq(note) < Note.freq(currentLowest) ? note : currentLowest,
    Infinity