comparison ringtools/imy/main.c @ 882:fd4c9bc7835d

fc-imy2pwt program written, compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 03 Apr 2022 03:30:27 +0000
parents
children a96cb97b66a2
comparison
equal deleted inserted replaced
881:bb8ad7c0cee8 882:fd4c9bc7835d
1 /*
2 * This file contains the top-level code for fc-imy2pwt.
3 */
4
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include "sizelimits.h"
8
9 char *imy_filename;
10 char melody_str_buf[MELODY_BUF_SIZE];
11 unsigned beats_per_min = 120;
12 unsigned tdma_durations[6][4];
13 FILE *outF;
14
15 main(argc, argv)
16 char **argv;
17 {
18 if (argc < 2 || argc > 3) {
19 fprintf(stderr, "usage: %s imy-file [outfile]\n", argv[0]);
20 exit(1);
21 }
22 imy_filename = argv[1];
23 read_imy_firstpass();
24 compute_note_durations();
25 if (argc > 2) {
26 outF = fopen(argv[2], "w");
27 if (!outF) {
28 perror(argv[2]);
29 exit(1);
30 }
31 } else
32 outF = stdout;
33 melody_convert_pass();
34 exit(0);
35 }