2024.08.11

This commit is contained in:
sshlien
2024-08-11 17:17:02 -04:00
parent 4c571ebe65
commit 31bc3aae7c
4 changed files with 17 additions and 4 deletions

View File

@@ -1 +1 @@
July 26 2024 August 11 2024

View File

@@ -20,6 +20,7 @@ midicopy \- Copy selected track, channel, time interval of a MIDI file to anothe
[\fB-xdrums\fP \fIn1,n2,...\fP]\ [\fB-xdrums\fP \fIn1,n2,...\fP]\
[\fB-onlydrums\fP]\ [\fB-onlydrums\fP]\
[\fB-nodrums\fP]\ [\fB-nodrums\fP]\
[\fB-transpose\fP \fIn (semitones)]\
\fIinput.mid output.mid\fP \fIinput.mid output.mid\fP
.SH "DESCRIPTION" .SH "DESCRIPTION"
.PP .PP
@@ -142,6 +143,9 @@ Only copy the percussion channel.
.TP .TP
.B -nodrums .B -nodrums
Copy all channels except the percussion channel. 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 .SH EXAMPLE
.B midicopy.exe -trks 1,5 -from 2669 -to 8634 uzicko.mid fragment.mid .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 .SH AUTHOR
This manual page was written by Seymour Shlien. This manual page was written by Seymour Shlien.
.SH VERSION .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.

View File

@@ -5,7 +5,7 @@ abc2midi version 4.93 June 11 2024
abc2abc version 2.22 April 30 2024 abc2abc version 2.22 April 30 2024
yaps version 1.94 April 30 2024 yaps version 1.94 April 30 2024
abcmatch version 1.83 February 19 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 midistats version 0.96 July 26 2024
24th January 2002 24th January 2002

View File

@@ -52,7 +52,7 @@
#define VERSION "1.39 November 07 2023 midicopy" #define VERSION "1.40 August 11 2024 midicopy"
#include "midicopy.h" #include "midicopy.h"
#define NULLFUNC 0 #define NULLFUNC 0
#define NULL 0 #define NULL 0
@@ -116,6 +116,7 @@ int nobends = 0; /* [SS] 2017-12-15 */
int nopressure = 0; /* [SS] 2022-05-05 */ int nopressure = 0; /* [SS] 2022-05-05 */
int nocntrl = 0; /* [SS] 2022-05-05 */ int nocntrl = 0; /* [SS] 2022-05-05 */
int zerochannels = 0; /* [SS] 2020-10-09 */ int zerochannels = 0; /* [SS] 2020-10-09 */
int transpose = 0; /* [SS] 2024-08-11 */
long Mf_numbyteswritten = 0L; long Mf_numbyteswritten = 0L;
long readvarinum (); long readvarinum ();
@@ -1042,6 +1043,7 @@ chanmessage (int status, int c1, int c2)
switch (status & 0xf0) switch (status & 0xf0)
{ {
case 0x80: case 0x80:
if (chan != 9 && transpose != 0) c1 = c1 + transpose; /* 2024-08-11 */
copy_noteoff (chan, c1, c2); copy_noteoff (chan, c1, c2);
break; break;
case 0x90: case 0x90:
@@ -1060,6 +1062,7 @@ chanmessage (int status, int c1, int c2)
c2 = c2 - attenuation; c2 = c2 - attenuation;
if (c2 <0) c2 = 0; if (c2 <0) c2 = 0;
} }
if (chan != 9 && transpose != 0) c1 = c1 + transpose; /* 2024-08-11 */
copy_noteon (chan, c1, c2); copy_noteon (chan, c1, c2);
break; break;
case 0xa0: case 0xa0:
@@ -1077,6 +1080,7 @@ chanmessage (int status, int c1, int c2)
copy_program (chan, c1); copy_program (chan, c1);
break; break;
case 0xd0: case 0xd0:
if (chan != 9 && transpose != 0) c1 = c1 + transpose; /* 2024-08-11 */
if (nopressure == 0) copy_chanpressure (chan, c1); if (nopressure == 0) copy_chanpressure (chan, c1);
break; break;
} }
@@ -1862,6 +1866,7 @@ main (int argc, char *argv[])
printf ("-onlydrums (only channel 10)\n"); /* [SS] 2019-12-22 */ printf ("-onlydrums (only channel 10)\n"); /* [SS] 2019-12-22 */
printf ("-nodrums (exclude 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 ("-zerochannels set all channel numbers to zero\n"); /* [SS] 2020-10-09 */
printf("-transpose n (semitones)\n");
exit (1); exit (1);
} }
@@ -2155,6 +2160,10 @@ main (int argc, char *argv[])
arg = getarg("-zerochannels",argc,argv); /* [SS] 2020-10-09 */ arg = getarg("-zerochannels",argc,argv); /* [SS] 2020-10-09 */
if (arg >=0) zerochannels = 1; 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"); F_in = fopen (argv[argc - 2], "rb");
if (F_in == NULL) if (F_in == NULL)
{ {