mirror of
https://github.com/sshlien/abcmidi.git
synced 2025-12-06 15:05:07 +00:00
Compare commits
1 Commits
2024.03.05
...
2024.03.18
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34f6ef01e2 |
@@ -1,4 +1,4 @@
|
|||||||
.TH MIDISTATS 1 "11 February 2024"
|
.TH MIDISTATS 1 "18 February 2024"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
\fBmidistats\fP \- program to summarize the statistical properties of a midi file
|
\fBmidistats\fP \- program to summarize the statistical properties of a midi file
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -139,6 +139,11 @@ rpats: the number of rhythmpatterns for each channels. This is a
|
|||||||
duplication of data printed previously.
|
duplication of data printed previously.
|
||||||
.br
|
.br
|
||||||
pavg: the average pitch of all the notes for each channel.
|
pavg: the average pitch of all the notes for each channel.
|
||||||
|
.br
|
||||||
|
spread: the percentage of the track that each channel is active.
|
||||||
|
.PP
|
||||||
|
If some of the channels appear in more than one track, then
|
||||||
|
some of the above values may be incorrect.
|
||||||
.PP
|
.PP
|
||||||
In addition the midistats may return other codes that describe
|
In addition the midistats may return other codes that describe
|
||||||
other characteristics. They include
|
other characteristics. They include
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ abc2abc version 2.21 February 19 2024
|
|||||||
yaps version 1.93 February 19 2024
|
yaps version 1.93 February 19 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.39 November 08 2022
|
||||||
midistats version 0.88 March 05 2024
|
midistats version 0.89 March 13 2024
|
||||||
|
|
||||||
24th January 2002
|
24th January 2002
|
||||||
Copyright James Allwright
|
Copyright James Allwright
|
||||||
|
|||||||
13
midistats.c
13
midistats.c
@@ -17,7 +17,7 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define VERSION "0.88 March 05 2024 midistats"
|
#define VERSION "0.89 March 13 2024 midistats"
|
||||||
|
|
||||||
/* midistrats.c is a descendent of midi2abc.c which was becoming to
|
/* midistrats.c is a descendent of midi2abc.c which was becoming to
|
||||||
large. The object of the program is to extract statistical characterisitic
|
large. The object of the program is to extract statistical characterisitic
|
||||||
@@ -204,6 +204,8 @@ struct notememory {int eighthUnit;
|
|||||||
int jumpCount;
|
int jumpCount;
|
||||||
int totalNotes;
|
int totalNotes;
|
||||||
int totalPitches;
|
int totalPitches;
|
||||||
|
int quietTime;
|
||||||
|
int used;
|
||||||
} nm[17];
|
} nm[17];
|
||||||
|
|
||||||
struct notememory tracknm;
|
struct notememory tracknm;
|
||||||
@@ -709,6 +711,8 @@ for (i=1;i<17;i++) {
|
|||||||
printf(" %f",trkdata.pitchEntropy[i]);
|
printf(" %f",trkdata.pitchEntropy[i]);
|
||||||
} else
|
} else
|
||||||
printf("-1 0");
|
printf("-1 0");
|
||||||
|
nm[i].quietTime += trkdata.quietTime[i];
|
||||||
|
nm[i].used = channel_used_in_track[i];
|
||||||
trkdata.quietTime[i] = 0; /* in case channel i is used in another track */
|
trkdata.quietTime[i] = 0; /* in case channel i is used in another track */
|
||||||
trkdata.numberOfGaps[i] = 0;
|
trkdata.numberOfGaps[i] = 0;
|
||||||
if (lasttrack > 1) printf(" %d %d %d\n",tracknm.zeroCount,tracknm.stepCount,tracknm.jumpCount);
|
if (lasttrack > 1) printf(" %d %d %d\n",tracknm.zeroCount,tracknm.stepCount,tracknm.jumpCount);
|
||||||
@@ -776,6 +780,8 @@ void clearNotememory () {
|
|||||||
nm[i].jumpCount = 0;
|
nm[i].jumpCount = 0;
|
||||||
nm[i].totalNotes =0;
|
nm[i].totalNotes =0;
|
||||||
nm[i].totalPitches =0;
|
nm[i].totalPitches =0;
|
||||||
|
nm[i].quietTime = 0;
|
||||||
|
nm[i].used = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1363,7 +1369,10 @@ int i;
|
|||||||
printf("\npavg: ");
|
printf("\npavg: ");
|
||||||
/* avoid dividing by 0 */
|
/* avoid dividing by 0 */
|
||||||
for(i=0;i<16;i++) printf(" %d",nm[i].totalPitches/(1+nm[i].totalNotes));
|
for(i=0;i<16;i++) printf(" %d",nm[i].totalPitches/(1+nm[i].totalNotes));
|
||||||
printf("\n");
|
printf("\nspread: ");
|
||||||
|
for(i=1;i<17;i++) if(nm[i].used > 0) printf(" %d",100*(trkdata.npulses[0] - nm[i].quietTime)/trkdata.npulses[0]);
|
||||||
|
else printf(" %d",0);
|
||||||
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void dualDrumPattern (int perc1, int perc2) {
|
void dualDrumPattern (int perc1, int perc2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user