From 89e85142d0958d3e3a87fb155d698fc59eafd4c6 Mon Sep 17 00:00:00 2001 From: gramanas Date: Wed, 28 Jun 2023 22:40:47 +0300 Subject: Remove old note stuff --- src/synth_gui.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'src/synth_gui.c') diff --git a/src/synth_gui.c b/src/synth_gui.c index 510075b..d39995b 100644 --- a/src/synth_gui.c +++ b/src/synth_gui.c @@ -3,23 +3,6 @@ #include "raygui.h" //#include "raylib.h" - -void -set_note(void *synthData, float note, PaTime time, int key) -{ - synth_t * synth = (synth_t *)synthData; - - synth->n.key = key; - synth->n.freq = note; - synth->n.noteOn = time; - synth->n.noteOff = 0; - synth->n.elapsed = 0; - synth->adsr.elapsed = 0; - - synth->active = 1; -} - - void keyboard(void *synthData, PaStream *stream) { @@ -33,8 +16,6 @@ keyboard(void *synthData, PaStream *stream) if (IsKeyPressed(keys[i])) { note = notes[i % 12][(synth->octave + (i / 12)) % 8]; if (note) { - set_note(synth, note, Pa_GetStreamTime(stream), keys[i]); - //printf("Note On : %s[%d] %fHz\n", int_to_note(i % 12), (synth->octave + (i / 12)) % 8, note); synth->midi_note[i].freq = 16.35160 * pow(2, (synth->octave + i / 12.0)); //notes[i % 12][(synth->octave + (i / 12)) % 8]; //synth->midi_note[i].freq = notes[i % 12][(synth->octave + (i / 12)) % 8]; @@ -51,11 +32,6 @@ keyboard(void *synthData, PaStream *stream) if (IsKeyReleased(keys[i])) { synth->midi_note[i].noteOff = Pa_GetStreamTime(synth->stream); note = notes[i % 12][(synth->octave + (i / 12)) % 8]; - if (synth->n.key == keys[i]) { - synth->n.noteOff = Pa_GetStreamTime(stream); - synth->midi_note[i].noteOff = Pa_GetStreamTime(synth->stream); - //printf("Note Off: %s[%d]\n", int_to_note(i % 12), (synth->octave + (i / 12)) % 8); - } } } @@ -151,8 +127,6 @@ draw_signals(synth_t * synth, int x, int y, int width, int height) int point_radius = 1.5; GuiSpinner((Rectangle){ x+ 100, y - 24 - 6, 100, 24 }, "rate divider: ", &(synth->viz.sample_rate_divider), 1, 10, 0); - int period = (1 / (synth->n.freq + 1)) * SAMPLE_RATE / synth->viz.sample_rate_divider; - for (int i = x; i < WIDTH - x; i++) { DrawCircle(i , y + height / 2 + floor(250 * synth->viz.wave[i - x]), point_radius, MAGENTA); -- cgit v1.2.3