mirror of
https://github.com/sshlien/abcmidi.git
synced 2025-12-06 15:05:07 +00:00
Compare commits
3 Commits
2024.06.12
...
2024.08.11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31bc3aae7c | ||
|
|
4c571ebe65 | ||
|
|
10af1c7b16 |
@@ -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.
|
||||
|
||||
@@ -36,25 +36,26 @@ number.
|
||||
.PP
|
||||
trkinfo is an array of 19 numbers which indicates the statistical properties
|
||||
of the track of interest. The following data is given:
|
||||
the channel number,
|
||||
the first program assigned to this channel,
|
||||
the number of notes for this channel counting any chords as one note,
|
||||
the total number of notes for this for this channel,
|
||||
the sum of the MIDI pitches for all the notes,
|
||||
the sum of the note durations in MIDI pulse units,
|
||||
the number of control parameter messages,
|
||||
the number of pressure messages.
|
||||
the number of distinct rhythm patterns for each channel
|
||||
the number of pulses the channel was inactive
|
||||
the minimum pitch value
|
||||
the maximum pitch value
|
||||
the minimum note length in pulses
|
||||
the maximum note length in pulses
|
||||
the number of gaps in the channel
|
||||
the entropy of the pitch class histogram for that channel
|
||||
the number of notes whose pitch were the same as the previous note
|
||||
the number of notes whose pitch changed by less than 4 semitones
|
||||
the number of notes whose pitch changed by 4 or more semitones
|
||||
0 the channel number,
|
||||
1 the first program assigned to this channel,
|
||||
2 the number of notes for this channel counting any chords as one note,
|
||||
3 the total number of notes for this for this channel,
|
||||
4 the sum of the MIDI pitches for all the notes,
|
||||
5 the sum of the note durations in MIDI pulse units,
|
||||
6 the number of pitchbend messages,
|
||||
7 the number of control parameter messages,
|
||||
8 the number of pressure messages.
|
||||
9 the number of distinct rhythm patterns for each channel
|
||||
10 the number of pulses the channel was inactive
|
||||
11 the minimum pitch value
|
||||
12 the maximum pitch value
|
||||
13 the minimum note length in pulses
|
||||
14 the maximum note length in pulses
|
||||
15 the number of gaps in the channel
|
||||
16 the entropy of the pitch class histogram for that channel
|
||||
17 the number of notes whose pitch were the same as the previous note
|
||||
18 the number of notes whose pitch changed by less than 4 semitones
|
||||
19 the number of notes whose pitch changed by 4 or more semitones
|
||||
(In event of a chords the maximum pitches are compared.)
|
||||
.PP
|
||||
After processing all the individual tracks, the following information
|
||||
|
||||
@@ -5,8 +5,8 @@ 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
|
||||
midistats version 0.94 June 11 2024
|
||||
midicopy version 1.40 August 11 2024
|
||||
midistats version 0.96 July 26 2024
|
||||
|
||||
24th January 2002
|
||||
Copyright James Allwright
|
||||
|
||||
11
midicopy.c
11
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)
|
||||
{
|
||||
|
||||
10
midistats.c
10
midistats.c
@@ -17,7 +17,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define VERSION "0.94 June 12 2024 midistats"
|
||||
#define VERSION "0.96 July 26 2024 midistats"
|
||||
|
||||
/* midistrats.c is a descendent of midi2abc.c which was becoming to
|
||||
large. The object of the program is to extract statistical characterisitic
|
||||
@@ -740,6 +740,7 @@ for (i=1;i<17;i++) {
|
||||
if (i != 10) printf("%d %d ",trkdata.notemeanpitch[i], trkdata.notelength[i]);
|
||||
else
|
||||
printf("-1 0 ");
|
||||
printf("%d ",trkdata.pitchbend[i]); /* [SS] 2024-07-26 */
|
||||
printf("%d %d ",trkdata.cntlparam[i],trkdata.pressure[i]); /* [SS] 2022-03-04 */
|
||||
printf("%d %d ",trkdata.quietTime[i],trkdata.rhythmpatterns[i]);
|
||||
if (i != 10) {printf("%d %d %d %d %d",trkdata.notepitchmin[i], trkdata.notepitchmax[i] ,trkdata.notelengthmin[i], trkdata.notelengthmax[i], trkdata.numberOfGaps[i]);
|
||||
@@ -901,6 +902,7 @@ int chan, pitch, vol;
|
||||
int dithermargin; /* [SS] 2023-08-22 */
|
||||
int cpitch; /* [SS] 2023-09-13 */
|
||||
int pulsePosition;
|
||||
int beatnumber;
|
||||
|
||||
cpitch = pitch % 12;
|
||||
channel_used_in_track[chan+1]++; /* [SS] 2023-09-06 */
|
||||
@@ -951,8 +953,10 @@ int chan, pitch, vol;
|
||||
chanpitchhistogram[chan*12+cpitch]++; /* [SS] 2023-09-13 */
|
||||
|
||||
eigthunit = Mf_currtime/halfdivision;
|
||||
updateNotememory (eigthunit, chan, pitch);
|
||||
updateTrackNotememory (eigthunit, chan, pitch);
|
||||
beatnumber = Mf_currtime/division;
|
||||
|
||||
updateNotememory (beatnumber, chan, pitch);
|
||||
updateTrackNotememory (beatnumber, chan, pitch);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user