1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598
|
From: Victor Lazzarini <victor.lazzarini@mu.ie>
Date: Tue, 25 Apr 2023 09:15:22 +0100
Subject: initialize K opcodes at init-time
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Origin: upstream
Applied-Upstream: 6329e68307e7bdcb5698d5e8d8948f3914680ed1, 4124c3560a2caa47036de1f4885347c9714a3e95, be6f60d52dfccba1b9a816767c6f9126b154327a, 84625d274360988a776bc5e6cb9a236cd5efa322, 8f304709c005f5daed90ffa2a453a608f3d1f770, c9356e4101ec2b2a9ecae1576c28b46d5b624fbf, fd1a55a2646d21d2c5c4de3c3cf419573f7cc36e
Last-Update: 2024-08-21
zmoelnig's "co-authoring" is just cherry picking all the relevant
commits and squashing them into one (dropping trailing whitespace)
Co-Authored: IOhannes m zmölnig <umlaeute@debian.org>
---
Engine/csound_orc_compile.c | 31 +++++++++++++++++++++-------
Engine/csound_orc_semantics.c | 22 +++++++++++++++-----
Engine/csound_type_system.c | 4 ++--
Engine/insert.c | 10 +++++----
Engine/symbtab.c | 13 +++++++-----
Opcodes/ftsamplebank.cpp | 4 ++--
Opcodes/sfont.c | 48 +++++++++++++++++++++----------------------
interfaces/CsoundFile.cpp | 4 ++--
util/atsa.c | 3 +--
util/hetro.c | 6 +++---
10 files changed, 89 insertions(+), 56 deletions(-)
diff --git a/Engine/csound_orc_compile.c b/Engine/csound_orc_compile.c
index 6bd1fb9..b223834 100644
--- a/Engine/csound_orc_compile.c
+++ b/Engine/csound_orc_compile.c
@@ -246,13 +246,13 @@ char **splitArgs(CSOUND *csound, char *argString) {
if (*(t + 1) == '[') {
char *start = t;
- int len = 1;
+ //int len = 1;
int j;
t++;
while (*t == '[') {
t++;
- len++;
+ //len++;
if (UNLIKELY(*t != ']')) {
// FIXME: needs more precise error information
@@ -263,7 +263,7 @@ char **splitArgs(CSOUND *csound, char *argString) {
}
t++;
- len++;
+ //len++;
dimensions++;
}
part = csound->Malloc(csound, sizeof(char) * (dimensions + 3));
@@ -907,15 +907,15 @@ INSTRTXT *create_instrument(CSOUND *csound, TREE *root,
!(root->left->left != NULL &&
root->left->left->type ==
UDO_ANS_TOKEN)) { /* named instrument */
- int32 insno_priority = -1L;
+ //int32 insno_priority = -1L;
c = root->left->value->lexeme;
if (PARSER_DEBUG)
csound->Message(csound, "create_instrument: instr name %s\n", c);
- if (UNLIKELY(root->left->rate == (int)'+')) {
+ /* if (UNLIKELY(root->left->rate == (int)'+')) {
insno_priority--;
- }
+ } */
ip->insname = csound->Malloc(csound, strlen(c) + 1);
strcpy(ip->insname, c);
@@ -1377,6 +1377,22 @@ void insert_opcodes(CSOUND *csound, OPCODINFO *opcodeInfo,
}
}
+
+static int inargs_check(OPCODINFO *opinfo, char *inargs) {
+ char *c = opinfo->intypes;
+ int i;
+ if(strcmp(c, inargs) != 0) {
+ for(i = 0; c[i] != 0; i++) {
+ if(c[i] != inargs[i]) {
+ if(c[i] == 'K' && inargs[i] == 'k') continue;
+ else return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+
OPCODINFO *find_opcode_info(CSOUND *csound, char *opname, char *outargs,
char *inargs) {
OPCODINFO *opinfo = csound->opcodeInfo;
@@ -1387,8 +1403,9 @@ OPCODINFO *find_opcode_info(CSOUND *csound, char *opname, char *outargs,
while (opinfo != NULL) {
if (UNLIKELY(strcmp(opinfo->name, opname) == 0 &&
- strcmp(opinfo->intypes, inargs) == 0 &&
+ inargs_check(opinfo, inargs) == 0 &&
strcmp(opinfo->outtypes, outargs) == 0)) {
+
return opinfo;
}
opinfo = opinfo->prv; /* Move on: JPff suggestion */
diff --git a/Engine/csound_orc_semantics.c b/Engine/csound_orc_semantics.c
index 418848a..ba55b15 100644
--- a/Engine/csound_orc_semantics.c
+++ b/Engine/csound_orc_semantics.c
@@ -694,13 +694,19 @@ int check_array_arg(char* found, char* required) {
return (*f == *r);
}
-int check_in_arg(char* found, char* required) {
+int check_in_arg(char* found, char* req) {
char* t;
int i;
- if (UNLIKELY(found == NULL || required == NULL)) {
+ char required[64];
+
+ if (UNLIKELY(found == NULL || req == NULL)) {
return 0;
}
+ if(*req != 'K')
+ strcpy(required,req);
+ else strcpy(required, "k");
+
if (strcmp(found, required) == 0) {
return 1;
}
@@ -851,6 +857,13 @@ int check_out_arg(char* found, char* required) {
return 0;
}
+
+ if(required[0] == 'K' && found[0] == 'k'){
+ return 1;
+ }
+
+
+
// constants not allowed in out args
if (strcmp(found, "c") == 0) {
return 0;
@@ -998,7 +1011,6 @@ OENTRY* resolve_opcode(CSOUND* csound, OENTRIES* entries,
Str("Found %d inputs for %s which is more than "
"the %d allowed\n"),
argsRequired(inArgTypes), temp->opname, VARGMAX);
-
return temp;
}
}
@@ -1491,7 +1503,7 @@ int verify_opcode(CSOUND* csound, TREE* root, TYPE_TABLE* typeTable) {
if (UNLIKELY(oentry == NULL)) {
synterr(csound, Str("Unable to find opcode entry for \'%s\' "
- "with matching argument types:\n"),
+ "with matching argument types: \n"),
opcodeName);
csoundMessage(csound, Str("Found: %s %s %s\n"),
leftArgString, root->value->lexeme, rightArgString);
@@ -1706,7 +1718,7 @@ int verify_xin_xout(CSOUND *csound, TREE *udoTree, TYPE_TABLE *typeTable) {
for (i = 0; i < strlen(outArgs);i++) {
if (outArgs[i] == 'K') {
- outArgs[i] = 'k';
+ outArgs[i] = 'K';
}
}
diff --git a/Engine/csound_type_system.c b/Engine/csound_type_system.c
index a131d37..755170a 100644
--- a/Engine/csound_type_system.c
+++ b/Engine/csound_type_system.c
@@ -297,14 +297,14 @@ void deleteVarPoolMemory(void* csnd, CS_VAR_POOL* pool) {
void initializeVarPool(void *csound, MYFLT* memBlock, CS_VAR_POOL* pool) {
CS_VARIABLE* current = pool->head;
- int varNum = 1;
+ //int varNum = 1;
while (current != NULL) {
if (current->initializeVariableMemory != NULL) {
current->initializeVariableMemory(csound, current,
memBlock + current->memBlockIndex);
}
- varNum++;
+ //x varNum++;
current = current->next;
}
}
diff --git a/Engine/insert.c b/Engine/insert.c
index a7ace1e..7b44d90 100644
--- a/Engine/insert.c
+++ b/Engine/insert.c
@@ -1620,24 +1620,26 @@ int xoutset(CSOUND *csound, XOUT *p)
CS_VARIABLE* current;
int i;
+
+
(void) csound;
buf = (OPCOD_IOBUFS*) p->h.insdshead->opcod_iobufs;
inm = buf->opcode_info;
+
bufs = ((UOPCODE*) buf->uopcode_struct)->ar;
tmp = buf->iobufp_ptrs; // this is used to record the UDO's internal vars
// for copying at perf-time
current = inm->out_arg_pool->head;
for (i = 0; i < inm->outchns; i++) {
- void* in = (void*)p->args[i];
+ void* in = (void*) p->args[i];
void* out = (void*)bufs[i];
tmp[i] = in;
// DO NOT COPY K or A vars
// Fsigs need to be copied for initialization purposes.
- if (csoundGetTypeForArg(in) != &CS_VAR_TYPE_K &&
- /*csoundGetTypeForArg(in) != &CS_VAR_TYPE_F &&*/
- csoundGetTypeForArg(in) != &CS_VAR_TYPE_A)
+ if (inm->outtypes[i] != 'k' && csoundGetTypeForArg(in) != &CS_VAR_TYPE_A)
current->varType->copyValue(csound, out, in);
+ //printf("%c \n", inm->outtypes[i]);
current = current->next;
}
diff --git a/Engine/symbtab.c b/Engine/symbtab.c
index 3469946..7281335 100644
--- a/Engine/symbtab.c
+++ b/Engine/symbtab.c
@@ -254,7 +254,7 @@ static char map_udo_in_arg_type(char in) {
static char map_udo_out_arg_type(char in) {
if (in == 'K') {
- return 'k';
+ return 'K';
}
return in;
}
@@ -419,12 +419,13 @@ static int parse_opcode_args(CSOUND *csound, OENTRY *opc)
} else {
char c = map_udo_out_arg_type(*out_arg);
// printf("found arg type %s -> %c\n", out_arg, c);
- typeSpecifier[0] = c;
+ typeSpecifier[0] = c != 'K' ? c : 'k';
+
CS_TYPE* type =
csoundGetTypeWithVarTypeName(csound->typePool, typeSpecifier);
if (UNLIKELY(type == NULL)) {
- synterr(csound, Str("invalid output type for opcode %s"), out_arg);
+ synterr(csound, Str("=invalid output type for opcode %s"), out_arg);
err++;
continue;
}
@@ -488,6 +489,7 @@ early_exit:
}
csound->Free(csound, out_args);
}
+
return err;
}
@@ -574,8 +576,9 @@ int add_udo_definition(CSOUND *csound, char *opname,
/* store the name in a linked list (note: must use csound->Calloc) */
inm = (OPCODINFO *) csound->Calloc(csound, sizeof(OPCODINFO));
inm->name = cs_strdup(csound, opname);
- inm->intypes = intypes;
- inm->outtypes = outtypes;
+ inm->intypes = cs_strdup(csound, intypes);
+ inm->outtypes = cs_strdup(csound, outtypes);
+
inm->in_arg_pool = csoundCreateVarPool(csound);
inm->out_arg_pool = csoundCreateVarPool(csound);
diff --git a/Opcodes/ftsamplebank.cpp b/Opcodes/ftsamplebank.cpp
index 83eaa3d..fc44f31 100644
--- a/Opcodes/ftsamplebank.cpp
+++ b/Opcodes/ftsamplebank.cpp
@@ -284,7 +284,7 @@ std::vector<std::string> searchDir(CSOUND *csound, char *directory,
if (directory) {
DIR *dir = opendir(directory);
std::string fileExtension(extension);
- int noOfFiles = 0;
+ //int noOfFiles = 0;
// check for valid path first
if (dir) {
@@ -306,7 +306,7 @@ std::vector<std::string> searchDir(CSOUND *csound, char *directory,
} else
fullFileName << ent->d_name;
- noOfFiles++;
+ //noOfFiles++;
fileNames.push_back(fullFileName.str());
}
}
diff --git a/Opcodes/sfont.c b/Opcodes/sfont.c
index d711dc1..362a79b 100644
--- a/Opcodes/sfont.c
+++ b/Opcodes/sfont.c
@@ -542,7 +542,7 @@ static int32_t SfPlay(CSOUND *csound, SFPLAY *p)
double *sampinc = p->si, *phs = p->phs;
MYFLT *left= p->leftlevel, *right= p->rightlevel, *attack = p->attack,
*decr = p->decr, *decay = p->decay, *sustain= p->sustain,
- *release = p->release, *attr = p->attr;
+ /* *release = p->release,*/ *attr = p->attr;
memset(out1, 0, nsmps*sizeof(MYFLT));
@@ -573,7 +573,7 @@ static int32_t SfPlay(CSOUND *csound, SFPLAY *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
left++; right++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
else {
@@ -598,7 +598,7 @@ static int32_t SfPlay(CSOUND *csound, SFPLAY *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
left++; right++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
if (IS_ASIG_ARG(p->xamp)) {
@@ -633,7 +633,7 @@ static int32_t SfPlay3(CSOUND *csound, SFPLAY *p)
double *sampinc = p->si, *phs = p->phs;
MYFLT *left= p->leftlevel, *right= p->rightlevel, *attack = p->attack,
*decr = p->decr, *decay = p->decay, *sustain= p->sustain,
- *release = p->release, *attr = p->attr;
+ /**release = p->release,*/ *attr = p->attr;
memset(out1, 0, nsmps*sizeof(MYFLT));
memset(out2, 0, nsmps*sizeof(MYFLT));
@@ -663,7 +663,7 @@ static int32_t SfPlay3(CSOUND *csound, SFPLAY *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
left++; right++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
else {
@@ -687,7 +687,7 @@ static int32_t SfPlay3(CSOUND *csound, SFPLAY *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
left++; right++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
@@ -818,7 +818,7 @@ static int32_t SfPlayMono(CSOUND *csound, SFPLAYMONO *p)
SHORT *mode = p->mode;
double *sampinc = p->si, *phs = p->phs;
MYFLT *attenuation = p->attenuation, *attack = p->attack, *decr = p->decr,
- *decay = p->decay, *sustain= p->sustain, *release = p->release,
+ *decay = p->decay, *sustain= p->sustain, /**release = p->release,*/
*attr = p->attr;
memset(out1, 0, nsmps*sizeof(MYFLT));
@@ -848,7 +848,7 @@ static int32_t SfPlayMono(CSOUND *csound, SFPLAYMONO *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
attenuation++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
else {
@@ -873,7 +873,7 @@ static int32_t SfPlayMono(CSOUND *csound, SFPLAYMONO *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
attenuation++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
if (IS_ASIG_ARG(p->xamp)) {
@@ -905,7 +905,7 @@ static int32_t SfPlayMono3(CSOUND *csound, SFPLAYMONO *p)
SHORT *mode = p->mode;
double *sampinc = p->si, *phs = p->phs;
MYFLT *attenuation = p->attenuation,*attack = p->attack, *decr = p->decr,
- *decay = p->decay, *sustain= p->sustain, *release = p->release,
+ *decay = p->decay, *sustain= p->sustain, /**release = p->release,*/
*attr = p->attr;
memset(out1, 0, nsmps*sizeof(MYFLT));
@@ -934,7 +934,7 @@ static int32_t SfPlayMono3(CSOUND *csound, SFPLAYMONO *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
attenuation++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
else {
@@ -959,7 +959,7 @@ static int32_t SfPlayMono3(CSOUND *csound, SFPLAYMONO *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
attenuation++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
if (IS_ASIG_ARG(p->xamp)) {
@@ -1083,7 +1083,7 @@ static int32_t SfInstrPlay(CSOUND *csound, SFIPLAY *p)
double *sampinc = p->si, *phs = p->phs;
MYFLT *left= p->leftlevel, *right= p->rightlevel, *attack = p->attack,
*decr = p->decr, *decay = p->decay, *sustain= p->sustain,
- *release = p->release, *attr = p->attr;
+ /**release = p->release,*/ *attr = p->attr;
memset(out1, 0, nsmps*sizeof(MYFLT));
memset(out2, 0, nsmps*sizeof(MYFLT));
@@ -1113,7 +1113,7 @@ static int32_t SfInstrPlay(CSOUND *csound, SFIPLAY *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
left++; right++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
else {
@@ -1138,7 +1138,7 @@ static int32_t SfInstrPlay(CSOUND *csound, SFIPLAY *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
left++; right++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
@@ -1174,7 +1174,7 @@ static int32_t SfInstrPlay3(CSOUND *csound, SFIPLAY *p)
double *sampinc = p->si, *phs = p->phs;
MYFLT *left= p->leftlevel, *right= p->rightlevel,
*attack = p->attack, *decr = p->decr,
- *decay = p->decay, *sustain= p->sustain, *release = p->release,
+ *decay = p->decay, *sustain= p->sustain, /**release = p->release,*/
*attr = p->attr;
memset(out1, 0, nsmps*sizeof(MYFLT));
@@ -1205,7 +1205,7 @@ static int32_t SfInstrPlay3(CSOUND *csound, SFIPLAY *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
left++; right++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
else {
@@ -1230,7 +1230,7 @@ static int32_t SfInstrPlay3(CSOUND *csound, SFIPLAY *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
left++; right++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
@@ -1350,7 +1350,7 @@ static int32_t SfInstrPlayMono(CSOUND *csound, SFIPLAYMONO *p)
double *sampinc = p->si, *phs = p->phs;
MYFLT *attenuation = p->attenuation, *attack = p->attack, *decr = p->decr,
- *decay = p->decay, *sustain= p->sustain, *release = p->release,
+ *decay = p->decay, *sustain= p->sustain, /**release = p->release,*/
*attr = p->attr;
memset(out1, 0, nsmps*sizeof(MYFLT));
@@ -1380,7 +1380,7 @@ static int32_t SfInstrPlayMono(CSOUND *csound, SFIPLAYMONO *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
attenuation++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
else {
@@ -1405,7 +1405,7 @@ static int32_t SfInstrPlayMono(CSOUND *csound, SFIPLAYMONO *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
attenuation++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
if (IS_ASIG_ARG(p->xamp)) {
@@ -1437,7 +1437,7 @@ static int32_t SfInstrPlayMono3(CSOUND *csound, SFIPLAYMONO *p)
SHORT *mode = p->mode;
double *sampinc = p->si, *phs = p->phs;
MYFLT *attenuation = p->attenuation,*attack = p->attack, *decr = p->decr,
- *decay = p->decay, *sustain= p->sustain, *release = p->release,
+ *decay = p->decay, *sustain= p->sustain, /**release = p->release,*/
*attr = p->attr;
memset(out1, 0, nsmps*sizeof(MYFLT));
@@ -1467,7 +1467,7 @@ static int32_t SfInstrPlayMono3(CSOUND *csound, SFIPLAYMONO *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
attenuation++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
else {
@@ -1492,7 +1492,7 @@ static int32_t SfInstrPlayMono3(CSOUND *csound, SFIPLAYMONO *p)
}
phs++; base++; sampinc++; endloop++; startloop++;
attenuation++, mode++, end++; attack++; decay++; sustain++;
- release++; tinc++; env++; attr++; decr++;
+ /*release++;*/ tinc++; env++; attr++; decr++;
}
}
if (IS_ASIG_ARG(p->xamp)) {
diff --git a/interfaces/CsoundFile.cpp b/interfaces/CsoundFile.cpp
index 85a2d7b..6fcbd19 100644
--- a/interfaces/CsoundFile.cpp
+++ b/interfaces/CsoundFile.cpp
@@ -846,7 +846,7 @@ bool CsoundFile::getInstrument(int number, std::string &definition_) const
{
int beginDefinition = 0;
int endDefinition = 0;
- for(int index = 0; true; index++)
+ for(; true;)
{
beginDefinition = findToken(orchestra, "instr", beginDefinition);
if(beginDefinition == -1)
@@ -921,7 +921,7 @@ std::map<int, std::string> CsoundFile::getInstrumentNames() const
std::map<int, std::string> instrumentNames;
int beginDefinition = 0;
int endDefinition = 0;
- for(int index = 0; true; index++)
+ while(true)
{
beginDefinition = findToken(orchestra, "instr", beginDefinition);
if(beginDefinition == -1)
diff --git a/util/atsa.c b/util/atsa.c
index 30a138f..803f4c0 100644
--- a/util/atsa.c
+++ b/util/atsa.c
@@ -1801,7 +1801,7 @@ static void compute_residual(CSOUND *csound, mus_sample_t **fil,
ATS_SOUND *sound, int *win_samps,
int file_sampling_rate)
{
- int i, frm, frm_1, frm_2, par, frames, partials, frm_samps, out_smp = 0;
+ int i, frm, frm_1, frm_2, par, frames, partials, frm_samps;
double *in_buff, *synth_buff, mag, a1, a2, f1, f2, p1, p2, diff, synth;
mus_sample_t **obuf;
SF_INFO sfinfo;
@@ -1885,7 +1885,6 @@ static void compute_residual(CSOUND *csound, mus_sample_t **fil,
diff = in_buff[i] - synth;
obuf[0][i] = (mus_sample_t) diff;
obuf[1][i] = (mus_sample_t) synth;
- out_smp++;
}
atsa_sound_write_noninterleaved(sf, obuf, 2, frm_samps);
}
diff --git a/util/hetro.c b/util/hetro.c
index 57c24aa..70c5cf7 100644
--- a/util/hetro.c
+++ b/util/hetro.c
@@ -677,7 +677,7 @@ static int32_t filedump(HET *t, CSOUND *csound)
for (h = 0; h < t->hmax; h++) {
int16 *mp = magout, *fp = frqout;
int16 *lastmag, *lastfrq, pkamp = 0;
- int32_t mpoints, fpoints, contig = 0;
+ int32_t mpoints, fpoints/*, contig = 0*/;
*mp++ = -1; /* set brkpoint type codes */
*fp++ = -2;
lastmag = mp;
@@ -710,7 +710,7 @@ static int32_t filedump(HET *t, CSOUND *csound)
*fp++ = frq;
lastmag = mp; /* record last significant seg */
lastfrq = fp;
- contig++;
+ //contig++;
}
else {
if (mp > lastmag) { /* for non-significant segments */
@@ -721,7 +721,7 @@ static int32_t filedump(HET *t, CSOUND *csound)
*mp++ = 0;
*fp++ = tim;
*fp++ = frq;
- contig = 0;
+ //contig = 0;
}
}
if (lastmag < mp) { /* if last signif not last point */
|