init
This commit is contained in:
parent
5fbddbbc26
commit
614fa6cdc8
12 changed files with 345 additions and 8 deletions
30
control.c
Normal file
30
control.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "control.h"
|
||||
#include <stdio.h>
|
||||
#include <stdatomic.h>
|
||||
|
||||
int control_run(synthesizer *synth)
|
||||
{
|
||||
while (1) {
|
||||
int c = getchar();
|
||||
|
||||
(void) synth;
|
||||
|
||||
float base = 200.0;
|
||||
|
||||
if (c == 'j') {
|
||||
float inc = base / synth->sr;
|
||||
atomic_store(&synth->vco1.inc_target, inc);
|
||||
}
|
||||
if (c == 'k') {
|
||||
float inc = base *2 / synth->sr;
|
||||
atomic_store(&synth->vco1.inc_target, inc);
|
||||
}
|
||||
if (c == 'l') {
|
||||
float inc = base * 4/ synth->sr;
|
||||
atomic_store(&synth->vco1.inc_target, inc);
|
||||
}
|
||||
if (c == 'x') {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue