mirror of
https://github.com/sshlien/abcmidi.git
synced 2025-12-08 10:41:02 +00:00
Compare commits
1 Commits
2020-07-28
...
2020-08-09
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3e78e94f0 |
20
doc/CHANGES
20
doc/CHANGES
@@ -13551,7 +13551,11 @@ on some systems for this example.
|
||||
X:1
|
||||
L:1/4
|
||||
K:C
|
||||
2c/2fac'/c'/c'/c'/c'///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
2c/2fac'/c'/c'/c'/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()).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
1092
doc/readme.txt
1092
doc/readme.txt
File diff suppressed because it is too large
Load Diff
49
genmidi.c
49
genmidi.c
@@ -1875,6 +1875,39 @@ if (remainder == 0) {
|
||||
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)
|
||||
/* handle package-specific command which has been held over to be */
|
||||
@@ -1888,6 +1921,7 @@ int noteson;
|
||||
int done;
|
||||
int val;
|
||||
int i;
|
||||
int bendinput[64]; /* [SS] 2020-08-09 */
|
||||
|
||||
p = s;
|
||||
skipspace(&p);
|
||||
@@ -2044,6 +2078,21 @@ int noteson;
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user