Showing the changes to Spectacle/Spectacle.cpp (1 of 15 files). Show all
Unified · Split
| @@ -502,6 +502,8 @@ CK_DLL_QUERY( Spectacle ) · 501 unmodified lines | |||
| 502 | QUERY->add_ctor(QUERY, spectacle_ctor); | 502 | QUERY->add_ctor(QUERY, spectacle_ctor); |
| 503 | // register the destructor (probably no need to change) | 503 | // register the destructor (probably no need to change) |
| 504 | QUERY->add_dtor(QUERY, spectacle_dtor); | 504 | QUERY->add_dtor(QUERY, spectacle_dtor); |
| 505 | |||
| 506 | QUERY->doc_class(QUERY, "FFT-based spectral delay and EQ by John Gibson. Inspired by the totally awesome Spektral Delay plug-in by Native Instruments."); | ||
| 505 | 507 | ||
| 506 | // for UGen's only: add tick function | 508 | // for UGen's only: add tick function |
| 507 | QUERY->add_ugen_funcf(QUERY, spectacle_tick, NULL, 2, 2); | 509 | QUERY->add_ugen_funcf(QUERY, spectacle_tick, NULL, 2, 2); |
| @@ -512,113 +514,139 @@ CK_DLL_QUERY( Spectacle ) · 4 unmodified lines | |||
| 512 | 514 | ||
| 513 | // example of adding setter method | 515 | // example of adding setter method |
| 514 | QUERY->add_mfun(QUERY, spectacle_clear, "void", "clear"); | 516 | QUERY->add_mfun(QUERY, spectacle_clear, "void", "clear"); |
| 517 | QUERY->doc_func(QUERY, "Reset Spectacle."); | ||
| 515 | 518 | ||
| 516 | // example of adding setter method | 519 | // example of adding setter method |
| 517 | QUERY->add_mfun(QUERY, spectacle_setHold, "int", "hold"); | 520 | QUERY->add_mfun(QUERY, spectacle_setHold, "int", "hold"); |
| 518 | // example of adding argument to the above method | 521 | // example of adding argument to the above method |
| 519 | QUERY->add_arg(QUERY, "int", "arg"); | 522 | QUERY->add_arg(QUERY, "int", "arg"); |
| 523 | QUERY->doc_func(QUERY, "Set hold. True to suppress input, false disables."); | ||
| 520 | 524 | ||
| 521 | // example of adding setter method | 525 | // example of adding setter method |
| 522 | QUERY->add_mfun(QUERY, spectacle_getHold, "int", "hold"); | 526 | QUERY->add_mfun(QUERY, spectacle_getHold, "int", "hold"); |
| 527 | QUERY->doc_func(QUERY, "Get hold. True to suppress input, false disables."); | ||
| 523 | 528 | ||
| 524 | // example of adding setter method | 529 | // example of adding setter method |
| 525 | QUERY->add_mfun(QUERY, spectacle_setPostEQ, "int", "posteq"); | 530 | QUERY->add_mfun(QUERY, spectacle_setPostEQ, "int", "posteq"); |
| 526 | // example of adding argument to the above method | 531 | // example of adding argument to the above method |
| 527 | QUERY->add_arg(QUERY, "int", "arg"); | 532 | QUERY->add_arg(QUERY, "int", "arg"); |
| 533 | QUERY->doc_func(QUERY, "Set posteq to true to apply EQ after delay, rather than before."); | ||
| 528 | 534 | ||
| 529 | // example of adding setter method | 535 | // example of adding setter method |
| 530 | QUERY->add_mfun(QUERY, spectacle_getPostEQ, "int", "posteq"); | 536 | QUERY->add_mfun(QUERY, spectacle_getPostEQ, "int", "posteq"); |
| 537 | QUERY->doc_func(QUERY, "Get posteq. True applies EQ after delay, rather than before."); | ||
| 531 | 538 | ||
| 532 | // example of adding setter method | 539 | // example of adding setter method |
| 533 | QUERY->add_mfun(QUERY, spectacle_setFFTlen, "int", "fftlen"); | 540 | QUERY->add_mfun(QUERY, spectacle_setFFTlen, "int", "fftlen"); |
| 534 | // example of adding argument to the above method | 541 | // example of adding argument to the above method |
| 535 | QUERY->add_arg(QUERY, "int", "arg"); | 542 | QUERY->add_arg(QUERY, "int", "arg"); |
| 543 | QUERY->doc_func(QUERY, "Set FFT frame size (power of 2)."); | ||
| 536 | 544 | ||
| 537 | // example of adding setter method | 545 | // example of adding setter method |
| 538 | QUERY->add_mfun(QUERY, spectacle_getFFTlen, "int", "fftlen"); | 546 | QUERY->add_mfun(QUERY, spectacle_getFFTlen, "int", "fftlen"); |
| 547 | QUERY->doc_func(QUERY, "Get FFT frame size (power of 2)."); | ||
| 539 | 548 | ||
| 540 | // example of adding setter method | 549 | // example of adding setter method |
| 541 | QUERY->add_mfun(QUERY, spectacle_setOverlap, "int", "overlap"); | 550 | QUERY->add_mfun(QUERY, spectacle_setOverlap, "int", "overlap"); |
| 542 | // example of adding argument to the above method | 551 | // example of adding argument to the above method |
| 543 | QUERY->add_arg(QUERY, "int", "arg"); | 552 | QUERY->add_arg(QUERY, "int", "arg"); |
| 553 | QUERY->doc_func(QUERY, "Set frame overlap; best between 2 and 6."); | ||
| 544 | 554 | ||
| 545 | // example of adding setter method | 555 | // example of adding setter method |
| 546 | QUERY->add_mfun(QUERY, spectacle_getOverlap, "int", "overlap"); | 556 | QUERY->add_mfun(QUERY, spectacle_getOverlap, "int", "overlap"); |
| 557 | QUERY->doc_func(QUERY, "Get frame overlap; best between 2 and 6."); | ||
| 547 | 558 | ||
| 548 | // example of adding setter method | 559 | // example of adding setter method |
| 549 | QUERY->add_mfun(QUERY, spectacle_setMaxDelay, "dur", "delayMax"); | 560 | QUERY->add_mfun(QUERY, spectacle_setMaxDelay, "dur", "delayMax"); |
| 550 | // example of adding argument to the above method | 561 | // example of adding argument to the above method |
| 551 | QUERY->add_arg(QUERY, "dur", "delay"); | 562 | QUERY->add_arg(QUERY, "dur", "delay"); |
| 563 | QUERY->doc_func(QUERY, "Set maximum delay time."); | ||
| 552 | 564 | ||
| 553 | // example of adding setter method | 565 | // example of adding setter method |
| 554 | QUERY->add_mfun(QUERY, spectacle_getMaxDelay, "dur", "delayMax"); | 566 | QUERY->add_mfun(QUERY, spectacle_getMaxDelay, "dur", "delayMax"); |
| 567 | QUERY->doc_func(QUERY, "Get maximum delay time."); | ||
| 555 | 568 | ||
| 556 | // example of adding setter method | 569 | // example of adding setter method |
| 557 | QUERY->add_mfun(QUERY, spectacle_setMinDelay, "dur", "delayMin"); | 570 | QUERY->add_mfun(QUERY, spectacle_setMinDelay, "dur", "delayMin"); |
| 558 | // example of adding argument to the above method | 571 | // example of adding argument to the above method |
| 559 | QUERY->add_arg(QUERY, "dur", "delay"); | 572 | QUERY->add_arg(QUERY, "dur", "delay"); |
| 573 | QUERY->doc_func(QUERY, "Set minimum delay time."); | ||
| 560 | 574 | ||
| 561 | // example of adding setter method | 575 | // example of adding getter method |
| 562 | QUERY->add_mfun(QUERY, spectacle_getMinDelay, "dur", "delayMin"); | 576 | QUERY->add_mfun(QUERY, spectacle_getMinDelay, "dur", "delayMin"); |
| 577 | QUERY->doc_func(QUERY, "Get minimum delay time."); | ||
| 563 | 578 | ||
| 564 | // example of adding setter method | 579 | // example of adding setter method |
| 565 | QUERY->add_mfun(QUERY, spectacle_setMinFreq, "float", "freqMin"); | 580 | QUERY->add_mfun(QUERY, spectacle_setMinFreq, "float", "freqMin"); |
| 566 | // example of adding argument to the above method | 581 | // example of adding argument to the above method |
| 567 | QUERY->add_arg(QUERY, "float", "arg"); | 582 | QUERY->add_arg(QUERY, "float", "arg"); |
| 583 | QUERY->doc_func(QUERY, "Set minimum frequency processed by Spectacle."); | ||
| 568 | 584 | ||
| 569 | // example of adding getter method | 585 | // example of adding getter method |
| 570 | QUERY->add_mfun(QUERY, spectacle_getMinFreq, "float", "freqMin"); | 586 | QUERY->add_mfun(QUERY, spectacle_getMinFreq, "float", "freqMin"); |
| 587 | QUERY->doc_func(QUERY, "Get minimum frequency processed by Spectacle."); | ||
| 571 | 588 | ||
| 572 | // example of adding setter method | 589 | // example of adding setter method |
| 573 | QUERY->add_mfun(QUERY, spectacle_setMaxFreq, "float", "freqMax"); | 590 | QUERY->add_mfun(QUERY, spectacle_setMaxFreq, "float", "freqMax"); |
| 574 | // example of adding argument to the above method | 591 | // example of adding argument to the above method |
| 575 | QUERY->add_arg(QUERY, "float", "arg"); | 592 | QUERY->add_arg(QUERY, "float", "arg"); |
| 593 | QUERY->doc_func(QUERY, "Set maximum frequency processed by Spectacle."); | ||
| 576 | 594 | ||
| 577 | // example of adding getter method | 595 | // example of adding getter method |
| 578 | QUERY->add_mfun(QUERY, spectacle_getMaxFreq, "float", "freqMax"); | 596 | QUERY->add_mfun(QUERY, spectacle_getMaxFreq, "float", "freqMax"); |
| 597 | QUERY->doc_func(QUERY, "Get maximum frequency processed by Spectacle."); | ||
| 579 | 598 | ||
| 580 | // example of adding setter method | 599 | // example of adding setter method |
| 581 | QUERY->add_mfun(QUERY, spectacle_setMix, "float", "mix"); | 600 | QUERY->add_mfun(QUERY, spectacle_setMix, "float", "mix"); |
| 582 | // example of adding argument to the above method | 601 | // example of adding argument to the above method |
| 583 | QUERY->add_arg(QUERY, "float", "mix"); | 602 | QUERY->add_arg(QUERY, "float", "mix"); |
| 603 | QUERY->doc_func(QUERY, "Set mix of processed and unprocessed signal [0 - 1]."); | ||
| 584 | 604 | ||
| 585 | // example of adding getter method | 605 | // example of adding getter method |
| 586 | QUERY->add_mfun(QUERY, spectacle_getMix, "float", "mix"); | 606 | QUERY->add_mfun(QUERY, spectacle_getMix, "float", "mix"); |
| 607 | QUERY->doc_func(QUERY, "Get mix of processed and unprocessed signal [0 - 1]."); | ||
| 587 | 608 | ||
| 588 | // example of adding setter method | 609 | // example of adding setter method |
| 589 | QUERY->add_mfun(QUERY, spectacle_setFreqRange, "void", "range"); | 610 | QUERY->add_mfun(QUERY, spectacle_setFreqRange, "void", "range"); |
| 590 | // example of adding argument to the above method | 611 | // example of adding argument to the above method |
| 591 | QUERY->add_arg(QUERY, "float", "arg1"); | 612 | QUERY->add_arg(QUERY, "float", "arg1"); |
| 592 | QUERY->add_arg(QUERY, "float", "arg2"); | 613 | QUERY->add_arg(QUERY, "float", "arg2"); |
| 614 | QUERY->doc_func(QUERY, "Set both min and max freqs in one command."); | ||
| 593 | 615 | ||
| 594 | // example of adding setter method | 616 | // example of adding setter method |
| 595 | QUERY->add_mfun(QUERY, spectacle_setTableLen, "int", "bands"); | 617 | QUERY->add_mfun(QUERY, spectacle_setTableLen, "int", "bands"); |
| 596 | // example of adding argument to the above method | 618 | // example of adding argument to the above method |
| 597 | QUERY->add_arg(QUERY, "int", "arg"); | 619 | QUERY->add_arg(QUERY, "int", "arg"); |
| 620 | QUERY->doc_func(QUERY, "Set number of frequency bands, [1 - 512], default 64"); | ||
| 598 | 621 | ||
| 599 | // example of adding setter method | 622 | // example of adding setter method |
| 600 | QUERY->add_mfun(QUERY, spectacle_getTableLen, "int", "bands"); | 623 | QUERY->add_mfun(QUERY, spectacle_getTableLen, "int", "bands"); |
| 624 | QUERY->doc_func(QUERY, "Get number of frequency bands, [1 - 512], default 64"); | ||
| 601 | 625 | ||
| 602 | // example of adding setter method | 626 | // example of adding setter method |
| 603 | QUERY->add_mfun(QUERY, spectacle_setTable, "int", "table"); | 627 | QUERY->add_mfun(QUERY, spectacle_setTable, "int", "table"); |
| 604 | // example of adding argument to the above method | 628 | // example of adding argument to the above method |
| 605 | QUERY->add_arg(QUERY, "string", "table"); | 629 | QUERY->add_arg(QUERY, "string", "table"); |
| 606 | QUERY->add_arg(QUERY, "string", "type"); | 630 | QUERY->add_arg(QUERY, "string", "type"); |
| 631 | QUERY->doc_func(QUERY, "Set \"delay\", “eq”, or \"feedback\" tables to the types \"random\", \"ascending\", or \"descending.\" Example: table(\"delay\", \"random\");"); | ||
| 607 | 632 | ||
| 608 | // example of adding setter method | 633 | // example of adding setter method |
| 609 | QUERY->add_mfun(QUERY, spectacle_setDelay, "dur", "delay"); | 634 | QUERY->add_mfun(QUERY, spectacle_setDelay, "dur", "delay"); |
| 610 | // example of adding argument to the above method | 635 | // example of adding argument to the above method |
| 611 | QUERY->add_arg(QUERY, "dur", "delay"); | 636 | QUERY->add_arg(QUERY, "dur", "delay"); |
| 637 | QUERY->doc_func(QUERY, "Set the same delay duration for all bands."); | ||
| 612 | 638 | ||
| 613 | // example of adding setter method | 639 | // example of adding setter method |
| 614 | QUERY->add_mfun(QUERY, spectacle_setEQ, "float", "eq"); | 640 | QUERY->add_mfun(QUERY, spectacle_setEQ, "float", "eq"); |
| 615 | // example of adding argument to the above method | 641 | // example of adding argument to the above method |
| 616 | QUERY->add_arg(QUERY, "float", "eq"); | 642 | QUERY->add_arg(QUERY, "float", "eq"); |
| 643 | QUERY->doc_func(QUERY, "Set the same EQ value for all bands (value is +/- dB)."); | ||
| 617 | 644 | ||
| 618 | // example of adding setter method | 645 | // example of adding setter method |
| 619 | QUERY->add_mfun(QUERY, spectacle_setFB, "float", "feedback"); | 646 | QUERY->add_mfun(QUERY, spectacle_setFB, "float", "feedback"); |
| 620 | // example of adding argument to the above method | 647 | // example of adding argument to the above method |
| 621 | QUERY->add_arg(QUERY, "float", "feedback"); | 648 | QUERY->add_arg(QUERY, "float", "feedback"); |
| 649 | QUERY->doc_func(QUERY, "Set the same feedback value for all bands [-1.0 - 1.0]."); | ||
| 622 | 650 | ||
| 623 | // this reserves a variable in the ChucK internal class to store | 651 | // this reserves a variable in the ChucK internal class to store |
| 624 | // referene to the c++ class we defined above | 652 | // referene to the c++ class we defined above |