// Copyright (C) 2008 Chris Rossi // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . desc: spacelab anticipate slider1:50<0,1000>time (ms) slider2:0<0,100000>samples @init predelay_sec = 1; predelay_samples = predelay_sec * srate; pdc_delay = predelay_samples; pdc_bot_ch = 0; pdc_top_ch = 2; lbuf = 0; @slider time != slider1 ? ( time = slider1; slider2 = rsamples = time * 0.001 * srate; ) : rsamples != slider2 ? time = rsamples / srate / 0.001; startover=1; addr=0; rbuf = samples; freembuf(samples*2); @sample samples != 0 ? ( l = spl0; r = spl1; ! startover ? ( spl0 = lbuf[addr]; spl1 = rbuf[addr]; ); lbuf[addr] = l; rbuf[addr] = r; addr += 1; addr == samples ? startover = addr = 0; ); // bbbbbbbb // OOOOOOOOO b::::::b !!! // OO:::::::::OO b::::::b !!:!! // OO:::::::::::::OOb::::::b !:::! // O:::::::OOO:::::::Ob:::::b !:::! // O::::::O O::::::Ob:::::bbbbbbbbb aaaaaaaaaaaaa mmmmmmm mmmmmmm aaaaaaaaaaaaa !:::! // O:::::O O:::::Ob::::::::::::::bb a::::::::::::a mm:::::::m m:::::::mm a::::::::::::a !:::! // O:::::O O:::::Ob::::::::::::::::b aaaaaaaaa:::::a m::::::::::mm::::::::::m aaaaaaaaa:::::a !:::! // O:::::O O:::::Ob:::::bbbbb:::::::b a::::a m::::::::::::::::::::::m a::::a !:::! // O:::::O O:::::Ob:::::b b::::::b aaaaaaa:::::a m:::::mmm::::::mmm:::::m aaaaaaa:::::a !:::! // O:::::O O:::::Ob:::::b b:::::b aa::::::::::::a m::::m m::::m m::::m aa::::::::::::a !:::! // O:::::O O:::::Ob:::::b b:::::b a::::aaaa::::::a m::::m m::::m m::::m a::::aaaa::::::a !!:!! // O::::::O O::::::Ob:::::b b:::::ba::::a a:::::a m::::m m::::m m::::ma::::a a:::::a !!! // O:::::::OOO:::::::Ob:::::bbbbbb::::::ba::::a a:::::a m::::m m::::m m::::ma::::a a:::::a // OO:::::::::::::OO b::::::::::::::::b a:::::aaaa::::::a m::::m m::::m m::::ma:::::aaaa::::::a !!! // OO:::::::::OO b:::::::::::::::b a::::::::::aa:::am::::m m::::m m::::m a::::::::::aa:::a!!:!! // OOOOOOOOO bbbbbbbbbbbbbbbb aaaaaaaaaa aaaammmmmm mmmmmm mmmmmm aaaaaaaaaa aaaa !!!