diff --git a/VERSION b/VERSION index a527f2e..f336455 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -September 13 2023 +October 25 2023 diff --git a/doc/CHANGES b/doc/CHANGES index bdb45cd..916b3f0 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -15103,4 +15103,7 @@ stats_noteon(). In function, output_track_summary(), suppressed notemeanpitch for percussion channel. +October 25 2023 + +Midistats returns track activity (note on/off) for every track. diff --git a/doc/midistats.1 b/doc/midistats.1 index 2896301..08c1cbc 100644 --- a/doc/midistats.1 +++ b/doc/midistats.1 @@ -1,4 +1,4 @@ -.TH MIDISTATS 1 "9 December 2022" +.TH MIDISTATS 1 "25 October 2023" .SH NAME \fBmidistats\fP \- program to summarize the statistical properties of a midi file .SH SYNOPSIS @@ -77,6 +77,10 @@ that occur in the midi file. pitchact is a similar histogram but is weighted by the length of the notes. .PP +chnact returns the amount of note activity in each channel. +.PP +trkact returns the number of notes in each track. +.PP totalrhythmpatterns is the total number of bar rhythm patterns for all channels except the percussion channel. .PP diff --git a/doc/readme.txt b/doc/readme.txt index fcc3868..fdcf947 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.75 September 13 2023 +midistats version 0.77 October 25 2023 24th January 2002 Copyright James Allwright diff --git a/midistats.c b/midistats.c index 1340441..8e3f28c 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.75 September 13 2023 midistats" +#define VERSION "0.77 October 25 2023 midistats" #include /* Microsoft Visual C++ Version 6.0 or higher */ @@ -63,6 +63,7 @@ static FILE *F; static FILE *outhandle; /* for producing the abc file */ int tracknum=0; /* track number */ +int lasttrack = 0; /* lasttrack */ int division; /* pulses per quarter note defined in MIDI header */ int quietLimit; /* minimum number of pulses with no activity */ long tempo = 500000; /* the default tempo is 120 quarter notes/minute */ @@ -171,6 +172,7 @@ int pitchhistogram[12]; /* pitch distribution for non drum notes */ int channel2prog[17]; /* maps channel to program */ int channel2nnotes[17]; /*maps channel to note count */ int chnactivity[17]; /* [SS] 2018-02-02 */ +int trkactivity[40]; /* [SS] 2023-10-25 */ int progactivity[128]; /* [SS] 2018-02-02 */ int pitchclass_activity[12]; /* [SS] 2018-02-02 */ int chanpitchhistogram[204]; /* [SS] 2023-09-13 */ @@ -417,6 +419,7 @@ void stats_header (int format, int ntrks, int ldivision) quietLimit = ldivision*8; divisionsPerBar = division*beatsPerBar; unitDivision = divisionsPerBar/24; + lasttrack = ntrks; /* [SS] 2023-10-25 */ printf("ntrks %d\n",ntrks); printf("ppqn %d\n",ldivision); chordthreshold = ldivision/16; /* [SS] 2018-01-21 */ @@ -439,6 +442,7 @@ void stats_header (int format, int ntrks, int ldivision) for (i=0;i<12;i++) pitchhistogram[i] = 0; /* [SS] 2017-11-01 */ for (i=0;i<12;i++) pitchclass_activity[i] = 0; /* [SS] 2018-02-02 */ for (i=0;i<128;i++) progactivity[i] = 0; /* [SS] 2018-02-02 */ + for (i=0;i<40;i++) trkactivity[i]=0; /* [SS] 2023-10-25 */ } void determine_progcolor () @@ -524,9 +528,13 @@ else for (i=0;i<12;i++) printf("%5.2f ",(double) pitchclass_activity[i]); printf("\nchnact "); /* [SS] 2018-02-08 */ 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.3f ",chnactivity[i]/(double) trkdata.npulses[0]); else - for (i=0;i<17;i++) printf("%5.2f ",(double) chnactivity[i]); + for (i=0;i<17;i++) printf("%5.3f ",(double) chnactivity[i]); +printf("\ntrkact "); + lasttrack++; + for (i=0;i