;-+rtaudio=jack -idac -odac -+jack_client=Csound sr = 48000 ksmps = 128 nchnls = 1 0dbfs = 1 turnon 1 fsig2 pvsinit 1024, 256, 1024, 0 instr 1 klearning init 0 ifftsize = 1024 ioverlap = 256 iwinsize = 1024 iwintype = 0 kratio invalue "ratio" kgain invalue "gain" klearn invalue "learn" kbypass invalue "bypass" ain inch 1 if kbypass == 1 then aout = ain else fsig pvsanal ain, ifftsize, ioverlap, iwinsize, iwintype ffilt pvstencil fsig, kratio, kgain, 1 aout pvsynth ffilt endif out aout if klearn == 1 then krms rms ain if krms > 0.00000001 then klearning = klearning + 1 kflag pvsftw fsig, 2 vaddv 1, 2, 1024 endif elseif klearning > 0 then vmult 1, 1/klearning, 1024 klearning = 0 endif outvalue "learning", (klearning == 0 ? 0:1) endin instr 2 ;clear mask table gin ftgen 1, 0, 1024, 2, 0 turnoff endin instr 3 ;mask white noise gin ftgen 1, 0, 1024, -7, 0.006, 1024, 0.006 turnoff endin f 1 0 1024 -7 0.006 1024 0.006 f 2 0 1024 2 0 ;temp amp table f 0 3600 454 149 352 267 true 170 170 127 ratio 5 5 20 200 {a4c39f46-4d94-4530-af01-0bb3554759ca} true 0 -3 0.00000000 1.00000000 0.00000000 lin continuous -1.00000000 false gain 45 5 20 200 {7144b550-cd89-4a26-850d-eabccac898f7} true 0 -3 0.00000000 0.10000000 0.10000000 lin continuous -1.00000000 false 1 200 34 23 {aa008cf6-defc-48c0-b4d7-48d301fa8852} true 0 -3 left DejaVu Sans 10 3 0 0 0 255 255 255 noborder 1 1 38 200 39 24 {8a12090d-fad7-476d-8051-e46377cd9e65} true 0 -3 left DejaVu Sans 10 3 0 0 0 255 255 255 noborder 1 1 learn 75 180 30 30 {1dad9308-a031-4e4e-b182-315c289338f3} true 0 -3 false 90 183 60 25 {d6b0e393-3d46-477f-b320-a353c5984eb0} true 0 -3 left DejaVu Sans 10 3 147 52 14 255 255 255 noborder 1 1 button1 75 158 100 25 {6adaeefc-4f17-486a-9bff-61607dbf5ea8} true 0 -3 event 1.00000000 Clear mask / i2 0 1 false false 75 130 30 30 {ef9646a0-ea0e-4bda-a05d-4d8c5748f646} true 0 -3 false 90 135 80 25 {b87655c4-4638-45ba-9b03-453c1448e630} true 0 -3 left DejaVu Sans 10 3 0 0 0 255 255 255 noborder 1 1 75 5 160 125 {e5158635-d1f0-4070-b7bd-e8f413701a70} true 0 -3 left Helvetica 10 3 127 112 94 194 194 194 border 4 1 learning 236 191 30 30 {2d1b5c28-1a8c-447a-8d3b-a8ab34394597} true 0 -3 false white 190 158 132 25 {b5c9f013-75ca-4caa-8b31-c7fbb0bb01b9} true 0 -3 event 1.00000000 Mask white noise / i3 0 1 false false Version: 3 Render: Real Ask: Yes Functions: ioObject Listing: Window WindowBounds: 454 149 352 267 CurrentView: io IOViewEdit: On Options: -b128 -A -s -m167 -R ioView background {43690, 43690, 32639} ioSlider {5, 5} {20, 200} 0.000000 1.000000 0.000000 ratio ioSlider {45, 5} {20, 200} 0.000000 0.100000 0.100000 gain ioText {1, 200} {34, 23} label 0.000000 0.00100 "" left "DejaVu Sans" 10 {0, 0, 0} {65280, 65280, 65280} nobackground noborder ratio ioText {38, 200} {33, 25} label 0.000000 0.00100 "" left "DejaVu Sans" 10 {0, 0, 0} {65280, 65280, 65280} nobackground noborder Gain ioCheckbox {75, 180} {30, 30} off learn ioText {90, 183} {60, 25} label 0.000000 0.00100 "" left "DejaVu Sans" 10 {37632, 13312, 3584} {65280, 65280, 65280} nobackground noborder Learn ioButton {75, 158} {100, 25} event 1.000000 "button1" "Clear mask" "/" i2 0 1 ioCheckbox {75, 130} {30, 30} off ioText {90, 135} {80, 25} label 0.000000 0.00100 "" left "DejaVu Sans" 10 {0, 0, 0} {65280, 65280, 65280} nobackground noborder Bypass ioText {75, 5} {160, 125} label 0.000000 0.00100 "" left "Helvetica" 10 {32512, 28672, 24064} {49664, 49664, 49664} nobackground noborder This noise reduction unit can sample a noise print and then remove it through spectral masking. First clear the mask then activate the learn while the noise is playing. Deactivate the learn button and the noise will be removed. ioCheckbox {236, 191} {30, 30} off learning ioButton {190, 158} {132, 25} event 1.000000 "white" "Mask white noise" "/" i3 0 1