From 79e7ac2d97961277c9479034fbf3cc102be712a2 Mon Sep 17 00:00:00 2001 From: sshlien Date: Mon, 15 Jan 2024 17:22:56 -0500 Subject: [PATCH] 2024.01.15 --- VERSION | 2 +- doc/CHANGES | 20 ++++++++++++++++++++ doc/midistats.1 | 12 +++++++----- doc/readme.txt | 2 +- midistats.c | 30 ++++++++++++++++++++---------- 5 files changed, 49 insertions(+), 17 deletions(-) diff --git a/VERSION b/VERSION index 5b1de51..5ac5b1d 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -January 02 2024 +January 04 2024 diff --git a/doc/CHANGES b/doc/CHANGES index ce69e2c..468b24e 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -15207,3 +15207,23 @@ not adjusted by event_chordoff to compensate by the length value specified at the end of the [ac'] chord, resulting in the problem. +January 15 2024 + +abc2midi bug: the following example produces a warning, but the +the output midi file is correct. + +Warning in line-char 7-23 : Track 1 Bar 1 has 1 time units while the time signature has 2 + +X:1 +T:Test trill +L:1/4 +M:2/2 +Q:1/2=60 +K:Dm + !trill!"C"g4- | g2^c2 | + +Analysis: this warning is produced by checkbar() in genmidi.c. This problem was +reported in this file on November 23 2012. The code for handling tied notes is +quite intricate and I do not understand it. I am hesitant in tampering with the code. + + diff --git a/doc/midistats.1 b/doc/midistats.1 index c5afa8c..ae2f59f 100644 --- a/doc/midistats.1 +++ b/doc/midistats.1 @@ -1,4 +1,4 @@ -.TH MIDISTATS 1 "02 January 2024" +.TH MIDISTATS 1 "04 January 2024" .SH NAME \fBmidistats\fP \- program to summarize the statistical properties of a midi file .SH SYNOPSIS @@ -251,7 +251,7 @@ splits the two 4-bit values with a period. Thus 33 = (2*16 + 1). .br Returns the pitch class distribution for the entire midi file. .PP --nseqfor +-nseqfor n .br Note sequence for channel n. This option produces a string of bytes indicating the presence of a note in a time unit corresponding to @@ -269,13 +269,15 @@ twice of much memory. Though the pitch resolution is not sufficient to distinguish major or minor chords, it should be sufficient to be identify some repeating patterns. +.PP +-nseq +.br +Same as above except it is applied to all channels except the +percussion channel. -ver (version number) -.B etc. (See drums.txt in doc folder.) - - .SH AUTHOR Seymour Shlien diff --git a/doc/readme.txt b/doc/readme.txt index 89a827e..ec25211 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.39 November 08 2022 -midistats version 0.84 January 02 2023 +midistats version 0.85 January 04 2024 24th January 2002 Copyright James Allwright diff --git a/midistats.c b/midistats.c index fb6c8bf..11821d3 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.84 December 29 2023 midistats" +#define VERSION "0.85 January 04 2024 midistats" /* midistrats.c is a descendent of midi2abc.c which was becoming to large. The object of the program is to extract statistical characterisitic @@ -1178,15 +1178,17 @@ half = division/2; for (i = 0; i<8000; i++) pseq[i] = 0; for (i = 0; i = 8000) {printf("index too large in drumpattern\n"); + if (channel == 9) continue; /* ignore percussion channel */ + if (channel == chn || chn == -1) { + pitchclass = midievents[i].pitch % 12; + noteNum = pitch2noteseq[pitchclass]; + onset = midievents[i].onsetTime; + index = onset/half; + if (index >= 8000) {printf("index too large in drumpattern\n"); break; } - pseq[index] = pseq[index] |= 1 << noteNum; + pseq[index] = pseq[index] |= 1 << noteNum; + } /*printf("pitchclass = %d noteNum =%d index = %d pseq[index] %d \n",pitchclass, noteNum, index, pseq[index]); */ } printf("lastBeat = %d\n",lastBeat); @@ -1589,6 +1591,13 @@ int argc; } } + arg = getarg("-nseq",argc,argv); + if (arg != -1) { + nseqfor = 1; + stats = 0; + nseqchn = -1; + } + arg = getarg("-ppathist",argc,argv); if (arg != -1) { percpatternhist = 1; @@ -1626,10 +1635,11 @@ int argc; printf(" -pulseanalysis\n"); printf(" -panal\n"); printf(" -ppat\n"); - printf(" -ppatfor\n"); + printf(" -ppatfor pitch\n"); printf(" -ppathist\n"); printf(" -pitchclass\n"); - printf(" -nseqfor\n"); + printf(" -nseq\n"); + printf(" -nseqfor channel\n"); printf(" -ver version number\n"); printf(" -d debug parameter\n"); printf(" The input filename is assumed to be any string not\n");