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 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../../img/favicon.ico">
<title> misceffects - Faust Libraries</title>
<link href="../../css/bootstrap.min.css" rel="stylesheet">
<link href="../../css/font-awesome.min.css" rel="stylesheet">
<link href="../../css/base.css" rel="stylesheet">
<link rel="stylesheet" href="/usr/share/javascript/highlight.js/styles/github.css">
<link href="../../css/extra.css" rel="stylesheet">
<script src="../../js/jquery-3.6.0.min.js" defer></script>
<script src="../../js/bootstrap.min.js" defer></script>
<script src="/usr/share/javascript/highlight.js/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<div class="navbar fixed-top navbar-expand-lg navbar-dark bg-primary">
<div class="container">
<a class="navbar-brand" href="../.."><img src="../../img/faustText.svg" width="150px"> </a>
<!-- Expander button -->
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar-collapse">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Expanded navigation -->
<div id="navbar-collapse" class="navbar-collapse collapse">
<!-- Main navigation -->
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Overview <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="../../organization/" class="dropdown-item"> Organization </a>
</li>
<li>
<a href="../../standardFunctions/" class="dropdown-item"> Standard Functions </a>
</li>
<li>
<a href="../../contributing/" class="dropdown-item"> Contributing </a>
</li>
<li>
<a href="../../community/" class="dropdown-item"> Community </a>
</li>
<li>
<a href="../../about/" class="dropdown-item"> Copyright/License </a>
</li>
</ul>
</li>
<li class="navitem">
<a href="../" class="nav-link">Index</a>
</li>
<li class="dropdown active">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">Libraries <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="../aanl/" class="dropdown-item"> antialiased </a>
</li>
<li>
<a href="../analyzers/" class="dropdown-item"> analyzers </a>
</li>
<li>
<a href="../basics/" class="dropdown-item"> basics </a>
</li>
<li>
<a href="../compressors/" class="dropdown-item"> compressors </a>
</li>
<li>
<a href="../delays/" class="dropdown-item"> delays </a>
</li>
<li>
<a href="../demos/" class="dropdown-item"> demos </a>
</li>
<li>
<a href="../dx7/dx7/" class="dropdown-item"> dx7/dx7 </a>
</li>
<li>
<a href="../dx7/env/" class="dropdown-item"> dx7/env </a>
</li>
<li>
<a href="../dx7/lfo/" class="dropdown-item"> dx7/lfo </a>
</li>
<li>
<a href="../dx7/operator/" class="dropdown-item"> dx7/operator </a>
</li>
<li>
<a href="../dx7/pitchenv/" class="dropdown-item"> dx7/pitchenv </a>
</li>
<li>
<a href="../envelopes/" class="dropdown-item"> envelopes </a>
</li>
<li>
<a href="../fds/" class="dropdown-item"> fds </a>
</li>
<li>
<a href="../filters/" class="dropdown-item"> filters </a>
</li>
<li>
<a href="../hoa/" class="dropdown-item"> hoa </a>
</li>
<li>
<a href="../interpolators/" class="dropdown-item"> interpolators </a>
</li>
<li>
<a href="../linearalgebra/" class="dropdown-item"> linearalgebra </a>
</li>
<li>
<a href="../maths/" class="dropdown-item"> maths </a>
</li>
<li>
<a href="../mi/" class="dropdown-item"> mi </a>
</li>
<li>
<a href="./" class="dropdown-item active"> misceffects </a>
</li>
<li>
<a href="../noises/" class="dropdown-item"> noises </a>
</li>
<li>
<a href="../oscillators/" class="dropdown-item"> oscillators </a>
</li>
<li>
<a href="../phaflangers/" class="dropdown-item"> phaflangers </a>
</li>
<li>
<a href="../physmodels/" class="dropdown-item"> physmodels </a>
</li>
<li>
<a href="../quantizers/" class="dropdown-item"> quantizers </a>
</li>
<li>
<a href="../reducemaps/" class="dropdown-item"> reducemaps </a>
</li>
<li>
<a href="../reverbs/" class="dropdown-item"> reverbs </a>
</li>
<li>
<a href="../routes/" class="dropdown-item"> routes </a>
</li>
<li>
<a href="../signals/" class="dropdown-item"> signals </a>
</li>
<li>
<a href="../soundfiles/" class="dropdown-item"> soundfiles </a>
</li>
<li>
<a href="../spats/" class="dropdown-item"> spats </a>
</li>
<li>
<a href="../synths/" class="dropdown-item"> synths </a>
</li>
<li>
<a href="../vaeffects/" class="dropdown-item"> vaeffects </a>
</li>
<li>
<a href="../version/" class="dropdown-item"> version </a>
</li>
<li>
<a href="../wdmodels/" class="dropdown-item"> wdmodels </a>
</li>
<li>
<a href="../webaudio/" class="dropdown-item"> webaudio </a>
</li>
</ul>
</li>
<li class="navitem">
<a href="../../about/" class="nav-link">About</a>
</li>
</ul>
<ul class="nav navbar-nav ml-auto">
<li class="nav-item">
<a href="#" class="nav-link" data-toggle="modal" data-target="#mkdocs_search_modal">
<i class="fa fa-search"></i> Search
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<div class="row"><div class="col-md-3"><div class="navbar-light navbar-expand-md bs-sidebar hidden-print affix" role="complementary">
<div class="navbar-header">
<button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target="#toc-collapse" title="Table of Contents">
<span class="fa fa-angle-down"></span>
</button>
</div>
<div id="toc-collapse" class="navbar-collapse collapse card bg-secondary">
<ul class="nav flex-column">
<li class="nav-item" data-level="1"><a href="#misceffectslib" class="nav-link">misceffects.lib</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="2"><a href="#dynamic" class="nav-link">Dynamic</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#efcubicnl" class="nav-link">(ef.)cubicnl</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efgate_mono" class="nav-link">(ef.)gate_mono</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efgate_stereo" class="nav-link">(ef.)gate_stereo</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#fibonacci" class="nav-link">Fibonacci</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#effibonacci" class="nav-link">(ef.)fibonacci</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#effibonaccigeneral" class="nav-link">(ef.)fibonacciGeneral</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#effibonacciseq" class="nav-link">(ef.)fibonacciSeq</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#filtering" class="nav-link">Filtering</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#efspeakerbp" class="nav-link">(ef.)speakerbp</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efpiano_dispersion_filter" class="nav-link">(ef.)piano_dispersion_filter</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efstereo_width" class="nav-link">(ef.)stereo_width</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#meshes" class="nav-link">Meshes</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#efmesh_square" class="nav-link">(ef.)mesh_square</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#mixing" class="nav-link">Mixing</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#efdrywetmixer" class="nav-link">(ef.)dryWetMixer</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efdrywetmixerconstantpower" class="nav-link">(ef.)dryWetMixerConstantPower</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efmixlinearclamp" class="nav-link">(ef.)mixLinearClamp</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efmixlinearloop" class="nav-link">(ef.)mixLinearLoop</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efmixpowerclamp" class="nav-link">(ef.)mixPowerClamp</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efmixpowerloop" class="nav-link">(ef.)mixPowerLoop</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#time-based" class="nav-link">Time Based</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#efecho" class="nav-link">(ef.)echo</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efreverseechon" class="nav-link">(ef.)reverseEchoN</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efreversedelayramped" class="nav-link">(ef.)reverseDelayRamped</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efuniformpantostereo" class="nav-link">(ef.)uniformPanToStereo</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#eftapestop" class="nav-link">(ef.)tapeStop</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#pitch-shifting" class="nav-link">Pitch Shifting</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#eftranspose" class="nav-link">(ef.)transpose</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-level="2"><a href="#saturators" class="nav-link">Saturators</a>
<ul class="nav flex-column">
<li class="nav-item" data-level="3"><a href="#efsoftclipquadratic" class="nav-link">(ef.)softclipQuadratic</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#efwavefold" class="nav-link">(ef.)wavefold</a>
<ul class="nav flex-column">
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div></div>
<div class="col-md-9 main-container" role="main">
<h1 id="misceffectslib">misceffects.lib</h1>
<p>Collection of audio effects library. Its official prefix is <code>ef</code>.</p>
<p>The library is organized into 7 sections:</p>
<ul>
<li><a href="#Dynamic">Dynamic</a></li>
<li><a href="#fibonacci">Fibonacci</a></li>
<li><a href="#filtering">Filtering</a></li>
<li><a href="#meshes">Meshes</a></li>
<li><a href="#mixing">Mixing</a></li>
<li><a href="#time-based">Time Based</a></li>
<li><a href="#pitch-shifting">Pitch Shifting</a></li>
<li><a href="#saturators">Saturators</a></li>
</ul>
<h4 id="references">References</h4>
<ul>
<li><a href="https://github.com/grame-cncm/faustlibraries/blob/master/misceffects.lib">https://github.com/grame-cncm/faustlibraries/blob/master/misceffects.lib</a></li>
</ul>
<h2 id="dynamic">Dynamic</h2>
<hr />
<h3 id="efcubicnl"><code>(ef.)cubicnl</code></h3>
<p>Cubic nonlinearity distortion.
<code>cubicnl</code> is a standard Faust function.</p>
<h4 id="usage">Usage:</h4>
<pre><code>_ : cubicnl(drive,offset) : _
_ : cubicnl_nodc(drive,offset) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>drive</code>: distortion amount, between 0 and 1</li>
<li><code>offset</code>: constant added before nonlinearity to give even harmonics. Note: offset
can introduce a nonzero mean - feed cubicnl output to dcblocker to remove this.</li>
</ul>
<h4 id="references_1">References:</h4>
<ul>
<li><a href="https://ccrma.stanford.edu/~jos/pasp/Cubic_Soft_Clipper.html">https://ccrma.stanford.edu/~jos/pasp/Cubic_Soft_Clipper.html</a></li>
<li><a href="https://ccrma.stanford.edu/~jos/pasp/Nonlinear_Distortion.html">https://ccrma.stanford.edu/~jos/pasp/Nonlinear_Distortion.html</a></li>
</ul>
<hr />
<h3 id="efgate_mono"><code>(ef.)gate_mono</code></h3>
<p>Mono signal gate.
<code>gate_mono</code> is a standard Faust function.</p>
<h4 id="usage_1">Usage</h4>
<pre><code>_ : gate_mono(thresh,att,hold,rel) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>thresh</code>: dB level threshold above which gate opens (e.g., -60 dB)</li>
<li><code>att</code>: attack time = time constant (sec) for gate to open (e.g., 0.0001 s = 0.1 ms)</li>
<li><code>hold</code>: hold time = time (sec) gate stays open after signal level < thresh (e.g., 0.1 s)</li>
<li><code>rel</code>: release time = time constant (sec) for gate to close (e.g., 0.020 s = 20 ms)</li>
</ul>
<h4 id="references_2">References</h4>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Noise_gate">http://en.wikipedia.org/wiki/Noise_gate</a></li>
<li><a href="http://www.soundonsound.com/sos/apr01/articles/advanced.asp">http://www.soundonsound.com/sos/apr01/articles/advanced.asp</a></li>
<li><a href="http://en.wikipedia.org/wiki/Gating_(sound_engineering)">http://en.wikipedia.org/wiki/Gating_(sound_engineering)</a></li>
</ul>
<hr />
<h3 id="efgate_stereo"><code>(ef.)gate_stereo</code></h3>
<p>Stereo signal gates.
<code>gate_stereo</code> is a standard Faust function.</p>
<h4 id="usage_2">Usage</h4>
<pre><code> _,_ : gate_stereo(thresh,att,hold,rel) : _,_
</code></pre>
<p>Where:</p>
<ul>
<li><code>thresh</code>: dB level threshold above which gate opens (e.g., -60 dB)</li>
<li><code>att</code>: attack time = time constant (sec) for gate to open (e.g., 0.0001 s = 0.1 ms)</li>
<li><code>hold</code>: hold time = time (sec) gate stays open after signal level < thresh (e.g., 0.1 s)</li>
<li><code>rel</code>: release time = time constant (sec) for gate to close (e.g., 0.020 s = 20 ms)</li>
</ul>
<h4 id="references_3">References</h4>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Noise_gate">http://en.wikipedia.org/wiki/Noise_gate</a></li>
<li><a href="http://www.soundonsound.com/sos/apr01/articles/advanced.asp">http://www.soundonsound.com/sos/apr01/articles/advanced.asp</a></li>
<li><a href="http://en.wikipedia.org/wiki/Gating_(sound_engineering)">http://en.wikipedia.org/wiki/Gating_(sound_engineering)</a></li>
</ul>
<h2 id="fibonacci">Fibonacci</h2>
<hr />
<h3 id="effibonacci"><code>(ef.)fibonacci</code></h3>
<p>Fibonacci system where the current output is the current
input plus the sum of the previous N outputs.</p>
<h4 id="usage_3">Usage</h4>
<pre><code>_ : fibonacci(N) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the Fibonacci system's order, where 2 is standard</li>
</ul>
<h4 id="example">Example</h4>
<p>Generate the famous series: [1, 1, 2, 3, 5, 8, 13, ...]</p>
<pre><code>1. : ba.impulsify : fibonacci(2)
</code></pre>
<hr />
<h3 id="effibonaccigeneral"><code>(ef.)fibonacciGeneral</code></h3>
<p>Fibonacci system with customizable coefficients.
The order of the system is inferred from the number of coefficients.</p>
<h4 id="usage_4">Usage</h4>
<pre><code>_ : fibonacciGeneral(wave) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>wave</code>: a waveform such as <code>waveform{1, 1}</code></li>
</ul>
<h4 id="example_1">Example:</h4>
<p>Use the update equation <code>y = 2*y' + 3*y'' + 4*y'''</code></p>
<pre><code>1. : ba.impulsify : fibonacciGeneral(waveform{2, 3, 4})
</code></pre>
<hr />
<h3 id="effibonacciseq"><code>(ef.)fibonacciSeq</code></h3>
<p>First N numbers of the Fibonacci sequence [1, 1, 2, 3, 5, 8, ...]
as parallel channels.</p>
<h4 id="usage_5">Usage</h4>
<pre><code>fibonacciSeq(N) : si.bus(N)
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: The number of Fibonacci numbers to generate as channels.</li>
</ul>
<h2 id="filtering">Filtering</h2>
<hr />
<h3 id="efspeakerbp"><code>(ef.)speakerbp</code></h3>
<p>Dirt-simple speaker simulator (overall bandpass eq with observed
roll-offs above and below the passband). <code>speakerbp</code> is a standard Faust function.</p>
<p>Low-frequency speaker model = +12 dB/octave slope breaking to
flat near f1. Implemented using two dc blockers in series.</p>
<p>High-frequency model = -24 dB/octave slope implemented using a
fourth-order Butterworth lowpass.</p>
<h4 id="usage_6">Usage</h4>
<pre><code>_ : speakerbp(f1,f2) : _
</code></pre>
<h4 id="example_2">Example</h4>
<p>Based on measured Celestion G12 (12" speaker):</p>
<pre><code>speakerbp(130,5000)
</code></pre>
<hr />
<h3 id="efpiano_dispersion_filter"><code>(ef.)piano_dispersion_filter</code></h3>
<p>Piano dispersion allpass filter in closed form.</p>
<h4 id="usage_7">Usage</h4>
<pre><code>piano_dispersion_filter(M,B,f0)
_ : piano_dispersion_filter(1,B,f0) : +(totalDelay),_ : fdelay(maxDelay) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>M</code>: number of first-order allpass sections (compile-time only)
Keep below 20. 8 is typical for medium-sized piano strings.</li>
<li><code>B</code>: string inharmonicity coefficient (0.0001 is typical)</li>
<li><code>f0</code>: fundamental frequency in Hz</li>
</ul>
<h4 id="outputs">Outputs</h4>
<ul>
<li>MINUS the estimated delay at <code>f0</code> of allpass chain in samples,
provided in negative form to facilitate subtraction
from delay-line length.</li>
<li>Output signal from allpass chain</li>
</ul>
<h4 id="reference">Reference</h4>
<ul>
<li>"Dispersion Modeling in Waveguide Piano Synthesis Using Tunable
Allpass Filters", by Jukka Rauhala and Vesa Valimaki, DAFX-2006, pp. 71-76</li>
<li><a href="http://lib.tkk.fi/Diss/2007/isbn9789512290666/article2.pdf">http://lib.tkk.fi/Diss/2007/isbn9789512290666/article2.pdf</a>
An erratum in Eq. (7) is corrected in Dr. Rauhala's encompassing
dissertation (and below).</li>
<li><a href="http://www.acoustics.hut.fi/research/asp/piano/">http://www.acoustics.hut.fi/research/asp/piano/</a></li>
</ul>
<hr />
<h3 id="efstereo_width"><code>(ef.)stereo_width</code></h3>
<p>Stereo Width effect using the Blumlein Shuffler technique.
<code>stereo_width</code> is a standard Faust function.</p>
<h4 id="usage_8">Usage</h4>
<pre><code>_,_ : stereo_width(w) : _,_
</code></pre>
<p>Where:</p>
<ul>
<li><code>w</code>: stereo width between 0 and 1</li>
</ul>
<p>At <code>w=0</code>, the output signal is mono ((left+right)/2 in both channels).
At <code>w=1</code>, there is no effect (original stereo image).
Thus, w between 0 and 1 varies stereo width from 0 to "original".</p>
<h4 id="reference_1">Reference</h4>
<ul>
<li>"Applications of Blumlein Shuffling to Stereo Microphone Techniques"
Michael A. Gerzon, JAES vol. 42, no. 6, June 1994</li>
</ul>
<h2 id="meshes">Meshes</h2>
<hr />
<h3 id="efmesh_square"><code>(ef.)mesh_square</code></h3>
<p>Square Rectangular Digital Waveguide Mesh.</p>
<h4 id="usage_9">Usage</h4>
<pre><code>bus(4*N) : mesh_square(N) : bus(4*N)
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: number of nodes along each edge - a power of two (1,2,4,8,...)</li>
</ul>
<h4 id="reference_2">Reference</h4>
<ul>
<li><a href="https://ccrma.stanford.edu/~jos/pasp/Digital_Waveguide_Mesh.html">https://ccrma.stanford.edu/~jos/pasp/Digital_Waveguide_Mesh.html</a></li>
</ul>
<h4 id="signal-order-in-and-out">Signal Order In and Out</h4>
<p>The mesh is constructed recursively using 2x2 embeddings. Thus,
the top level of <code>mesh_square(M)</code> is a block 2x2 mesh, where each
block is a <code>mesh(M/2)</code>. Let these blocks be numbered 1,2,3,4 in the
geometry NW,NE,SW,SE, i.e., as:</p>
<pre><code> 1 2
3 4
</code></pre>
<p>Each block has four vector inputs and four vector outputs, where the
length of each vector is <code>M/2</code>. Label the input vectors as Ni,Ei,Wi,Si,
i.e., as the inputs from the North, East South, and West,
and similarly for the outputs. Then, for example, the upper
left input block of M/2 signals is labeled 1Ni. Most of the
connections are internal, such as 1Eo -> 2Wi. The <code>8*(M/2)</code> input
signals are grouped in the order:</p>
<pre><code> 1Ni 2Ni
3Si 4Si
1Wi 3Wi
2Ei 4Ei
</code></pre>
<p>and the output signals are:</p>
<pre><code> 1No 1Wo
2No 2Eo
3So 3Wo
4So 4Eo
</code></pre>
<p>or:</p>
<pre><code> In: 1No 1Wo 2No 2Eo 3So 3Wo 4So 4Eo
Out: 1Ni 2Ni 3Si 4Si 1Wi 3Wi 2Ei 4Ei
</code></pre>
<p>Thus, the inputs are grouped by direction N,S,W,E, while the
outputs are grouped by block number 1,2,3,4, which can also be
interpreted as directions NW, NE, SW, SE. A simple program
illustrating these orderings is <code>process = mesh_square(2);</code>.</p>
<h4 id="example_3">Example</h4>
<p>Reflectively terminated mesh impulsed at one corner:</p>
<pre><code>mesh_square_test(N,x) = mesh_square(N)~(busi(4*N,x)) // input to corner
with {
busi(N,x) = bus(N) : par(i,N,*(-1)) : par(i,N-1,_), +(x);
};
process = 1-1' : mesh_square_test(4); // all modes excited forever
</code></pre>
<p>In this simple example, the mesh edges are connected as follows:</p>
<pre><code> 1No -> 1Ni, 1Wo -> 2Ni, 2No -> 3Si, 2Eo -> 4Si,
3So -> 1Wi, 3Wo -> 3Wi, 4So -> 2Ei, 4Eo -> 4Ei
</code></pre>
<p>A routing matrix can be used to obtain other connection geometries.</p>
<h2 id="mixing">Mixing</h2>
<hr />
<h3 id="efdrywetmixer"><code>(ef.)dryWetMixer</code></h3>
<p>Linear dry-wet mixer for a N inputs and N outputs effect.</p>
<h4 id="usage_10">Usage</h4>
<pre><code>si.bus(inputs(FX)) : dryWetMixer(wetAmount, FX) : si.bus(inputs(FX))
</code></pre>
<p>Where:</p>
<ul>
<li><code>wetAmount</code>: the wet amount (0-1). 0 produces only the dry signal and 1 produces only the wet signal</li>
<li><code>FX</code>: an arbitrary effect (N inputs and N outputs) to apply to the input bus</li>
</ul>
<hr />
<h3 id="efdrywetmixerconstantpower"><code>(ef.)dryWetMixerConstantPower</code></h3>
<p>Constant-power dry-wet mixer for a N inputs and N outputs effect.</p>
<h4 id="usage_11">Usage</h4>
<pre><code>si.bus(inputs(FX)) : dryWetMixerConstantPower(wetAmount, FX) :si.bus(inputs(FX))
</code></pre>
<p>Where:</p>
<ul>
<li><code>wetAmount</code>: the wet amount (0-1). 0 produces only the dry signal and 1 produces only the wet signal</li>
<li><code>FX</code>: an arbitrary effect (N inputs and N outputs) to apply to the input bus</li>
</ul>
<hr />
<h3 id="efmixlinearclamp"><code>(ef.)mixLinearClamp</code></h3>
<p>Linear mixer for <code>N</code> buses, each with <code>C</code> channels. The output will be a sum of 2 buses
determined by the mixing index <code>mix</code>. 0 produces the first bus, 1 produces the
second, and so on. <code>mix</code> is clamped automatically. For example, <code>mixLinearClamp(4, 1, 1)</code>
will weight its 4 inputs by <code>(0, 1, 0, 0)</code>. Similarly, <code>mixLinearClamp(4, 1, 1.1)</code>
will weight its 4 inputs by <code>(0,.9,.1,0)</code>.</p>
<h4 id="usage_12">Usage</h4>
<pre><code>si.bus(N*C) : mixLinearClamp(N, C, mix) : si.bus(C)
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the number of input buses</li>
<li><code>C</code>: the number of channels in each bus</li>
<li><code>mix</code>: the mixing index, continuous in [0;N-1].</li>
</ul>
<hr />
<h3 id="efmixlinearloop"><code>(ef.)mixLinearLoop</code></h3>
<p>Linear mixer for <code>N</code> buses, each with <code>C</code> channels. Refer to <code>mixLinearClamp</code>. <code>mix</code>
will loop for multiples of <code>N</code>. For example, <code>mixLinearLoop(4, 1, 0)</code> has the same
effect as <code>mixLinearLoop(4, 1, -4)</code> and <code>mixLinearLoop(4, 1, 4)</code>.</p>
<h4 id="usage_13">Usage</h4>
<pre><code>si.bus(N*C) : mixLinearLoop(N, C, mix) : si.bus(C)
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the number of input buses</li>
<li><code>C</code>: the number of channels in each bus</li>
<li><code>mix</code>: the mixing index (N-1) selects the last bus, and 0 or N selects the 0th bus.</li>
</ul>
<hr />
<h3 id="efmixpowerclamp"><code>(ef.)mixPowerClamp</code></h3>
<p>Constant-power mixer for <code>N</code> buses, each with <code>C</code> channels. The output will be a sum of 2 buses
determined by the mixing index <code>mix</code>. 0 produces the first bus, 1 produces the
second, and so on. <code>mix</code> is clamped automatically. <code>mixPowerClamp(4, 1, 1)</code>
will weight its 4 inputs by <code>(0, 1./sqrt(2), 0, 0)</code>. Similarly, <code>mixPowerClamp(4, 1, 1.5)</code>
will weight its 4 inputs by <code>(0,.5,.5,0)</code>.</p>
<h4 id="usage_14">Usage</h4>
<pre><code>si.bus(N*C) : mixPowerClamp(N, C, mix) : si.bus(C)
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the number of input buses</li>
<li><code>C</code>: the number of channels in each bus</li>
<li><code>mix</code>: the mixing index, continuous in [0;N-1].</li>
</ul>
<hr />
<h3 id="efmixpowerloop"><code>(ef.)mixPowerLoop</code></h3>
<p>Constant-power mixer for <code>N</code> buses, each with <code>C</code> channels. Refer to <code>mixPowerClamp</code>. <code>mix</code>
will loop for multiples of <code>N</code>. For example, <code>mixPowerLoop(4, 1, 0)</code> has the same effect
as <code>mixPowerLoop(4, 1, -4)</code> and <code>mixPowerLoop(4, 1, 4)</code>.</p>
<h4 id="usage_15">Usage</h4>
<pre><code>si.bus(N*C) : mixPowerLoop(N, C, mix) : si.bus(C)
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: the number of input buses</li>
<li><code>C</code>: the number of channels in each bus</li>
<li><code>mix</code>: the mixing index (N-1) selects the last bus, and 0 or N selects the 0th bus.</li>
</ul>
<h2 id="time-based">Time Based</h2>
<hr />
<h3 id="efecho"><code>(ef.)echo</code></h3>
<p>A simple echo effect.
<code>echo</code> is a standard Faust function.</p>
<h4 id="usage_16">Usage</h4>
<pre><code>_ : echo(maxDuration,duration,feedback) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>maxDuration</code>: the max echo duration in seconds</li>
<li><code>duration</code>: the echo duration in seconds</li>
<li><code>feedback</code>: the feedback coefficient</li>
</ul>
<hr />
<h3 id="efreverseechon"><code>(ef.)reverseEchoN</code></h3>
<p>Reverse echo effect.</p>
<h4 id="usage_17">Usage</h4>
<pre><code>_ : ef.reverseEchoN(N,delay) : si.bus(N)
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: Number of output channels desired (1 or more), a constant numerical expression</li>
<li><code>delay</code>: echo delay (integer power of 2)</li>
</ul>
<h4 id="demo">Demo</h4>
<pre><code>_ : dm.reverseEchoN(N) : _,_
</code></pre>
<h4 id="description">Description</h4>
<p>The effect uses N instances of <code>reverseDelayRamped</code> at different phases.</p>
<hr />
<h3 id="efreversedelayramped"><code>(ef.)reverseDelayRamped</code></h3>
<p>Reverse delay with amplitude ramp.</p>
<h4 id="usage_18">Usage</h4>
<pre><code>_ : ef.reverseDelayRamped(delay,phase) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>delay</code>: echo delay (integer power of 2)</li>
<li><code>phase</code>: float between 0 and 1 giving ramp delay phase*delay</li>
</ul>
<h4 id="demo_1">Demo</h4>
<pre><code>_ : ef.reverseDelayRamped(32,0.6) : _,_
</code></pre>
<hr />
<h3 id="efuniformpantostereo"><code>(ef.)uniformPanToStereo</code></h3>
<p>Pan nChans channels to the stereo field, spread uniformly left to right.</p>
<h4 id="usage_19">Usage</h4>
<pre><code>si.bus(N) : ef.uniformPanToStereo(N) : _,_
</code></pre>
<p>Where:</p>
<ul>
<li><code>N</code>: Number of input channels to pan down to stereo, a constant numerical expression</li>
</ul>
<h4 id="demo_2">Demo</h4>
<pre><code>_,_,_ : ef.uniformPanToStereo(3) : _,_
</code></pre>
<hr />
<h3 id="eftapestop"><code>(ef.)tapeStop</code></h3>
<p>A tape-stop effect, like putting a finger on a vinyl record player.</p>
<h4 id="usage_20">Usage:</h4>
<pre><code>_,_ : tapeStop(2, LAGRANGE_ORDER, MAX_TIME_SAMP,
crossfade, gainAlpha, stopAlpha, stopTime, stop) : _,_
</code></pre>
<pre><code>_ : tapeStop(1, LAGRANGE_ORDER, MAX_TIME_SAMP,
crossfade, gainAlpha, stopAlpha, stopTime, stop) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>C</code>: The number of input and output channels.</li>
<li><code>LAGRANGE_ORDER</code>: The order of the Lagrange interpolation on the delay line. [2-3] recommended.</li>
<li><code>MAX_TIME_SAMP</code>: Maximum stop time in samples</li>
<li><code>crossfade</code>: A crossfade in samples to apply when resuming normal playback. Crossfade is not applied during the enabling of the tape-stop.</li>
<li><code>gainAlpha</code>: During the tape-stop, lower alpha stays louder longer. Safe values are in the range [.01,2].</li>
<li><code>stopAlpha</code>: <code>stopAlpha==1</code> represents a linear deceleration (constant force). <code>stopAlpha<1</code> represents an initially weaker, then stronger force. <code>stopAlpha>1</code> represents an initially stronger, then weaker force. Safe values are in the range [.01,2].</li>
<li><code>stopTime</code>: Desired duration of the stop time, in samples.</li>
<li><code>stop</code>: When <code>stop</code> becomes positive, the tape-stop effect will start. When <code>stop</code> becomes zero, normal audio will resume via crossfade.</li>
</ul>
<h2 id="pitch-shifting">Pitch Shifting</h2>
<hr />
<h3 id="eftranspose"><code>(ef.)transpose</code></h3>
<p>A simple pitch shifter based on 2 delay lines.
<code>transpose</code> is a standard Faust function.</p>
<h4 id="usage_21">Usage</h4>
<pre><code>_ : transpose(w, x, s) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>w</code>: the window length (samples)</li>
<li><code>x</code>: crossfade duration duration (samples)</li>
<li><code>s</code>: shift (semitones)</li>
</ul>
<h2 id="saturators">Saturators</h2>
<hr />
<h3 id="efsoftclipquadratic"><code>(ef.)softclipQuadratic</code></h3>
<p>Quadratic softclip nonlinearity.</p>
<h4 id="usage_22">Usage</h4>
<pre><code>_ : softclipQuadratic : _
</code></pre>
<h4 id="references_4">References</h4>
<ul>
<li>U. Zölzer: Digital Audio Signal Processing. John Wiley & Sons Ltd, 2022.</li>
</ul>
<hr />
<h3 id="efwavefold"><code>(ef.)wavefold</code></h3>
<p>Wavefolding nonlinearity.</p>
<h4 id="usage_23">Usage</h4>
<pre><code>_ : wavefold(width) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>width</code>: The width of the folded section [0..1] (float).</li>
</ul></div>
</div>
</div>
<footer class="col-md-12">
<hr>
<p>Copyright © 2019-2025 <a href="https://www.grame.fr">Grame-CNCM</a></p>
</footer>
<script>
var base_url = "../..",
shortcuts = {"help": 191, "next": 78, "previous": 80, "search": 83};
</script>
<script src="../../js/base.js" defer></script>
<script src="/usr/share/javascript/mathjax/MathJax.js" defer></script>
<script src="../../search/main.js" defer></script>
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="searchModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="searchModalLabel">Search</h4>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body">
<p>From here you can search these documents. Enter your search terms below.</p>
<form>
<div class="form-group">
<input type="search" class="form-control" placeholder="Search..." id="mkdocs-search-query" title="Type search term here">
</div>
</form>
<div id="mkdocs-search-results" data-no-results-text="No results found"></div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div><div class="modal" id="mkdocs_keyboard_modal" tabindex="-1" role="dialog" aria-labelledby="keyboardModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
</div>
<div class="modal-body">
<table class="table">
<thead>
<tr>
<th style="width: 20%;">Keys</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td class="help shortcut"><kbd>?</kbd></td>
<td>Open this help</td>
</tr>
<tr>
<td class="next shortcut"><kbd>n</kbd></td>
<td>Next page</td>
</tr>
<tr>
<td class="prev shortcut"><kbd>p</kbd></td>
<td>Previous page</td>
</tr>
<tr>
<td class="search shortcut"><kbd>s</kbd></td>
<td>Search</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</body>
</html>
|