summaryrefslogtreecommitdiffstats
path: root/src/synth_gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth_gui.c')
-rw-r--r--src/synth_gui.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/synth_gui.c b/src/synth_gui.c
index d39995b..ee4ae05 100644
--- a/src/synth_gui.c
+++ b/src/synth_gui.c
@@ -14,18 +14,17 @@ keyboard(void *synthData, PaStream *stream)
for (int i = 0; keys[i]; i++) {
if (IsKeyPressed(keys[i])) {
- note = notes[i % 12][(synth->octave + (i / 12)) % 8];
- if (note) {
- //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];
- synth->midi_note[i].channel = -1;
- synth->midi_note[i].noteOn = Pa_GetStreamTime(synth->stream);
- synth->midi_note[i].noteOff = 0;
- synth->midi_note[i].velocity = 1.0;
- synth->midi_note[i].elapsed = 0;
- synth->midi_note[i].active = 1;
- }
+ //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));
+ //synth->midi_note[i].freq = notes[i % 12][(synth->octave + (i / 12)) % 8];
+ synth->midi_note[i].channel = -1;
+ synth->midi_note[i].noteOn = Pa_GetStreamTime(synth->stream);
+ synth->midi_note[i].noteOff = 0;
+ synth->midi_note[i].velocity = 1.0;
+ synth->midi_note[i].elapsed = 0;
+ synth->midi_note[i].active = 1;
+ //synth->adsr.elapsed = 0;
+ synth->active = 1;
}
}
for (int i = 0; keys[i]; i++) {