8000 Revert "added happy birthday song" + other stuff · Elixonus/doppler@ff4a20c · GitHub
[go: up one dir, main page]

Skip to content

Commit

Permalink
Revert "added happy birthday song" + other stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Elixonus committed Jul 18, 2024
1 parent 31b67c9 commit ff4a20c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ If an observer wave is found, the perceived frequency and amplitude is calculate

`SOUND` button group can be accessed with key `M` to interpret the observer signal in time as an audible sound.

`TWAVE` button group can be accessed with key `W` to highlight the properties of the wave that is observed at the current time. This includes but is not limited to, the position and velocity of the source.
`OWAVE` button group can be accessed with key `W` to highlight the properties of the wave that is observed at the current time. This includes but is not limited to, the position and velocity of the source.

`FMOD` button group can be accessed with key `F` to modulate the frequency of the source signal in time.

Expand Down
38 changes: 3 additions & 35 deletions doppler/script.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,6 @@
let song = [
1, 0, 0,
1, 0,
1.125, 1.125, 1.125, 1.125, 0,
1, 1, 1, 1, 0,
1.333, 1.333, 1.333, 1.333, 0,
1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 0, 0,
1, 0, 0,
1, 0,
1.125, 1.125, 1.125, 1.125, 0,
1, 1, 1, 1, 0,
1.5, 1.5, 1.5, 1.5, 0,
1.333, 1.333, 1.333, 1.333, 1.333, 1.333, 1.333, 1.333, 0, 0,
1, 0, 0,
1, 0,
2, 2, 2, 2, 0,
1.667, 1.667, 1.667, 1.667, 0,
1.333, 1.333, 0,
1.333, 0,
1.25, 1.25, 1.25, 1.25, 0,
1.125, 1.125, 1.125, 1.125, 1.125, 1.125, 1.125, 1.125, 0, 0,
1.765, 0, 0,
1.765, 0,
1.667, 1.667, 1.667, 1.667, 0,
1.333, 1.333, 1.333, 1.333, 0,
1.5, 1.5, 1.5, 1.5, 0,
1.333, 1.333, 1.333, 1.333, 1.333, 1.333, 1.333, 1.333, 0, 0, 0, 0, 0, 0, 0, 0,
];

const wspd = 0.05;
const wdec = 0.01;
const wnum = 250;
const wnum = 252;
const wskp = 7;
const mprd = 20;

Expand All @@ -39,7 +10,7 @@ let plot = 0;

let run = true;
let bufr = null;
let fmod = 5;
let fmod = 0;
let snd = false;
let owav = false;
let obj = null;
Expand Down Expand Up @@ -850,9 +821,6 @@ function setFmod() {
src.frq = 0.5 + Math.abs(2 * phs / mprd - 1);
} else if (fmod === 4) {
src.frq = 1 + 0.5 * Math.sin(2 * Math.PI * phs / mprd);
} else if (fmod === 5) {
phs = time % (25 * mprd)
src.frq = song[Math.round((song.length - 1) * (phs / (25 * mprd))) % song.length];
}
}

Expand Down Expand Up @@ -1261,7 +1229,7 @@ function doKey(event) {
setFmodTrg();
} else if (fmod === 3) {
setFmodSin();
} else if (fmod === 4 || fmod === 5) {
} else if (fmod === 4) {
setFmodFlt();
}
} else if (event.key.toUpperCase() === "C") {
Expand Down

0 comments on commit ff4a20c

Please sign in to comment.
0