From fc164c60cd7d582784827de9a7560cba46fa13e2 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Fri, 11 Mar 2022 10:54:14 -0500 Subject: *chef kiss* --- examples/seq.c | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/examples/seq.c b/examples/seq.c index 1482ac3..492c53b 100644 --- a/examples/seq.c +++ b/examples/seq.c @@ -14,6 +14,15 @@ #include #include +struct sequence { + size_t speech_part; + + int single_iterations, + unison_iterations; + + xas_drone_chamber_interval *intervals; +}; + static void usage(int argc, char **argv, const char *message, ...) { va_list args; @@ -141,14 +150,11 @@ int main(int argc, char **argv) { { { 0, 0 }, 0, 0, XAS_SYNTH_SINE, XAS_SYNTH_SINE } }; - struct { - size_t speech_part; - xas_drone_chamber_interval *intervals; - } sequences[] = { - { 0, intro }, - { 1, middle }, - { 2, ingest }, - { 3, climax } + struct sequence sequences[] = { + { 0, 3, 1, intro }, + { 1, 0, 4, middle }, + { 2, 1, 0, ingest }, + { 3, 1, 2, climax } }; xas_drone *drone, @@ -159,7 +165,7 @@ int main(int argc, char **argv) { struct timeval cur = { 0, 0 }, tmp; - size_t part; + int s; if (argc != 2) { usage(argc, argv, "No output file provided"); @@ -210,8 +216,10 @@ int main(int argc, char **argv) { timerclear(&cur); - for (part=0; part<4; part++) { - xas_drone_chamber_interval *intervals = sequences[part].intervals; + for (s=0; s<4; s++) { + struct sequence sequence = sequences[s]; + + xas_drone_chamber_interval *intervals = sequence.intervals; int i; tmp = cur; @@ -226,11 +234,11 @@ int main(int argc, char **argv) { cur = tmp; - for (i=0; i<2; i++) { + for (i=0; i