diff --git a/VERSION b/VERSION index 7d18349..3220d73 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -July 26 2024 +August 11 2024 diff --git a/doc/midicopy.1 b/doc/midicopy.1 index 460f854..8aaf996 100644 --- a/doc/midicopy.1 +++ b/doc/midicopy.1 @@ -20,6 +20,7 @@ midicopy \- Copy selected track, channel, time interval of a MIDI file to anothe [\fB-xdrums\fP \fIn1,n2,...\fP]\ [\fB-onlydrums\fP]\ [\fB-nodrums\fP]\ + [\fB-transpose\fP \fIn (semitones)]\ \fIinput.mid output.mid\fP .SH "DESCRIPTION" .PP @@ -142,6 +143,9 @@ Only copy the percussion channel. .TP .B -nodrums Copy all channels except the percussion channel. +.TP +.B -transpose n (semitones) +Transpose pitch for all channels except the percussion by n semitones. .SH EXAMPLE .B midicopy.exe -trks 1,5 -from 2669 -to 8634 uzicko.mid fragment.mid @@ -154,4 +158,4 @@ Midicopy will copy tracks 1 and 5 starting from midi pulse position .SH AUTHOR This manual page was written by Seymour Shlien. .SH VERSION -This man page describes midicopy version 1.33 from December 22 2019. +This man page describes midicopy version 1.40 from August 11 2024. diff --git a/doc/readme.txt b/doc/readme.txt index 7d82c18..6f64754 100644 --- a/doc/readme.txt +++ b/doc/readme.txt @@ -5,7 +5,7 @@ abc2midi version 4.93 June 11 2024 abc2abc version 2.22 April 30 2024 yaps version 1.94 April 30 2024 abcmatch version 1.83 February 19 2024 -midicopy version 1.39 November 08 2022 +midicopy version 1.40 August 11 2024 midistats version 0.96 July 26 2024 24th January 2002 diff --git a/midicopy.c b/midicopy.c index fe52e6e..00bacba 100644 --- a/midicopy.c +++ b/midicopy.c @@ -52,7 +52,7 @@ -#define VERSION "1.39 November 07 2023 midicopy" +#define VERSION "1.40 August 11 2024 midicopy" #include "midicopy.h" #define NULLFUNC 0 #define NULL 0 @@ -116,6 +116,7 @@ int nobends = 0; /* [SS] 2017-12-15 */ int nopressure = 0; /* [SS] 2022-05-05 */ int nocntrl = 0; /* [SS] 2022-05-05 */ int zerochannels = 0; /* [SS] 2020-10-09 */ +int transpose = 0; /* [SS] 2024-08-11 */ long Mf_numbyteswritten = 0L; long readvarinum (); @@ -1042,6 +1043,7 @@ chanmessage (int status, int c1, int c2) switch (status & 0xf0) { case 0x80: + if (chan != 9 && transpose != 0) c1 = c1 + transpose; /* 2024-08-11 */ copy_noteoff (chan, c1, c2); break; case 0x90: @@ -1060,6 +1062,7 @@ chanmessage (int status, int c1, int c2) c2 = c2 - attenuation; if (c2 <0) c2 = 0; } + if (chan != 9 && transpose != 0) c1 = c1 + transpose; /* 2024-08-11 */ copy_noteon (chan, c1, c2); break; case 0xa0: @@ -1077,6 +1080,7 @@ chanmessage (int status, int c1, int c2) copy_program (chan, c1); break; case 0xd0: + if (chan != 9 && transpose != 0) c1 = c1 + transpose; /* 2024-08-11 */ if (nopressure == 0) copy_chanpressure (chan, c1); break; } @@ -1862,6 +1866,7 @@ main (int argc, char *argv[]) printf ("-onlydrums (only channel 10)\n"); /* [SS] 2019-12-22 */ printf ("-nodrums (exclude channel 10)\n"); /* [SS] 2019-12-22 */ printf ("-zerochannels set all channel numbers to zero\n"); /* [SS] 2020-10-09 */ + printf("-transpose n (semitones)\n"); exit (1); } @@ -2155,6 +2160,10 @@ main (int argc, char *argv[]) arg = getarg("-zerochannels",argc,argv); /* [SS] 2020-10-09 */ if (arg >=0) zerochannels = 1; + /* [SS] 2024-08-11 */ + arg = getarg("-transpose",argc,argv); + if (arg >=0) sscanf (argv[arg], "%d", &transpose); + F_in = fopen (argv[argc - 2], "rb"); if (F_in == NULL) {