summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlara Modin <klarasmodin@gmail.com>2020-08-28 16:11:26 +0200
committerKlara Modin <klarasmodin@gmail.com>2020-08-28 16:11:26 +0200
commit0c02af1732e7680282118d0cac043c4cff21acb6 (patch)
treebbc61d0acf948e37203ad69f7beafcf18e5d22ad
parent5cb4b2dd03af08d7116d02683e2b211c7f898d40 (diff)
adjust length and instrument
-rw-r--r--genwav.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/genwav.c b/genwav.c
index f51b452..fa39ad8 100644
--- a/genwav.c
+++ b/genwav.c
@@ -261,16 +261,16 @@ int main(int argc, char *argv[])
file = argv[1];
FILE *out = fopen(file, "w");
struct wav_header *header = header_init();
- size_t length = header->sample_rate*header->channels*header->bits_per_sample/8*10;
+ size_t length = header->sample_rate*header->channels*header->bits_per_sample/8*4;
int16_t *data = calloc(length, sizeof(*data));
header_update(header, length);
struct instrument *inst = instrument_init(2);
- struct instrument_part part = {.mod_func=&half_sine, .frequency=220, .amplitude=1/64.0, .amp_kind=Coeff};
+ struct instrument_part part = {.mod_func=&abs_sine, .frequency=2000, .amplitude=1.0/64, .amp_kind=Coeff};
instrument_add_part(inst, &part);
part.frequency=1;
part.amplitude=1;
- part.mod_func=&sin;
+ part.mod_func=&half_sine;
part.freq_kind=Coeff;
part.amp_kind=Coeff;
instrument_add_part(inst, &part);
@@ -285,14 +285,14 @@ int main(int argc, char *argv[])
part2.amp_kind=Coeff;
instrument_add_part(inst2, &part2);
- //put_instrument(header, inst2, 440, 0x7ff, data, length);
+ //put_instrument(header, inst, 440, 0x7ff, data, length);
//put_instrument(header, inst2, 440*5/2, 0x7ff, data, length);
int frequency = 440;
//put_tone(header, data, &sin, frequency, 0x7ff, length/2);
//put_tone(header, data+D_LEN(header,length/2), &sin, frequency*2, 0x7ff, length/2);
- //put_scale_general(header, data, inst2, frequency, 0x7ff, length, 12);
- //put_scale(header, data, inst, frequency, 0x7ff, length);
+ //put_scale_general(header, data, inst, frequency, 0x7ff, length, 12);
+ put_scale(header, data, inst, frequency, 0x7ff, length);
//put_something(header, data, inst, frequency, 0x7ff, length, 24);
//put_something(header, data, inst2, frequency, 0x7ff, length, 48);