Skip to content

Commit

Permalink
more flexible aftertouch
Browse files Browse the repository at this point in the history
  • Loading branch information
jpffitch committed Dec 11, 2017
1 parent 17415c4 commit 85c7d4f
Show file tree
Hide file tree
Showing 13 changed files with 2,224 additions and 2,028 deletions.
4 changes: 2 additions & 2 deletions InOut/midirecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ void midi_ctl_reset(CSOUND *csound, int16 chan)
chn->pbensens = FL(2.0); /* pitch bend range */
chn->datenabl = 0;
/* reset aftertouch to max value - added by Istvan Varga, May 2002 */
chn->aftouch = FL(127.0);
chn->aftouch = csound->aftouch;
for (i = 0; i < 128; i++)
chn->polyaft[i] = FL(127.0);
chn->polyaft[i] = csound->aftouch;
/* controller 64 has just been set to zero: terminate any held notes */
if (chn->ksuscnt && !MGLOB(rawControllerMode))
sustsoff(csound, chn);
Expand Down
7 changes: 6 additions & 1 deletion Top/argdecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ static const char *longUsageList[] = {
Str_noop("--fftlib=N actual FFT lib to use (FFTLIB=0, "
"PFFFT = 1, vDSP =2)"),
Str_noop("--udp-echo echo UDP commands on terminal"),
Str_noop("--aft-zero set atftertouch to zero, not 127 (default)"),
" ",
Str_noop("--help long help"),
NULL
Expand Down Expand Up @@ -1179,7 +1180,11 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv)
csound->info_message_request = 1;
return 1;
}

else if (!(strcmp(s, "aft-zero"))){
csound->aftouch = 0;
return 1;
}

csoundErrorMsg(csound, Str("unknown long option: '--%s'"), s);
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions Top/csound.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ static const CSOUND cenviron_ = {
0, /* msg_queue_rstart */
0, /* msg_queue_items */
NULL, /* directory for corfiles */
127, /* aftouch */
/*, NULL */ /* self-reference */
};

Expand Down
1 change: 1 addition & 0 deletions include/csoundCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,7 @@ typedef struct NAME__ {
volatile long msg_queue_rstart; /* Reader - start index */
volatile long msg_queue_items;
void *directory;
int aftouch;
/*struct CSOUND_ **self;*/
/**@}*/
#endif /* __BUILDING_LIBCSOUND */
Expand Down

0 comments on commit 85c7d4f

Please sign in to comment.