git ssb

0+

cel / foostudio



Commit 4be6db6a6163e3a0ccd85e7e193f54406c80a29a

Float only

cel committed on 10/24/2016, 6:06:56 PM
Parent: e03a630124fa47eb03d508fcfd576f8ebe4f28f1

Files changed

studio.cchanged
studio.cView
@@ -95,13 +95,8 @@
9595 int bps = format_bits / 8; /* bytes per sample */
9696 int phys_bps = snd_pcm_format_physical_width(format) / 8;
9797 int big_endian = snd_pcm_format_big_endian(format) == 1;
9898 int to_unsigned = snd_pcm_format_unsigned(format) == 1;
99- int is_float = (
100- format == SND_PCM_FORMAT_FLOAT_LE ||
101- format == SND_PCM_FORMAT_FLOAT_BE ||
102- format == SND_PCM_FORMAT_FLOAT64_LE ||
103- format == SND_PCM_FORMAT_FLOAT64_BE);
10499
105100 /* verify and prepare the contents of areas */
106101 for (chn = 0; chn < channels; chn++) {
107102 if ((areas[chn].first % 8) != 0) {
@@ -123,18 +118,14 @@
123118 float f;
124119 int i;
125120 } fval;
126121 int res, i;
127- if (is_float) {
128- if (dl->handle && dl->tune->play) {
129- fval.f = dl->tune->play(dl->tune, phase);
130- } else {
131- // val.f = sin(phase);
132- fval.f = 0;
133- }
134- res = fval.i;
135- } else
136- res = sin(phase) * maxval;
122 + if (dl->handle && dl->tune->play) {
123 + fval.f = dl->tune->play(dl->tune, phase);
124 + } else {
125 + fval.f = 0;
126 + }
127 + res = fval.i;
137128 if (to_unsigned)
138129 res ^= 1U << (format_bits - 1);
139130 for (chn = 0; chn < channels; chn++) {
140131 /* Generate data in native endian format */

Built with git-ssb-web