JSFiddle - React, Tailwind, and code Playground

by Tiriree Kananuruk

HTML

<script src="https://tonejs.github.io/build/Tone.min.js"></script>
<link rel="stylesheet" href="https://tonejs.github.io/assets/css/interface.css">
<script src="https://tonejs.github.io/Logo/build/Waveform.js"></script>

JavaScript

var synth = new Tone.PolySynth(5, Tone.Synth, {
			"oscillator" : {
				"type" : "sine8",
				"count" : 5,
				"spread" : 30
			},
    filterEnvelope: {
    "attack": 0.01,
				"decay": 0.9,
				"sustain": 0.5,
				"release": 0.4,
        "baseFrequency": "C4",
        "octaves": 5
    },
			"envelope": {
				"attack": 0.01,
				"decay": 0.9,
				"sustain": 0.5,
				"release": 0.4,
				"attackCurve" : "exponential"
			},
		}).toMaster();
    
synth.triggerAttackRelease('C4', 10, 1)