Compare commits

..

1 Commits

Author SHA1 Message Date
Seymour Shlien
e3e78e94f0 2020.aug.09 2020-08-18 13:54:11 -04:00
5 changed files with 613 additions and 552 deletions

View File

@@ -1,2 +1,2 @@
2020 July 28 2020 2020 August 09 2020

View File

@@ -13551,7 +13551,11 @@ on some systems for this example.
X:1 X:1
L:1/4 L:1/4
K:C K:C
2c/2fac'/c'/c'/c'/c'/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2c/2fac'/c'/c'/c'/c'//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
Fix: add a test for zero denominator in genmidi.c Fix: add a test for zero denominator in genmidi.c
@@ -13785,8 +13789,16 @@ store.c Minor correction in store.c when the microtone denominator is
equal to 100 (in pitchof_b()). equal to 100 (in pitchof_b()).
August 09 2020
genmidi.c: introducing %%MIDI bendstringex.
It is similar to %%MIDI bendstring except that it linearly interpolates
the pitchbends, causing smoother transitions.
Method: created a new function expand_array() which expands an
array {20, -20, ...} to {5, 5, 5, 5, -5, -5, -5 ,5} or something
like that depending upon the parameter factor. The expanded array
of benddatata is now treated like in %%MIDI bendstring in the
queues.c file. Presently, I am using a factor of 4 (not configurable).
Bendstringex limited to 64 or less increments.

View File

@@ -1,7 +1,7 @@
abcMIDI : abc <-> MIDI conversion utilities abcMIDI : abc <-> MIDI conversion utilities
midi2abc version 3.46 June 22 2020 midi2abc version 3.46 June 22 2020
abc2midi version 4.40 July 28 2020 abc2midi version 4.41 August 09 2020
abc2abc version 2.08 June 04 2020 abc2abc version 2.08 June 04 2020
yaps version 1.78 June 14 2020 yaps version 1.78 June 14 2020
abcmatch version 1.73 June 04 2020 abcmatch version 1.73 June 04 2020

View File

@@ -1875,6 +1875,39 @@ if (remainder == 0) {
reduce(val_num,val_den); reduce(val_num,val_den);
} }
/* [SS] 2020-08-09 */
static void expand_array (shortarray, size, longarray, factor)
/* if shortarray = {21,-40} and factor = 4
* longarray will be {5,6,5,5,-10,-10,-10,-10}
* It is used for smoothing a bendstring.
*/
int shortarray[], longarray[];
int size;
int factor;
{
float increment, accumulator;
float last_accumulator;
int i,j,k;
if (size*factor > 256) {printf("not enough room in bendstring\n");
return;
}
j = 0;
for (i = 0; i< size; i++) {
increment = (float) shortarray[i]/factor;
accumulator = 0.0;
last_accumulator = 0.0;
for (k = 0; k < factor; k++) {
accumulator += increment;
if (increment > 0)
longarray[j] = (int) (accumulator + 0.5) - (int) (last_accumulator + 0.5);
else
longarray[j] = (int) (accumulator - 0.5) - (int) (last_accumulator - 0.5);
last_accumulator = accumulator;
j++;
}
}
}
static void dodeferred(s,noteson) static void dodeferred(s,noteson)
/* handle package-specific command which has been held over to be */ /* handle package-specific command which has been held over to be */
@@ -1888,6 +1921,7 @@ int noteson;
int done; int done;
int val; int val;
int i; int i;
int bendinput[64]; /* [SS] 2020-08-09 */
p = s; p = s;
skipspace(&p); skipspace(&p);
@@ -2044,6 +2078,21 @@ int noteson;
else bendtype = 2; else bendtype = 2;
} }
/* [SS] 2014-09-10 */
else if (strcmp(command, "bendstringex") == 0) {
i = 0;
while (i<64) { /* [SS] 2020-08-09 2015-09-10 2015-10-03 */
bendinput[i] = readsnump(&p);
skipspace(&p);
i = i + 1;
if (*p == 0) break;
};
expand_array (bendinput, i, benddata, 4);
bendnvals = i*4;
done = 1;
if (bendnvals == 1) bendtype = 3;
else bendtype = 2;
}
else if (strcmp(command, "drone") == 0) { else if (strcmp(command, "drone") == 0) {

View File

@@ -185,7 +185,7 @@ int main()
*/ */
#define VERSION "4.40 July 28 2020 abc2midi" #define VERSION "4.41 August 09 2020 abc2midi"
/* enables reading V: indication in header */ /* enables reading V: indication in header */
#define XTEN1 1 #define XTEN1 1