mirror of
https://github.com/sshlien/abcmidi.git
synced 2025-12-06 06:55:06 +00:00
2025.06.14
This commit is contained in:
15
midi2abc.c
15
midi2abc.c
@@ -45,7 +45,7 @@
|
|||||||
* based on public domain 'midifilelib' package.
|
* based on public domain 'midifilelib' package.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define VERSION "3.63 February 13 2025 midi2abc"
|
#define VERSION "3.64 June 14 2025 midi2abc"
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
/* Microsoft Visual C++ Version 6.0 or higher */
|
/* Microsoft Visual C++ Version 6.0 or higher */
|
||||||
@@ -720,9 +720,6 @@ if (leng == 12) {
|
|||||||
/*printf("%d %d %d %d %f %d\n",midipitch,newpitch,low,hi,ratio,cents);*/
|
/*printf("%d %d %d %d %f %d\n",midipitch,newpitch,low,hi,ratio,cents);*/
|
||||||
/*printf("sysext: %d %d\n",newpitch,cents);*/
|
/*printf("sysext: %d %d\n",newpitch,cents);*/
|
||||||
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
printf("leng was %d\n",leng);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1007,9 +1004,11 @@ int start_time,initvol;
|
|||||||
int cents,centvalue,pitchbend;
|
int cents,centvalue,pitchbend;
|
||||||
int newpitchint;
|
int newpitchint;
|
||||||
float newpitch,fcents;
|
float newpitch,fcents;
|
||||||
|
int position;
|
||||||
|
|
||||||
|
|
||||||
start_time = close_note(chan, pitch, &initvol);
|
start_time = close_note(chan, pitch, &initvol);
|
||||||
|
position = start_time*50/division;
|
||||||
if (start_time <= 0) return;
|
if (start_time <= 0) return;
|
||||||
if (sysexBentPitches[pitch] >0.0) {
|
if (sysexBentPitches[pitch] >0.0) {
|
||||||
newpitch = sysexBentPitches[pitch];
|
newpitch = sysexBentPitches[pitch];
|
||||||
@@ -1020,7 +1019,7 @@ if (sysexBentPitches[pitch] >0.0) {
|
|||||||
cents = (newpitch -newpitchint)*100;
|
cents = (newpitch -newpitchint)*100;
|
||||||
}
|
}
|
||||||
centvalue = (newpitchint % 12)*100 + cents;
|
centvalue = (newpitchint % 12)*100 + cents;
|
||||||
printf("%f\t%d\t%d\n",newpitch,cents,centvalue);
|
printf("%d\t%f\t%d\t%d\n",position,newpitch,cents,centvalue);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{pitchbend = chanbend[chan+1];
|
{pitchbend = chanbend[chan+1];
|
||||||
@@ -1032,7 +1031,7 @@ else
|
|||||||
}
|
}
|
||||||
centvalue = cents + (pitch % 12)*100;
|
centvalue = cents + (pitch % 12)*100;
|
||||||
newpitch = (float) pitch + cents/100.0;
|
newpitch = (float) pitch + cents/100.0;
|
||||||
printf("%f\t%d (%d)\t%d\n",newpitch,cents,pitchbend,centvalue);
|
printf("%d\t%f\t%d (%d)\t%d\n",position,newpitch,cents,pitchbend,centvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Mf_currtime > last_tick[chan+1]) last_tick[chan+1] = Mf_currtime;
|
if(Mf_currtime > last_tick[chan+1]) last_tick[chan+1] = Mf_currtime;
|
||||||
@@ -1403,13 +1402,13 @@ char *mess;
|
|||||||
if (prtime(timeunits)) return;
|
if (prtime(timeunits)) return;
|
||||||
printf("Metatext (%s) ",ttype[type]);
|
printf("Metatext (%s) ",ttype[type]);
|
||||||
len = leng;
|
len = leng;
|
||||||
if (len > 15) len = 15;
|
if (len > 55) len = 55; /* [SS] 2025-06-14 */
|
||||||
for ( n=0; n<len; n++ ) {
|
for ( n=0; n<len; n++ ) {
|
||||||
c = (*p++) & 0xff;
|
c = (*p++) & 0xff;
|
||||||
if(iscntrl(c)) {printf(" \\0x%02x",c); continue;} /* no <cr> <lf> */
|
if(iscntrl(c)) {printf(" \\0x%02x",c); continue;} /* no <cr> <lf> */
|
||||||
printf( (isprint(c)||isspace(c)) ? "%c" : "\\0x%02x" , c);
|
printf( (isprint(c)||isspace(c)) ? "%c" : "\\0x%02x" , c);
|
||||||
}
|
}
|
||||||
if (leng>15) printf("...");
|
if (leng>55) printf("...");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user