-
Notifications
You must be signed in to change notification settings - Fork 0
/
1st_Sept_sound_2
38 lines (25 loc) · 971 Bytes
/
1st_Sept_sound_2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { make_sound, play } from "sound";
const pitch_A_wave =
t => math_sin(2 * math_PI * 440 * t); // A4
const pitch_A = make_sound(pitch_A_wave, 1.5);
// play(pitch_A);
const C_maj_chord_wave =
t => 0.33 * math_sin(2 * math_PI * 261.63 * t) + // C4
0.33 * math_sin(2 * math_PI * 329.63 * t) + // E4
0.33 * math_sin(2 * math_PI * 392.00 * t); // G4
const C_maj_chord = make_sound(C_maj_chord_wave, 1.5);
// play(C_maj_chord);
const doremi_wave =
t => t < 0.5
? math_sin(2 * math_PI * 261.63 * t) // C4
: t < 1.0
? math_sin(2 * math_PI * 293.66 * t) // D4
: math_sin(2 * math_PI * 329.63 * t); // E4
const doremi = make_sound(doremi_wave, 1.5);
// play(doremi);
const combined =
t => t< 0.5
? math_sin(2 * math_PI * 500 * t)
: math_sin(2 * math_PI * 750 * t);
const p = make_sound(combined, 3);
play(p);