mirror of
https://github.com/sshlien/abcmidi.git
synced 2025-12-08 10:41:02 +00:00
Compare commits
2 Commits
2022.02.18
...
2022.03.08
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35876618bb | ||
|
|
eaf451d6ad |
44
doc/CHANGES
44
doc/CHANGES
@@ -14617,4 +14617,48 @@ Fix: swapped p2 and p1 in
|
||||
*transpose = p2 - p1;
|
||||
in parsesound() in parseabc.c
|
||||
|
||||
February 21 2022
|
||||
abc2abc mangles text. eg
|
||||
input:
|
||||
|
||||
X:1
|
||||
T: Text mangled by abc2abc
|
||||
Q:1/2=120
|
||||
M:4/4
|
||||
L:1/8
|
||||
K:G bass octave=-2
|
||||
%%begintext center
|
||||
this text is mangled
|
||||
%%endtext
|
||||
%%
|
||||
!f! g2 z d g2 z d | gdgb d'2 z2 | c'2 z a c'2 z a | cafa d2 z2 | gggg gggg | [I:repeat] |
|
||||
|
||||
abc2abc text.abc -t 2 >output.abc
|
||||
|
||||
output:
|
||||
|
||||
X:1
|
||||
T:Text mangled by abc2abc
|
||||
Q:1/2=120
|
||||
M:4/4
|
||||
L:1/8
|
||||
K:Amaj clef=bass octave=-2
|
||||
%%begintext center
|
||||
this tfxt is mbnalfe
|
||||
%%endtext
|
||||
%%
|
||||
!f! a2 z e a2 z e | aeac' e'2 z2 | d'2 z b d'2 z b | dbgb e2 z2 | aaaa aaaa | [I:repeat] |
|
||||
|
||||
Analysis:
|
||||
Parseline (line) in parseabc.c checks the line for %%begintext using strcmp.
|
||||
Unfortunately, it does not find a match because the line also contains
|
||||
the word 'center'.
|
||||
|
||||
Fix: replaced
|
||||
if (strcmp(line,"%%begintext") == 0) {
|
||||
with
|
||||
if (strstr(line,"%%begintext") != NULL) {
|
||||
which returns the pointer to %%begintext in the line.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
abcMIDI : abc <-> MIDI conversion utilities
|
||||
|
||||
midi2abc version 3.50 February 12 2022
|
||||
abc2midi version 4.68 February 18 2022
|
||||
abc2abc version 2.15 May 25 2021
|
||||
yaps version 1.87 May 25 2021
|
||||
midi2abc version 3.52 March 04 2022
|
||||
abc2midi version 4.69 February 22 2022
|
||||
abc2abc version 2.16 February 22 2022
|
||||
yaps version 1.88 February 22 2022
|
||||
abcmatch version 1.80 November 25 2021
|
||||
midicopy version 1.37 October 10 2020
|
||||
|
||||
|
||||
32
midi2abc.c
32
midi2abc.c
@@ -45,7 +45,7 @@
|
||||
* based on public domain 'midifilelib' package.
|
||||
*/
|
||||
|
||||
#define VERSION "3.49 June 27 2021 midi2abc"
|
||||
#define VERSION "3.52 March 04 2022 midi2abc"
|
||||
|
||||
#include <limits.h>
|
||||
/* Microsoft Visual C++ Version 6.0 or higher */
|
||||
@@ -165,6 +165,7 @@ int header_keysig= -50; /* header key signature */
|
||||
int active_keysig = -50; /* last key signature declared */
|
||||
int xchannel; /* channel number to be extracted. -1 means all */
|
||||
int timeunits = 1; /*tells prtime to display time in beats [SS] 2018-10-25 */
|
||||
double bend2cents = 40.96; /* [SS] 2022-02-12 */
|
||||
|
||||
|
||||
/* structure for storing music notes */
|
||||
@@ -809,7 +810,7 @@ char *mess;
|
||||
int n;
|
||||
char *p = mess;
|
||||
char *buff;
|
||||
char buffer2[BUFFSIZE];
|
||||
char buffer2[BUFFSIZE+4]; /* [SS] 2022-02-12 */
|
||||
|
||||
if ((type < 1)||(type > unrecognized))
|
||||
type = unrecognized;
|
||||
@@ -1148,6 +1149,8 @@ void stats_header (int format, int ntrks, int ldivision)
|
||||
for (i=0;i<17;i++) {
|
||||
trkdata.npulses[i] = 0;
|
||||
trkdata.pitchbend[i] = 0;
|
||||
trkdata.cntlparam[i] = 0; /* [SS] 2022-03-04 */
|
||||
trkdata.pressure[i] = 0; /* [SS] 2022-03-04 */
|
||||
progcolor[i] = 0;
|
||||
channel2prog[i] = -1;
|
||||
channel2nnotes[i] = 0;
|
||||
@@ -1307,7 +1310,8 @@ for (i=0;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]);
|
||||
printf("%d %d ",trkdata.notemeanpitch[i], trkdata.notelength[i]);
|
||||
printf("%d %d ",trkdata.cntlparam[i],trkdata.pressure[i]); /* [SS] 2022-03-04 */
|
||||
printf("\n");
|
||||
|
||||
channel2nnotes[i] += trkdata.notecount[i] + trkdata.chordcount[i];
|
||||
@@ -1408,13 +1412,21 @@ void stats_noteoff(int chan,int pitch,int vol)
|
||||
if(Mf_currtime > last_tick[chan+1]) last_tick[chan+1] = Mf_currtime;
|
||||
}
|
||||
|
||||
void mftxt_pressure(chan,pitch,press)
|
||||
void mftxt_polypressure(chan,pitch,press)
|
||||
int chan, pitch, press;
|
||||
{
|
||||
char *key;
|
||||
if (prtime(timeunits)) return;
|
||||
key = pitch2key(pitch);
|
||||
printf("Pressure %2d %3s %3d\n",chan+1,key,press);
|
||||
printf("Polyphonic Key Pressure %2d %3s %3d\n",chan+1,key,press);
|
||||
}
|
||||
void mftxt_chanpressure(chan,pitch,press)
|
||||
int chan, pitch, press;
|
||||
{
|
||||
char *key;
|
||||
if (prtime(timeunits)) return;
|
||||
key = pitch2key(pitch);
|
||||
printf("Channel Pressure %2d %3s %3d\n",chan+1,key,press);
|
||||
}
|
||||
|
||||
|
||||
@@ -1423,6 +1435,7 @@ int chan, lsb, msb;
|
||||
{
|
||||
float bend;
|
||||
int pitchbend;
|
||||
double cents;
|
||||
/*
|
||||
if (onlychan >=0 && chan != onlychan) return;
|
||||
*/
|
||||
@@ -1430,8 +1443,8 @@ int chan, lsb, msb;
|
||||
/* [SS] 2014-01-05 2015-08-04*/
|
||||
pitchbend = (msb*128 + lsb);
|
||||
bend = (float) (pitchbend - 8192);
|
||||
bend = bend/40.96;
|
||||
printf("Pitchbend %2d %d bend = %6.3f (cents)\n",chan+1,pitchbend,bend);
|
||||
cents = bend/bend2cents; /* [SS] 2022-02-12 */
|
||||
printf("Pitchbend %2d %d cents = %6.3f (cents)\n",chan+1,pitchbend,cents);
|
||||
}
|
||||
|
||||
void stats_pitchbend(chan,lsb,msb)
|
||||
@@ -1586,6 +1599,7 @@ int chan, control, value;
|
||||
/* if (onlychan >=0 && chan != onlychan) return; */
|
||||
if (prtime(timeunits)) return;
|
||||
|
||||
if (control == 6) bend2cents = 8192.0/(100.0*value); /*[SS] 2022-02-12 */
|
||||
printf("CntlParm %2d %s = %d\n",chan+1, ctype[control],value);
|
||||
}
|
||||
|
||||
@@ -1776,11 +1790,11 @@ void initfunc_for_mftext()
|
||||
Mf_trackend = txt_trackend;
|
||||
Mf_noteon = mftxt_noteon;
|
||||
Mf_noteoff = mftxt_noteoff;
|
||||
Mf_pressure =mftxt_pressure;
|
||||
Mf_pressure =mftxt_polypressure;
|
||||
Mf_parameter = mftxt_parameter;
|
||||
Mf_pitchbend = mftxt_pitchbend;
|
||||
Mf_program = mftxt_program;
|
||||
Mf_chanpressure = mftxt_pressure;
|
||||
Mf_chanpressure = mftxt_chanpressure;
|
||||
Mf_sysex = no_op2;
|
||||
Mf_metamisc = no_op3;
|
||||
Mf_seqnum = no_op1;
|
||||
|
||||
@@ -3353,11 +3353,11 @@ parseline (line)
|
||||
{
|
||||
char *p, *q;
|
||||
|
||||
/* [SS] 2020-01-03 */
|
||||
if (strcmp(line,"%%begintext") == 0) {
|
||||
/* [SS] 2020-01-03 2021-02-21 */
|
||||
if (strstr(line,"%%begintext") != NULL) {
|
||||
ignore_line = 1;
|
||||
}
|
||||
if (strcmp(line,"%%endtext") == 0) {
|
||||
if (strstr(line,"%%endtext") != NULL) {
|
||||
ignore_line = 0;
|
||||
}
|
||||
/* [SS] 2021-05-09 */
|
||||
|
||||
2
store.c
2
store.c
@@ -186,7 +186,7 @@ int main()
|
||||
|
||||
*/
|
||||
|
||||
#define VERSION "4.68 February 18 2022 abc2midi"
|
||||
#define VERSION "4.70 February 22 2022 abc2midi"
|
||||
|
||||
/* enables reading V: indication in header */
|
||||
#define XTEN1 1
|
||||
|
||||
2
toabc.c
2
toabc.c
@@ -21,7 +21,7 @@
|
||||
|
||||
/* back-end for outputting (possibly modified) abc */
|
||||
|
||||
#define VERSION "2.15 May 25 2021 abc2abc"
|
||||
#define VERSION "2.16 February 21 2022 abc2abc"
|
||||
|
||||
/* for Microsoft Visual C++ 6.0 or higher */
|
||||
#ifdef _MSC_VER
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
/* yapstree.c - back-end for abc parser. */
|
||||
/* generates a data structure suitable for typeset music */
|
||||
|
||||
#define VERSION "1.87 May 25 2021 yaps"
|
||||
#define VERSION "1.88 February 22 2022 yaps"
|
||||
#include <stdio.h>
|
||||
#ifdef USE_INDEX
|
||||
#define strchr index
|
||||
|
||||
Reference in New Issue
Block a user