Compare commits

...

2 Commits

Author SHA1 Message Date
sshlien
79e7ac2d97 2024.01.15 2024-01-15 17:22:56 -05:00
sshlien
ad41b9b053 2024.01.02 2024-01-03 09:41:14 -05:00
5 changed files with 64 additions and 22 deletions

View File

@@ -1,2 +1,2 @@
December 26 2023
January 04 2024

View File

@@ -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.

View File

@@ -1,4 +1,4 @@
.TH MIDISTATS 1 "27 December 2023"
.TH MIDISTATS 1 "04 January 2024"
.SH NAME
\fBmidistats\fP \- program to summarize the statistical properties of a midi file
.SH SYNOPSIS
@@ -78,10 +78,17 @@ that occur in the midi file.
.PP
key indicates the key of the music, the number of sharps (positive) or
flats (negative) in the key signature, and a measure of the confidence
in this key signature. The key was estimated from the above pitch histogram.
A confidence level below 0.4 indicates that the pitch histogram does
not follow the histogram of a major or minor scale. (It may be the
result of a mixture of two key signatures.)
in this key signature. The key was estimated from the above pitch histogram
by convolving with Craig Sapp's model. The peak of rmaj or rmin (below)
indicates the key. A correlation less than 0.4 indicates that the pitch
histogram does not follow the histogram of a major or minor scale.
(It may be the result of a mixture of two key signatures.)
.PP
rmaj the cross correlation coefficients with Craig Sapp's major key model
for each of the 11 keys (C, C#, D, ...,B).
.PP
rmaj the cross correlation coefficients with Craig Sapp's minor key model
for each of the 11 keys (C, C#, D, ...,B).
.PP
pitchact is a similar histogram but is weighted by the length of
the notes.
@@ -244,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
@@ -262,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 <fy733@ncf.ca>

View File

@@ -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.83 December 26 2023
midistats version 0.85 January 04 2024
24th January 2002
Copyright James Allwright

View File

@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define VERSION "0.83 December 27 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 <lastEvent; i++) {
channel = midievents[i].channel;
if (channel != chn) continue;
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");
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);
@@ -1381,8 +1383,11 @@ for (r=0;r<12;r++) {
if (bestMode == 0) sf = maj2sf[bestIndex];
else sf = min2sf[bestIndex];
/*printf("\nkeymatch: best = %f bestIndex = %d bestMode = %d",best,bestIndex,bestMode);*/
printf("\nkey %s%s %d %f",keylist[bestIndex],majmin[bestMode],sf,best);
printf("\nrmaj ");
for (r=0;r<12;r++) printf("%7.3f",rmaj[r]);
printf("\nrmin ");
for (r=0;r<12;r++) printf("%7.3f",rmin[r]);
}
@@ -1586,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;
@@ -1623,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 <number> debug parameter\n");
printf(" The input filename is assumed to be any string not\n");