//not working?! //got the wrong argument...
}
+
int errored = 0;
if (input_wave != NULL) {
errored = readWave(argv[2], input_wave);
goto error;
};
+ if (errored != -1) {
+ errored = modifyWave(input_wave, input_wave_length, argc, argv);
+ } else {
+ error_msg = "error from readWave()";
+ goto error;
+ };
+
if (errored != -1) {
errored = appendWave(input_wave, input_wave_length, argv[1]);
} else {
- error_msg = "[main()] error from readWave()";
+ error_msg = "error from modifyWave()";
goto error;
};
free(input_wave);
--- /dev/null
+#include "wavtool.h"
+
+
+int modifyWave(int16_t w[], int w_B, int argc, char *argv[])
+{
+ /* DESCRIPTION OF ARGUMENTS
+ * as to the arguments --
+ * according to gh/delta-kimigatame/PyWavTool, these are the options:
+ * > p1 p2
+ * > p1 p2 p3 v1 v2 v3 v4
+ * > p1 p2 p3 v1 v2 v3 v4 ove
+ * > p1 p2 p3 v1 v2 v3 v4 ove p4
+ * > p1 p2 p3 v1 v2 v3 v4 ove p4 p5 v5
+ * > float: p1, p2, p3, p4, p5, ove
+ * > int: v1, v2, v3, v4, v5
+ * very useful :D
+ * not sure what they should default to when not there tho...
+ *
+ * although this claims pn is a float, i cant set it to one...
+ * maybe it's a float but like .0 ?? who cares
+ *
+ * as to what i can guess these mean...
+ * theyre for the envelope i think
+ *
+ * when setting the envelope in UTAU, ...
+ *
+ * p1 - bottom left corner, x from left
+ * p2 - top left corner, x from left
+ * p3 - top right corner, x from right
+ * p4 - bottom right corner, x from right
+ * p5 - "extra" point, x from left
+ *
+ * NOTE: if p1 > p2, p2 remains at the lower value but is shown as
+ * being == to p1. It's the same if p4 > p3
+ *
+ * v1 - bottom left corner, y from bottom (if > 0, a line connects this and 0,0)
+ * v2 - top left corner, y from bottom
+ * v3 - top right corner, y from bottom
+ * v4 - bottom right corner, y from bottom (similar to v1)
+ * v5 - "extra" point, y from bottom
+ *
+ * ove - overlap of the prior note?? not entirely sure tbh (ill do ts last :p)
+ *
+ * well that was long
+ */
int readWave(char *filename, int16_t buffer[]);
//then edit the wave based on argv (do this later!!)
-//int modifyWave(int16_t wave[], int argc, char *argv[]);
+int modifyWave(int16_t wave[], int wave_length_bytes, int argc, char *argv[]);
//then append the new wave into the output file, creating it if it doesn't exist, and fixing the header!
int appendWave(int16_t wave[], int wave_length_bytes, char *output_filename);