refactor piano instrument to use PolySynth for improved sound dynamics and volume control
Browse files- index.html +9 -11
index.html
CHANGED
|
@@ -470,17 +470,15 @@
|
|
| 470 |
const reverb = new Tone.Reverb({ decay: 3, wet: 0.25 })
|
| 471 |
const delay = new Tone.FeedbackDelay("8n", 0.2).connect(reverb);
|
| 472 |
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
release: 1,
|
| 483 |
-
volume: -6
|
| 484 |
}).connect(delay);
|
| 485 |
|
| 486 |
piano.triggerAttackRelease(
|
|
|
|
| 470 |
const reverb = new Tone.Reverb({ decay: 3, wet: 0.25 })
|
| 471 |
const delay = new Tone.FeedbackDelay("8n", 0.2).connect(reverb);
|
| 472 |
|
| 473 |
+
const piano = new Tone.PolySynth(Tone.AMSynth, {
|
| 474 |
+
volume: -8,
|
| 475 |
+
harmonicity: 1.5,
|
| 476 |
+
envelope: {
|
| 477 |
+
attack: 0.02,
|
| 478 |
+
decay: 0.3,
|
| 479 |
+
sustain: 0.3,
|
| 480 |
+
release: 2
|
| 481 |
+
}
|
|
|
|
|
|
|
| 482 |
}).connect(delay);
|
| 483 |
|
| 484 |
piano.triggerAttackRelease(
|