Imported Upstream version 20141016
Ross Gammon
9 years ago
10533 | 10533 | September 28 2014 |
10534 | 10534 | |
10535 | 10535 | Extended the maximum bendstring length to 50. |
10536 | ||
10537 | ||
10538 | October 16 2014 | |
10539 | ||
10540 | Abc2midi: in some applications it may be desirable to suppresses | |
10541 | all messages. A new option -silent was introduced to suppress the | |
10542 | the other warnings and messages not handled by the -quiet option. | |
10543 | eg. | |
10544 | abc2midi nottingham.abc -silent -quiet | |
10545 | produces almost not output except for the MIDI files. | |
10546 |
1 | 1 | .SH NAME |
2 | 2 | \fBabc2midi\fP \- converts abc file to MIDI file(s) |
3 | 3 | .SH SYNOPSIS |
4 | abc2midi \fIinfile\fP [\fIrefnum\fP] [-c] [-v] [-ver] [-t] [-n limit] [-RS] [-quiet] [-Q tempo] [-NFNP] [-NFER] [-NGRA] [-STFW] [-OCC] [-NCOM] [-HARP] [-BF] [-TT] [-o outfile] -CSM [filename] | |
4 | abc2midi \fIinfile\fP [\fIrefnum\fP] [-c] [-v] [-ver] [-t] [-n limit] [-RS] [-quiet] [-silent] [-Q tempo] [-NFNP] [-NFER] [-NGRA] [-STFW] [-OCC] [-NCOM] [-HARP] [-BF] [-TT] [-o outfile] -CSM [filename] | |
5 | 5 | .SH DESCRIPTION |
6 | 6 | The default action is to write a MIDI file for each abc tune |
7 | 7 | with the filename <stem>N.mid, where <stem> is the filestem |
30 | 30 | use 3:1 instead of 2:1 for broken rhythms |
31 | 31 | .TP |
32 | 32 | .B -quiet |
33 | Suppresses some commong warnings. | |
33 | Suppresses some common warnings. | |
34 | .TP | |
35 | .B -silent | |
36 | Supresses other messages. | |
34 | 37 | .TP |
35 | 38 | .B -n \fI X\fP |
36 | 39 | limits the length of the file name stem to X characters |
0 | 0 | abcMIDI : abc <-> MIDI conversion utilities |
1 | 1 | |
2 | 2 | midi2abc version 2.94 January 05 2014 |
3 | abc2midi version 3.36 September 28 2014 | |
3 | abc2midi version 3.37 October 16 2014 | |
4 | 4 | abc2abc version 1.75 September 08 2013 |
5 | 5 | yaps version 1.56 November 04 2013 |
6 | 6 | abcmatch version 1.62 January 01 2014 |
245 | 245 | -n <limit> set limit for length of filename stem |
246 | 246 | -RS use 3:1 instead of 2:1 for broken rhythms |
247 | 247 | -quiet suppress some common warnings |
248 | -silent suppresses other messages | |
248 | 249 | -Q <tempo> in quarter notes/minute |
249 | 250 | -NFNP ignore all dynamic indications (!f! !ff! !p! etc.) |
250 | 251 | -NFER ignore fermata markings |
89 | 89 | extern int verbose; |
90 | 90 | extern int quiet; |
91 | 91 | extern int sf, mi; |
92 | extern int silent; /* [SS] 2014-10-16 */ | |
92 | 93 | |
93 | 94 | extern int retuning,bend; /* [SS] 2012-04-01 */ |
94 | 95 | int drumbars; |
650 | 651 | } |
651 | 652 | while ((partno < parts) && |
652 | 653 | (part_start[partlabel] == -1)) { |
653 | event_error("Part not defined"); | |
654 | if (!silent) event_error("Part not defined"); | |
654 | 655 | partno = partno + 1; |
655 | 656 | if (partno < parts) { |
656 | 657 | partlabel = (int)part.st[partno] - (int)'A'; |
2781 | 2782 | char msg[100]; |
2782 | 2783 | sprintf(msg,"unequal notes in chord %d/%d versus %d/%d", |
2783 | 2784 | note_num,note_denom,num[j],denom[j]); |
2784 | event_warning(msg); | |
2785 | if (!silent) event_warning(msg); | |
2785 | 2786 | num[j] = note_num; |
2786 | 2787 | denom[j] = note_denom; |
2787 | 2788 | } |
3215 | 3216 | }; |
3216 | 3217 | j = j + 1; |
3217 | 3218 | }; |
3218 | if ((expect_repeat)&&(pass==1)) { | |
3219 | if ((expect_repeat)&&(pass==1) && !silent) { | |
3219 | 3220 | event_error("Missing :| at end of tune"); |
3220 | 3221 | }; |
3221 | 3222 | clearQ(); |
30 | 30 | * Wil Macaulay (wil@syndesis.com) |
31 | 31 | */ |
32 | 32 | |
33 | #define VERSION "3.36 September 28 2014" | |
33 | #define VERSION "3.37 October 16 2014" | |
34 | 34 | /* enables reading V: indication in header */ |
35 | 35 | #define XTEN1 1 |
36 | 36 | /*#define INFO_OCTAVE_DISABLED 1*/ |
130 | 130 | int retuning = 0; /* [SS] 2012-04-01 */ |
131 | 131 | int bend = 8192; /* [SS] 2012-04-01 */ |
132 | 132 | int comma53 = 0; /* [SS] 2014-01-12 */ |
133 | int silent = 0; /* [SS] 2014-10-16 */ | |
133 | 134 | void init_p48toc53 (); /* [SS] 2014-01-12 */ |
134 | 135 | void convert_to_comma53 (char acc, int *midipitch, int* midibend); |
135 | 136 | |
772 | 773 | } |
773 | 774 | |
774 | 775 | if (getarg("-OCC",argc,argv) != -1) oldchordconvention=1; |
776 | if (getarg("-silent",argc,argv) != -1) silent = 1; /* [SS] 2014-10-16 */ | |
775 | 777 | |
776 | 778 | maxnotes = 500; |
777 | 779 | /* allocate space for notes */ |
804 | 806 | printf(" -n <limit> set limit for length of filename stem\n"); |
805 | 807 | printf(" -RS use 3:1 instead of 2:1 for broken rhythms\n"); |
806 | 808 | printf(" -quiet suppress some common warnings\n"); |
809 | printf(" -silent suppresses most messages\n"); | |
807 | 810 | printf(" -Q default tempo (quarter notes/minute)\n"); |
808 | 811 | printf(" -NFNP don't process !p! or !f!-like fields\n"); |
809 | 812 | printf(" -NCOM suppress comments in output MIDI file\n"); |
2291 | 2294 | if (pastheader && parts == -1) return; /* [SS] 2014-04-10 */ |
2292 | 2295 | if (pastheader) { |
2293 | 2296 | if (((int)*p < 'A') || ((int)*p > 'Z')) { |
2294 | event_error("Part must be one of A-Z"); | |
2297 | if (!silent) event_error("Part must be one of A-Z"); | |
2295 | 2298 | return; |
2296 | 2299 | }; |
2297 | 2300 | if ((headerpartlabel == 1) && (part.st[0] == *p)) { |
3746 | 3749 | } else { |
3747 | 3750 | /* Experimental feature supports "_ignored words" */ |
3748 | 3751 | if (strchr("_^<>@", (int)*p) == NULL) { |
3749 | event_error("Guitar chord does not start with A-G or a-g"); | |
3752 | if (!silent) event_error("Guitar chord does not start with A-G or a-g"); | |
3750 | 3753 | }; |
3751 | 3754 | return; |
3752 | 3755 | }; |
3774 | 3777 | p = p + 1; |
3775 | 3778 | p = get_accidental(p, &accidental); |
3776 | 3779 | inversion = pitchof(note, accidental, 1, 0, 0) - middle_c; |
3777 | } else { | |
3780 | } else if (!silent) { | |
3778 | 3781 | event_error(" / must be followed by A-G or a-g in gchord"); |
3779 | 3782 | }; |
3780 | 3783 | }; |
4172 | 4175 | /*printf("tied_num = %d done = %d inchord = %d\n",tied_num, done, inchord);*/ |
4173 | 4176 | place = place + 1; |
4174 | 4177 | }; |
4175 | if (tietodo == 1) { | |
4178 | if (tietodo == 1 && !silent) { | |
4176 | 4179 | event_error("Could not find note to be tied"); |
4177 | 4180 | }; |
4178 | 4181 | }; |
5247 | 5250 | if (parts > -1) { |
5248 | 5251 | addfeature(PART, ' ', 0, 0); |
5249 | 5252 | }; |
5250 | if (headerpartlabel == 1) { | |
5253 | if (headerpartlabel == 1 && !silent) { | |
5251 | 5254 | event_error("P: field in header should go after K: field"); |
5252 | 5255 | }; |
5253 | 5256 | if (verbose > 1) { |
5283 | 5286 | if ((fp = fopen(outname, "wb")) == NULL) { |
5284 | 5287 | event_fatal_error("File open failed"); |
5285 | 5288 | }; |
5286 | printf("writing MIDI file %s\n", outname); | |
5289 | if (!silent) printf("writing MIDI file %s\n", outname); | |
5287 | 5290 | Mf_putc = myputc; |
5288 | 5291 | Mf_writetrack = writetrack; |
5289 | 5292 | header_time_num = time_num; |
5314 | 5317 | /* blank line found in abc signifies the end of a tune */ |
5315 | 5318 | { |
5316 | 5319 | if (dotune) { |
5317 | print_voicecodes(); | |
5320 | if (!silent) print_voicecodes(); | |
5318 | 5321 | finishfile(); |
5319 | 5322 | parseroff(); |
5320 | 5323 | dotune = 0; |