ref: 6cd03fe7b962e5af589ced40bd655e12dd167445
parent: 1ee6f69e917666a6c1edfe697fffc29be220b6dc
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Mar 18 22:15:58 EDT 2020
ay: fix initial values and step, add noise frequency
--- a/ay/ay.c
+++ b/ay/ay.c
@@ -45,6 +45,7 @@
}chan[3];
float hold, alternate, attack, cont;
float volume;
+ float noise;
};
static Aux rootaux[] = {
@@ -184,9 +185,9 @@
char s[32];
int i;
- min = ceil(Tickhz/(16.0f*4095.0f));
- max = floor(Tickhz/16.0f);
- step = ceil(Tickhz/(16.0f*4094.0f)) - min;
+ min = Tickhz/65520.0f;
+ max = Tickhz/16.0f;
+ step = (max-min)/4094.0f;
ui->openVerticalBox(ui->f, "AY-3-8910");
@@ -197,10 +198,10 @@
ui->declare(ui->f, &dsp->chan[i].freq, "0", "");
ui->declare(ui->f, &dsp->chan[i].freq, "unit", "Hz");
- ui->addHorizontalSlider(ui->f, "Tone", &dsp->chan[i].freq, 400.0f, min, max, step);
+ ui->addHorizontalSlider(ui->f, "Tone", &dsp->chan[i].freq, min+(max-min)/2.0f, min, max, step);
ui->declare(ui->f, &dsp->chan[i].amp, "1", "");
- ui->addHorizontalSlider(ui->f, "Volume", &dsp->chan[i].amp, 15.0f, 0.0f, 15.0f, 1.0f);
+ ui->addHorizontalSlider(ui->f, "Volume", &dsp->chan[i].amp, 1.0f, 0.0f, 1.0f, 1.0f/15.0f);
ui->declare(ui->f, &dsp->chan[i].enable, "2", "");
ui->addCheckButton(ui->f, "Enable", &dsp->chan[i].enable);
@@ -214,6 +215,13 @@
ui->closeBox(ui->f);
}
ui->closeBox(ui->f);
+
+ min = Tickhz/496.0f;
+ max = Tickhz/16.0f;
+ step = (max-min)/30.0f;
+
+ ui->declare(ui->f, &dsp->noise, "noise", "");
+ ui->addHorizontalSlider(ui->f, "Noise", &dsp->noise, 200, min, max, step);
ui->openVerticalBox(ui->f, "Envelope");
ui->declare(ui->f, &dsp->hold, "0", "");