From f78e88a6cdd3385371f67d4abb5694048f50b034 Mon Sep 17 00:00:00 2001 From: Marvin Scham Date: Wed, 31 Aug 2022 09:30:31 +0200 Subject: [PATCH] Reordered for ease of explanation --- wave/script.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wave/script.py b/wave/script.py index f45462f..0dd6ddc 100644 --- a/wave/script.py +++ b/wave/script.py @@ -27,15 +27,14 @@ def plot(): js.update(to_js(time), to_js(beat_deflection)) +sampling_frequency = 140 +seconds = 2 +time = np.linspace(0, seconds, int(seconds * sampling_frequency)) + freq1 = 440 freq2 = document.querySelector("#freq") freq2.addEventListener("input", create_proxy(inp_update)) document.body.addEventListener("wheel", create_proxy(scroll_update)) -sampling_frequency = 140 -seconds = 2 -time = np.linspace(0, seconds, int(seconds * sampling_frequency)) - - plot()