git ssb

0+

cel / foostudio



Commit b5ebb2a607ac9ea92f525350e5b18580d0e71888

Move tau into tune.c

cel committed on 10/24/2016, 11:40:33 PM
Parent: 5786b0b025e423f956afb157f1478abd951ddb2a

Files changed

ccdl.cchanged
studio.cchanged
tune.cchanged
ccdl.cView
@@ -38,9 +38,9 @@
3838 if (child < 0) return -1;
3939 if (child == 0) {
4040 char *const argv[] = {
4141 "cc", (char *)src, "-o", (char *)lib,
42- "-fPIC", "-shared", "-lm", "-std=c99",
42 + "-fPIC", "-shared", "-lm",
4343 NULL};
4444 return execvp(argv[0], argv);
4545 } else {
4646 int wstatus;
studio.cView
@@ -45,9 +45,9 @@
4545 snd_pcm_uframes_t offset,
4646 int count, double *_phase)
4747 {
4848 double phase = *_phase;
49- double step = 2. * M_PI/(double)rate;
49 + double step = 1/(double)rate;
5050 unsigned char *samples[channels];
5151 int steps[channels];
5252 unsigned int chn;
5353 int format_bits = snd_pcm_format_width(format);
tune.cView
@@ -2,9 +2,9 @@
22 #include "tune.h"
33
44 static float tune_play(struct tune *tune, double time)
55 {
6- return 0.99 * sin(time*440);
6 + return 0.99 * sin(2. * M_PI * time * 440.);
77 }
88
99 const struct tune TUNE = {
1010 .play = tune_play,

Built with git-ssb-web