summaryrefslogtreecommitdiffstats
path: root/src/synth_gui.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2023-06-28 22:40:47 +0300
committergramanas <anastasis.gramm2@gmail.com>2023-06-28 22:40:47 +0300
commit89e85142d0958d3e3a87fb155d698fc59eafd4c6 (patch)
tree013c3e878a6fa3b822999e05771e129777e37323 /src/synth_gui.c
parent60c82a72fedd719f69c1f1de896aca00784a2881 (diff)
downloadsynth-project-89e85142d0958d3e3a87fb155d698fc59eafd4c6.tar.gz
synth-project-89e85142d0958d3e3a87fb155d698fc59eafd4c6.tar.bz2
synth-project-89e85142d0958d3e3a87fb155d698fc59eafd4c6.zip
Remove old note stuff
Diffstat (limited to 'src/synth_gui.c')
-rw-r--r--src/synth_gui.c26
1 files changed, 0 insertions, 26 deletions
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);