diff --git a/VERSION b/VERSION index 83d1b7c..aa7ac64 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -September 06 2023 +September 11 2023 diff --git a/doc/midistats.1 b/doc/midistats.1 index b3e1fd3..88a6c2f 100644 --- a/doc/midistats.1 +++ b/doc/midistats.1 @@ -42,6 +42,7 @@ 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 .PP After processing all the individual tracks, the following information applies to the entire midi file. diff --git a/doc/readme.txt b/doc/readme.txt index c2b0d0a..6464ed6 100644 --- a/doc/readme.txt +++ b/doc/readme.txt @@ -6,7 +6,7 @@ abc2abc version 2.20 February 07 2023 yaps version 1.92 January 06 2023 abcmatch version 1.82 June 14 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 Copyright James Allwright diff --git a/midistats.c b/midistats.c index c14e5dc..b199ad9 100644 --- a/midistats.c +++ b/midistats.c @@ -18,7 +18,7 @@ * 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 /* Microsoft Visual C++ Version 6.0 or higher */ @@ -148,6 +148,7 @@ struct trkstat { int lastNoteOff[17]; int quietTime[17]; int rhythmpatterns[17]; + int numberOfGaps[17]; } trkdata; /* 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.pressure[i] = 0; /* [SS] 2022-03-04 */ trkdata.quietTime[i] = 0; /* [SS] 2022-08-22 */ + trkdata.numberOfGaps[i] = 0; /* [SS] 2023-09-07 */ progcolor[i] = 0; channel2prog[i] = 0; /* [SS] 2023-06-25-8/ 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]); else 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("totalrhythmpatterns =%d\n",nrpatterns); printf("collisions = %d\n",ncollisions); @@ -595,10 +590,11 @@ for (i=1;i<17;i++) { printf("-1 0 "); 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",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 printf("-1 0"); trkdata.quietTime[i] = 0; /* in case channel i is used in another track */ + trkdata.numberOfGaps[i] = 0; printf("\n"); 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); if (trkdata.lastNoteOff[chan+1] >= 0) { delta = Mf_currtime - trkdata.lastNoteOff[chan+1]; - trkdata.lastNoteOff[chan+1] = -1; /* in case of chord */ if (delta > quietLimit) { trkdata.quietTime[chan+1] += delta; + trkdata.numberOfGaps[chan+1]++; + trkdata.lastNoteOff[chan+1] = -1; /* in case of chord */ } }