mirror of
https://github.com/sshlien/abcmidi.git
synced 2025-12-06 06:55:06 +00:00
2023.09.11
This commit is contained in:
@@ -42,6 +42,7 @@ the minimum pitch value
|
|||||||
the maximum pitch value
|
the maximum pitch value
|
||||||
the minimum note length in pulses
|
the minimum note length in pulses
|
||||||
the maximum note length in pulses
|
the maximum note length in pulses
|
||||||
|
the number of gaps in the channel
|
||||||
.PP
|
.PP
|
||||||
After processing all the individual tracks, the following information
|
After processing all the individual tracks, the following information
|
||||||
applies to the entire midi file.
|
applies to the entire midi file.
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ abc2abc version 2.20 February 07 2023
|
|||||||
yaps version 1.92 January 06 2023
|
yaps version 1.92 January 06 2023
|
||||||
abcmatch version 1.82 June 14 2022
|
abcmatch version 1.82 June 14 2022
|
||||||
midicopy version 1.38 May 06 2022
|
midicopy version 1.38 May 06 2022
|
||||||
midistats version 0.73 September 06 2023
|
midistats version 0.74 September 11 2023
|
||||||
|
|
||||||
24th January 2002
|
24th January 2002
|
||||||
Copyright James Allwright
|
Copyright James Allwright
|
||||||
|
|||||||
17
midistats.c
17
midistats.c
@@ -18,7 +18,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.73 September 09 2023 midistats"
|
#define VERSION "0.74 September 11 2023 midistats"
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
/* Microsoft Visual C++ Version 6.0 or higher */
|
/* Microsoft Visual C++ Version 6.0 or higher */
|
||||||
@@ -148,6 +148,7 @@ struct trkstat {
|
|||||||
int lastNoteOff[17];
|
int lastNoteOff[17];
|
||||||
int quietTime[17];
|
int quietTime[17];
|
||||||
int rhythmpatterns[17];
|
int rhythmpatterns[17];
|
||||||
|
int numberOfGaps[17];
|
||||||
} trkdata;
|
} trkdata;
|
||||||
|
|
||||||
/* The trkstat references the individual channels in the midi file.
|
/* The trkstat references the individual channels in the midi file.
|
||||||
@@ -426,6 +427,7 @@ void stats_header (int format, int ntrks, int ldivision)
|
|||||||
trkdata.cntlparam[i] = 0; /* [SS] 2022-03-04 */
|
trkdata.cntlparam[i] = 0; /* [SS] 2022-03-04 */
|
||||||
trkdata.pressure[i] = 0; /* [SS] 2022-03-04 */
|
trkdata.pressure[i] = 0; /* [SS] 2022-03-04 */
|
||||||
trkdata.quietTime[i] = 0; /* [SS] 2022-08-22 */
|
trkdata.quietTime[i] = 0; /* [SS] 2022-08-22 */
|
||||||
|
trkdata.numberOfGaps[i] = 0; /* [SS] 2023-09-07 */
|
||||||
progcolor[i] = 0;
|
progcolor[i] = 0;
|
||||||
channel2prog[i] = 0; /* [SS] 2023-06-25-8/
|
channel2prog[i] = 0; /* [SS] 2023-06-25-8/
|
||||||
channel2nnotes[i] = 0;
|
channel2nnotes[i] = 0;
|
||||||
@@ -523,13 +525,6 @@ if (npulses > 0)
|
|||||||
for (i=1;i<17;i++) printf("%5.2f ",chnactivity[i]/(double) trkdata.npulses[0]);
|
for (i=1;i<17;i++) printf("%5.2f ",chnactivity[i]/(double) trkdata.npulses[0]);
|
||||||
else
|
else
|
||||||
for (i=0;i<17;i++) printf("%5.2f ",(double) chnactivity[i]);
|
for (i=0;i<17;i++) printf("%5.2f ",(double) chnactivity[i]);
|
||||||
/*printf("\nquietTime ");
|
|
||||||
for (i=1;i<17;i++) {
|
|
||||||
printf (" %d ", trkdata.quietTime[i]);
|
|
||||||
}
|
|
||||||
It is all zeros [SS] 2023-09-06
|
|
||||||
*/
|
|
||||||
|
|
||||||
printf("\npitchentropy %f\n",histogram_entropy(pitchclass_activity,12));
|
printf("\npitchentropy %f\n",histogram_entropy(pitchclass_activity,12));
|
||||||
printf("totalrhythmpatterns =%d\n",nrpatterns);
|
printf("totalrhythmpatterns =%d\n",nrpatterns);
|
||||||
printf("collisions = %d\n",ncollisions);
|
printf("collisions = %d\n",ncollisions);
|
||||||
@@ -595,10 +590,11 @@ for (i=1;i<17;i++) {
|
|||||||
printf("-1 0 ");
|
printf("-1 0 ");
|
||||||
printf("%d %d ",trkdata.cntlparam[i],trkdata.pressure[i]); /* [SS] 2022-03-04 */
|
printf("%d %d ",trkdata.cntlparam[i],trkdata.pressure[i]); /* [SS] 2022-03-04 */
|
||||||
printf("%d %d ",trkdata.quietTime[i],trkdata.rhythmpatterns[i]);
|
printf("%d %d ",trkdata.quietTime[i],trkdata.rhythmpatterns[i]);
|
||||||
if (i != 10) printf("%d %d %d %d",trkdata.notepitchmin[i], trkdata.notepitchmax[i] ,trkdata.notelengthmin[i], trkdata.notelengthmax[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]);
|
||||||
else
|
else
|
||||||
printf("-1 0");
|
printf("-1 0");
|
||||||
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;
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
channel2nnotes[i] += trkdata.notecount[i] + trkdata.chordcount[i];
|
channel2nnotes[i] += trkdata.notecount[i] + trkdata.chordcount[i];
|
||||||
@@ -663,9 +659,10 @@ int chan, pitch, vol;
|
|||||||
trkdata.notepitchmin[chan+1] = min(trkdata.notepitchmin[chan+1],pitch);
|
trkdata.notepitchmin[chan+1] = min(trkdata.notepitchmin[chan+1],pitch);
|
||||||
if (trkdata.lastNoteOff[chan+1] >= 0) {
|
if (trkdata.lastNoteOff[chan+1] >= 0) {
|
||||||
delta = Mf_currtime - trkdata.lastNoteOff[chan+1];
|
delta = Mf_currtime - trkdata.lastNoteOff[chan+1];
|
||||||
trkdata.lastNoteOff[chan+1] = -1; /* in case of chord */
|
|
||||||
if (delta > quietLimit) {
|
if (delta > quietLimit) {
|
||||||
trkdata.quietTime[chan+1] += delta;
|
trkdata.quietTime[chan+1] += delta;
|
||||||
|
trkdata.numberOfGaps[chan+1]++;
|
||||||
|
trkdata.lastNoteOff[chan+1] = -1; /* in case of chord */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user