diff --git a/VERSION b/VERSION index f151eb0..1ee6f43 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -Juen 25 2023 +August 22 2023 diff --git a/doc/CHANGES b/doc/CHANGES index 4202f9a..bdb45cd 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -15093,3 +15093,14 @@ be the acoutic piano (0) by default. If more than one channel with the same program color, they should be added together. + +August 22 2023 + +Midistats improved the calculation of the number of rhythm patterns +in a channel (barChn[chan].rhythmPattern) by allowing for dithering +of note onset. Introduced dithermargin variable in function +stats_noteon(). In function, output_track_summary(), suppressed +notemeanpitch for percussion channel. + + + diff --git a/doc/readme.txt b/doc/readme.txt index 9fd48c8..aafe79d 100644 --- a/doc/readme.txt +++ b/doc/readme.txt @@ -6,20 +6,18 @@ 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.59 February 08 2023 +midistats version 0.71 August 222023 24th January 2002 - Copyright James Allwright -J.R.Allwright@westminster.ac.uk +jamesallwright@yahoo.co.uk University of Westminster, London, UK -October 2021 - -Seymour Shlien -Ottawa, Canada +August 2023 +Copyright Seymour Shlien fy733@ncf.ca +Ottawa, Canada This is free software. You may copy and re-distribute it under the terms of the GNU General Public License version 2 or later, which is available from diff --git a/midistats.c b/midistats.c index addb4c5..dd7dc04 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.70 June 25 2023 midistats" +#define VERSION "0.71 August 22 2023 midistats" #include /* Microsoft Visual C++ Version 6.0 or higher */ @@ -584,7 +584,10 @@ for (i=1;i<17;i++) { printf("trkinfo "); printf("%d %d ",i,trkdata.program[i]); /* channel number and program*/ printf("%d %d ",trkdata.notecount[i],trkdata.chordcount[i]); - printf("%d %d ",trkdata.notemeanpitch[i], trkdata.notelength[i]); + /* [SS] 2023-08-22 */ + if (i != 10) printf("%d %d ",trkdata.notemeanpitch[i], trkdata.notelength[i]); + else + 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]); trkdata.quietTime[i] = 0; @@ -628,7 +631,9 @@ int chan, pitch, vol; int delta; int barnum; int unit; + int dithermargin; /* [SS] 2023-08-22 */ + dithermargin = unitDivision/2 - 1; if (vol == 0) { /* treat as noteoff */ stats_noteoff(chan,pitch,vol); @@ -661,7 +666,7 @@ int chan, pitch, vol; barChn[chan].rhythmPattern = 0; barChn[chan].activeBarNumber = barnum; } - unit = (Mf_currtime % divisionsPerBar)/unitDivision; + unit = ((Mf_currtime+dithermargin) % divisionsPerBar)/unitDivision; //printf("unit = %d pattern = %d \n",unit,barChn[chan].rhythmPattern); barChn[chan].rhythmPattern = barChn[chan].rhythmPattern |= (1UL << unit); }