summaryrefslogtreecommitdiff
path: root/synth
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-01-16 15:23:13 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-01-16 15:23:13 +0100
commit527e7400f227703b9f0932b685f2bf7f2c2c005b (patch)
tree415f25892780387cf646c25c323690789ecd853f /synth
parent67025394dcbc2d0917c89856c40be3b9198eca5e (diff)
In-synth-cli can now change snh-freq
Diffstat (limited to 'synth')
-rw-r--r--synth/in_synth_cli.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/synth/in_synth_cli.cpp b/synth/in_synth_cli.cpp
index 510d93d..7bf1fda 100644
--- a/synth/in_synth_cli.cpp
+++ b/synth/in_synth_cli.cpp
@@ -508,6 +508,22 @@ void do_in_synth_cli()
cout << "error: lfo-number must be one of 0.."<<N_LFOS-1<<endl;
}
}
+ else if ((command=="snh") || (command=="snh_freq") || (command=="sample_and_hold_freq") || (command=="set_sample_and_hold_freq"))
+ {
+ if (isfloat(params))
+ {
+ float freq=atof(params.c_str());
+ if (freq>=0)
+ {
+ snh_freq_hz=freq;
+ init_snh(); //no uninit neccessary, as this only calculates an integer
+ }
+ else
+ cout << "error: sample-and-hold-frequency must be greater than zero"<<endl;
+ }
+ else
+ cout << "error: expected frequency, found '"<<params<<"'"<<endl;
+ }
else if (command!="")
{
cout << "error: unrecognized command '"<<command<<"'"<<endl;