aspizu / libmonotone

MONTONE tracker playback library in C
The Unlicense
4 stars 2 forks source link

Added different waveform logic! #7

Open rajatkriplani opened 6 hours ago

rajatkriplani commented 6 hours ago

libmonotone.h now has an enum for waveform_type_t, member waveform_type in the monotone_s struct, and a function prototype monotone_set_waveform_type(). Still when I run it I get the error:

./monotone_converter "songs/Jakim - Aboriginal Derivatives.mon" output.pcm
Invalid .mon file format.
rajatkriplani commented 3 hours ago

I have made changes. I have got a question! why if-else instead of switch case?

aspizu commented 2 hours ago
+ gcc -std=c11 libmonotone.c main.c -o libmonotone
libmonotone.c: In function ‘monotone_generate’:
libmonotone.c:180:55: error: ‘M_PI’ undeclared (first use in this function)
  180 |                     track_sample = (size_t)(((sin(2 * M_PI * t / 100) + 1) * 127.5));
      |                                                       ^~~~
libmonotone.c:180:55: note: each undeclared identifier is reported only once for each function it appears in

I've pushed a commit which fixes the invalid .mon file error. Please make sure it compiles.