|
View:
New views
14 Messages
—
Rating Filter:
Alert me
|
|
|
single sample delay from buffer; please helpHi all,
can any of you explain why: b=Buffer.alloc(s, 128, 1); ( SynthDef(\tryDelay, {|bufnum, delay = 1| var source, capture, delayed; source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); capture = RecordBuf.ar( source, bufnum ); delayed = PlayBuf.ar(1, bufnum, 1, 0, (delay/SampleRate.ir) * SampleRate.ir.neg, 1); Out.ar(0, delayed); }).send(s); ) x=Synth(\tryDelay,[\bufnum, b]); /* works but */ ( SynthDef(\tryDelay, {|bufnum, delay = 1| var source, capture, delayed; source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); capture = RecordBuf.ar( source, bufnum ); delayed = PlayBuf.ar(1, bufnum, 1, 0, delay.neg, // simplified 1); Out.ar(0, delayed); }).send(s); ) x=Synth(\tryDelay,[\bufnum, b]); /* doesn't work? I get distorted sound with the second one.. Buffer size doesn't seem to matter, although at <64 samples I get distorted sound on both examples. */ cheers & thanks, Wouter Wouter Snoei info@... http://www.woutersnoei.nl _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please helpstartPos in the PlayBuf is negative, is it supposed to be like that?
interesting effect to play with, using different values. Wouter Snoei wrote: > Hi all, > > can any of you explain why: > > b=Buffer.alloc(s, 128, 1); > > ( > SynthDef(\tryDelay, {|bufnum, delay = 1| > var source, capture, delayed; > source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); > capture = RecordBuf.ar( source, bufnum ); > > delayed = PlayBuf.ar(1, bufnum, 1, 0, > (delay/SampleRate.ir) * SampleRate.ir.neg, > 1); > > Out.ar(0, delayed); > > }).send(s); > ) > > x=Synth(\tryDelay,[\bufnum, b]); > > /* > works but > */ > > ( > SynthDef(\tryDelay, {|bufnum, delay = 1| > var source, capture, delayed; > source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); > capture = RecordBuf.ar( source, bufnum ); > > delayed = PlayBuf.ar(1, bufnum, 1, 0, > delay.neg, // simplified > 1); > > Out.ar(0, delayed); > > }).send(s); > ) > > > x=Synth(\tryDelay,[\bufnum, b]); > > /* > doesn't work? I get distorted sound with the second one.. Buffer size > doesn't seem to matter, although at <64 samples I get distorted sound > on both examples. > */ > > > cheers & thanks, > Wouter > > > > > Wouter Snoei > > info@... > http://www.woutersnoei.nl > > _______________________________________________ > sc-users mailing list > sc-users@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-users > > _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please helpI copied the code from Tap.ar. PlayBuf has loop:1 here, so
startOffset is wrapped internally. Using .wrap has no effect on result. It seems to be something to do with when the buffer is updated. In the first example this always happens straight away, in the second it seems to sometimes wait for a control frame duration. I want to use this for internal single-sample feedback, but there is no way I can get that to work. As soon as I try to route the delayed into the recordbuf the same distortion problems start showing up as in the second example. Really, can't SC do single-sample feedback? The example in the examples folder only does it at Demand rate. As soon as I mix in audio signals there again the same problems as in the example below start showing up.. help welcome here.. cheers, Wouter Op 15-mei-2008, om 17:04 heeft nonprivate het volgende geschreven: > startPos in the PlayBuf is negative, is it supposed to be like that? > interesting effect to play with, using different values. > > Wouter Snoei wrote: >> Hi all, >> >> can any of you explain why: >> >> b=Buffer.alloc(s, 128, 1); >> >> ( >> SynthDef(\tryDelay, {|bufnum, delay = 1| >> var source, capture, delayed; >> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >> capture = RecordBuf.ar( source, bufnum ); >> >> delayed = PlayBuf.ar(1, bufnum, 1, 0, >> (delay/SampleRate.ir) * SampleRate.ir.neg, >> 1); >> >> Out.ar(0, delayed); >> >> }).send(s); >> ) >> >> x=Synth(\tryDelay,[\bufnum, b]); >> >> /* >> works but >> */ >> >> ( >> SynthDef(\tryDelay, {|bufnum, delay = 1| >> var source, capture, delayed; >> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >> capture = RecordBuf.ar( source, bufnum ); >> >> delayed = PlayBuf.ar(1, bufnum, 1, 0, >> delay.neg, // simplified >> 1); >> >> Out.ar(0, delayed); >> >> }).send(s); >> ) >> >> >> x=Synth(\tryDelay,[\bufnum, b]); >> >> /* >> doesn't work? I get distorted sound with the second one.. Buffer size >> doesn't seem to matter, although at <64 samples I get distorted sound >> on both examples. >> */ >> >> >> cheers & thanks, >> Wouter >> >> >> >> >> Wouter Snoei >> >> info@... >> http://www.woutersnoei.nl >> >> _______________________________________________ >> sc-users mailing list >> sc-users@... >> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >> >> > > _______________________________________________ > sc-users mailing list > sc-users@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-users Wouter Snoei info@... http://www.woutersnoei.nl _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please helpOn Thu, May 15, 2008 at 11:16 AM, Wouter Snoei
<mailinglists@...> wrote: > Really, can't SC do single-sample feedback? Block calculation makes it next-to-impossible. Minimum delay time for feedback is one control block. Delay1 can delay a signal by exactly one sample but that's without feedback. hjh -- James Harkins /// dewdrop world jamshark70@... http://www.dewdrop-world.net "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please helphi wouter, i must admit i don't understand, but if startPos is -1 then
the "distortion" is apparent, but if it is set to 1 it isn't. i never tried giving startPos negative values before, so i wonder if it's an intentional thing in order to do something specific, or something you're not supposed to do but sounds interesting anyway. Wouter Snoei wrote: > I copied the code from Tap.ar. PlayBuf has loop:1 here, so > startOffset is wrapped internally. Using .wrap has no effect on result. > > It seems to be something to do with when the buffer is updated. In > the first example this always happens straight away, in the second it > seems to sometimes wait for a control frame duration. I want to use > this for internal single-sample feedback, but there is no way I can > get that to work. As soon as I try to route the delayed into the > recordbuf the same distortion problems start showing up as in the > second example. Really, can't SC do single-sample feedback? The > example in the examples folder only does it at Demand rate. As soon > as I mix in audio signals there again the same problems as in the > example below start showing up.. help welcome here.. > > cheers, > Wouter > > > Op 15-mei-2008, om 17:04 heeft nonprivate het volgende geschreven: > > >> startPos in the PlayBuf is negative, is it supposed to be like that? >> interesting effect to play with, using different values. >> >> Wouter Snoei wrote: >> >>> Hi all, >>> >>> can any of you explain why: >>> >>> b=Buffer.alloc(s, 128, 1); >>> >>> ( >>> SynthDef(\tryDelay, {|bufnum, delay = 1| >>> var source, capture, delayed; >>> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >>> capture = RecordBuf.ar( source, bufnum ); >>> >>> delayed = PlayBuf.ar(1, bufnum, 1, 0, >>> (delay/SampleRate.ir) * SampleRate.ir.neg, >>> 1); >>> >>> Out.ar(0, delayed); >>> >>> }).send(s); >>> ) >>> >>> x=Synth(\tryDelay,[\bufnum, b]); >>> >>> /* >>> works but >>> */ >>> >>> ( >>> SynthDef(\tryDelay, {|bufnum, delay = 1| >>> var source, capture, delayed; >>> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >>> capture = RecordBuf.ar( source, bufnum ); >>> >>> delayed = PlayBuf.ar(1, bufnum, 1, 0, >>> delay.neg, // simplified >>> 1); >>> >>> Out.ar(0, delayed); >>> >>> }).send(s); >>> ) >>> >>> >>> x=Synth(\tryDelay,[\bufnum, b]); >>> >>> /* >>> doesn't work? I get distorted sound with the second one.. Buffer size >>> doesn't seem to matter, although at <64 samples I get distorted sound >>> on both examples. >>> */ >>> >>> >>> cheers & thanks, >>> Wouter >>> >>> >>> >>> >>> Wouter Snoei >>> >>> info@... >>> http://www.woutersnoei.nl >>> >>> _______________________________________________ >>> sc-users mailing list >>> sc-users@... >>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>> >>> >>> >> _______________________________________________ >> sc-users mailing list >> sc-users@... >> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >> > > Wouter Snoei > > info@... > http://www.woutersnoei.nl > > _______________________________________________ > sc-users mailing list > sc-users@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-users > > _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please helpOn 15 May 2008, at 16:31, James Harkins wrote: > On Thu, May 15, 2008 at 11:16 AM, Wouter Snoei > <mailinglists@...> wrote: >> Really, can't SC do single-sample feedback? > > Block calculation makes it next-to-impossible. Minimum delay time for > feedback is one control block. Hey Wouter, This problem exists in any software that calculates audio in blocks (e.g. Max). Since each UGen calculates in turn, producing a block of samples, if you want sub-block size feedback you need to do it within a UGen. S. _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please helpWell, what I'm doing is writing into a buffer with RecordBuf, and
read out immediately after that. This is why the startpos for PlayBuf is below zero. The same thing could be done by giving RecordBuf a positive offset and PlayBuf no offset. However, giving PlayBuf a positive offset makes the read pointer go before the write pointer, and results in a delay as big as the size of the buffer. Which works but is not what I want :-). The bottom line is: as soon as I try to read from and write to a buffer frame within the timespan of a control frame (64 samples) thing become unstable, resulting in the distortion. This seems to go for any UGen I tried to achieve it with. The working example I gave earlier was probably a lucky exception. Or was it.. ? cheers, Wouter Op 15-mei-2008, om 17:35 heeft nonprivate het volgende geschreven: > hi wouter, i must admit i don't understand, but if startPos is -1 then > the "distortion" is apparent, but if it is set to 1 it isn't. i never > tried giving startPos negative values before, so i wonder if it's an > intentional thing in order to do something specific, or something > you're > not supposed to do but sounds interesting anyway. > > Wouter Snoei wrote: >> I copied the code from Tap.ar. PlayBuf has loop:1 here, so >> startOffset is wrapped internally. Using .wrap has no effect on >> result. >> >> It seems to be something to do with when the buffer is updated. In >> the first example this always happens straight away, in the second it >> seems to sometimes wait for a control frame duration. I want to use >> this for internal single-sample feedback, but there is no way I can >> get that to work. As soon as I try to route the delayed into the >> recordbuf the same distortion problems start showing up as in the >> second example. Really, can't SC do single-sample feedback? The >> example in the examples folder only does it at Demand rate. As soon >> as I mix in audio signals there again the same problems as in the >> example below start showing up.. help welcome here.. >> >> cheers, >> Wouter >> >> >> Op 15-mei-2008, om 17:04 heeft nonprivate het volgende geschreven: >> >> >>> startPos in the PlayBuf is negative, is it supposed to be like that? >>> interesting effect to play with, using different values. >>> >>> Wouter Snoei wrote: >>> >>>> Hi all, >>>> >>>> can any of you explain why: >>>> >>>> b=Buffer.alloc(s, 128, 1); >>>> >>>> ( >>>> SynthDef(\tryDelay, {|bufnum, delay = 1| >>>> var source, capture, delayed; >>>> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >>>> capture = RecordBuf.ar( source, bufnum ); >>>> >>>> delayed = PlayBuf.ar(1, bufnum, 1, 0, >>>> (delay/SampleRate.ir) * SampleRate.ir.neg, >>>> 1); >>>> >>>> Out.ar(0, delayed); >>>> >>>> }).send(s); >>>> ) >>>> >>>> x=Synth(\tryDelay,[\bufnum, b]); >>>> >>>> /* >>>> works but >>>> */ >>>> >>>> ( >>>> SynthDef(\tryDelay, {|bufnum, delay = 1| >>>> var source, capture, delayed; >>>> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >>>> capture = RecordBuf.ar( source, bufnum ); >>>> >>>> delayed = PlayBuf.ar(1, bufnum, 1, 0, >>>> delay.neg, // simplified >>>> 1); >>>> >>>> Out.ar(0, delayed); >>>> >>>> }).send(s); >>>> ) >>>> >>>> >>>> x=Synth(\tryDelay,[\bufnum, b]); >>>> >>>> /* >>>> doesn't work? I get distorted sound with the second one.. Buffer >>>> size >>>> doesn't seem to matter, although at <64 samples I get distorted >>>> sound >>>> on both examples. >>>> */ >>>> >>>> >>>> cheers & thanks, >>>> Wouter >>>> >>>> >>>> >>>> >>>> Wouter Snoei >>>> >>>> info@... >>>> http://www.woutersnoei.nl >>>> >>>> _______________________________________________ >>>> sc-users mailing list >>>> sc-users@... >>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>>> >>>> >>>> >>> _______________________________________________ >>> sc-users mailing list >>> sc-users@... >>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>> >> >> Wouter Snoei >> >> info@... >> http://www.woutersnoei.nl >> >> _______________________________________________ >> sc-users mailing list >> sc-users@... >> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >> >> > > _______________________________________________ > sc-users mailing list > sc-users@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-users Wouter Snoei info@... http://www.woutersnoei.nl _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please helpSo you basically want a single sample feedback delay that is NOT
buffer based... is this it (sorry - just skimming the thread)? If it is, this would be fairly easy to build as a UGen. I could probably build one quickly based on Delay1. Or - is more flexibility wanted? Another option would be versions of Delay1, Delay2, DelayN, L and C with a feedback component. Have you tried a CombN or AllpassN with a delay of one sample? Of course, these have a color to them, but maybe this would work at such a small delay time??? Best, Josh On May 15, 2008, at 9:03 AM, Wouter Snoei wrote: > Well, what I'm doing is writing into a buffer with RecordBuf, and > read out immediately after that. This is why the startpos for PlayBuf > is below zero. The same thing could be done by giving RecordBuf a > positive offset and PlayBuf no offset. However, giving PlayBuf a > positive offset makes the read pointer go before the write pointer, > and results in a delay as big as the size of the buffer. Which works > but is not what I want :-). > > The bottom line is: as soon as I try to read from and write to a > buffer frame within the timespan of a control frame (64 samples) > thing become unstable, resulting in the distortion. This seems to go > for any UGen I tried to achieve it with. The working example I gave > earlier was probably a lucky exception. Or was it.. ? > > cheers, > Wouter > > > Op 15-mei-2008, om 17:35 heeft nonprivate het volgende geschreven: > >> hi wouter, i must admit i don't understand, but if startPos is -1 >> then >> the "distortion" is apparent, but if it is set to 1 it isn't. i never >> tried giving startPos negative values before, so i wonder if it's an >> intentional thing in order to do something specific, or something >> you're >> not supposed to do but sounds interesting anyway. >> >> Wouter Snoei wrote: >>> I copied the code from Tap.ar. PlayBuf has loop:1 here, so >>> startOffset is wrapped internally. Using .wrap has no effect on >>> result. >>> >>> It seems to be something to do with when the buffer is updated. In >>> the first example this always happens straight away, in the second >>> it >>> seems to sometimes wait for a control frame duration. I want to use >>> this for internal single-sample feedback, but there is no way I can >>> get that to work. As soon as I try to route the delayed into the >>> recordbuf the same distortion problems start showing up as in the >>> second example. Really, can't SC do single-sample feedback? The >>> example in the examples folder only does it at Demand rate. As soon >>> as I mix in audio signals there again the same problems as in the >>> example below start showing up.. help welcome here.. >>> >>> cheers, >>> Wouter >>> >>> >>> Op 15-mei-2008, om 17:04 heeft nonprivate het volgende geschreven: >>> >>> >>>> startPos in the PlayBuf is negative, is it supposed to be like >>>> that? >>>> interesting effect to play with, using different values. >>>> >>>> Wouter Snoei wrote: >>>> >>>>> Hi all, >>>>> >>>>> can any of you explain why: >>>>> >>>>> b=Buffer.alloc(s, 128, 1); >>>>> >>>>> ( >>>>> SynthDef(\tryDelay, {|bufnum, delay = 1| >>>>> var source, capture, delayed; >>>>> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >>>>> capture = RecordBuf.ar( source, bufnum ); >>>>> >>>>> delayed = PlayBuf.ar(1, bufnum, 1, 0, >>>>> (delay/SampleRate.ir) * SampleRate.ir.neg, >>>>> 1); >>>>> >>>>> Out.ar(0, delayed); >>>>> >>>>> }).send(s); >>>>> ) >>>>> >>>>> x=Synth(\tryDelay,[\bufnum, b]); >>>>> >>>>> /* >>>>> works but >>>>> */ >>>>> >>>>> ( >>>>> SynthDef(\tryDelay, {|bufnum, delay = 1| >>>>> var source, capture, delayed; >>>>> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >>>>> capture = RecordBuf.ar( source, bufnum ); >>>>> >>>>> delayed = PlayBuf.ar(1, bufnum, 1, 0, >>>>> delay.neg, // simplified >>>>> 1); >>>>> >>>>> Out.ar(0, delayed); >>>>> >>>>> }).send(s); >>>>> ) >>>>> >>>>> >>>>> x=Synth(\tryDelay,[\bufnum, b]); >>>>> >>>>> /* >>>>> doesn't work? I get distorted sound with the second one.. Buffer >>>>> size >>>>> doesn't seem to matter, although at <64 samples I get distorted >>>>> sound >>>>> on both examples. >>>>> */ >>>>> >>>>> >>>>> cheers & thanks, >>>>> Wouter >>>>> >>>>> >>>>> >>>>> >>>>> Wouter Snoei >>>>> >>>>> info@... >>>>> http://www.woutersnoei.nl >>>>> >>>>> _______________________________________________ >>>>> sc-users mailing list >>>>> sc-users@... >>>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>>>> >>>>> >>>>> >>>> _______________________________________________ >>>> sc-users mailing list >>>> sc-users@... >>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>>> >>> >>> Wouter Snoei >>> >>> info@... >>> http://www.woutersnoei.nl >>> >>> _______________________________________________ >>> sc-users mailing list >>> sc-users@... >>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>> >>> >> >> _______________________________________________ >> sc-users mailing list >> sc-users@... >> http://lists.create.ucsb.edu/mailman/listinfo/sc-users > > Wouter Snoei > > info@... > http://www.woutersnoei.nl > > _______________________________________________ > sc-users mailing list > sc-users@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-users ****************************************** /* Joshua D. Parmenter http://www.realizedsound.net/josh/ “Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono */ _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please help> If it is, this would be fairly easy to build as a UGen. I could
> probably build one quickly based on Delay1. Or - is more flexibility > wanted? Well, a delay1 based would be great! > Another option would be versions of Delay1, Delay2, DelayN, L and C > with a feedback component. > Have you tried a CombN or AllpassN with a delay of one sample? Of > course, these have a color to them, but maybe this would work at such > a small delay time??? The thing is; I want to be able to put various UGens inside the feedback loop (filters, multipliers, phasers, reverbs etc). Comb or AllPass won't let me do that. Ideally I would like to have a LocalIn/ LocalOut pair but with only one sample delay instead of 64. Would that be possible based on a Delay1? cheers, Wouter > On May 15, 2008, at 9:03 AM, Wouter Snoei wrote: > >> Well, what I'm doing is writing into a buffer with RecordBuf, and >> read out immediately after that. This is why the startpos for PlayBuf >> is below zero. The same thing could be done by giving RecordBuf a >> positive offset and PlayBuf no offset. However, giving PlayBuf a >> positive offset makes the read pointer go before the write pointer, >> and results in a delay as big as the size of the buffer. Which works >> but is not what I want :-). >> >> The bottom line is: as soon as I try to read from and write to a >> buffer frame within the timespan of a control frame (64 samples) >> thing become unstable, resulting in the distortion. This seems to go >> for any UGen I tried to achieve it with. The working example I gave >> earlier was probably a lucky exception. Or was it.. ? >> >> cheers, >> Wouter >> >> >> Op 15-mei-2008, om 17:35 heeft nonprivate het volgende geschreven: >> >>> hi wouter, i must admit i don't understand, but if startPos is -1 >>> then >>> the "distortion" is apparent, but if it is set to 1 it isn't. i >>> never >>> tried giving startPos negative values before, so i wonder if it's an >>> intentional thing in order to do something specific, or something >>> you're >>> not supposed to do but sounds interesting anyway. >>> >>> Wouter Snoei wrote: >>>> I copied the code from Tap.ar. PlayBuf has loop:1 here, so >>>> startOffset is wrapped internally. Using .wrap has no effect on >>>> result. >>>> >>>> It seems to be something to do with when the buffer is updated. In >>>> the first example this always happens straight away, in the second >>>> it >>>> seems to sometimes wait for a control frame duration. I want to use >>>> this for internal single-sample feedback, but there is no way I can >>>> get that to work. As soon as I try to route the delayed into the >>>> recordbuf the same distortion problems start showing up as in the >>>> second example. Really, can't SC do single-sample feedback? The >>>> example in the examples folder only does it at Demand rate. As soon >>>> as I mix in audio signals there again the same problems as in the >>>> example below start showing up.. help welcome here.. >>>> >>>> cheers, >>>> Wouter >>>> >>>> >>>> Op 15-mei-2008, om 17:04 heeft nonprivate het volgende geschreven: >>>> >>>> >>>>> startPos in the PlayBuf is negative, is it supposed to be like >>>>> that? >>>>> interesting effect to play with, using different values. >>>>> >>>>> Wouter Snoei wrote: >>>>> >>>>>> Hi all, >>>>>> >>>>>> can any of you explain why: >>>>>> >>>>>> b=Buffer.alloc(s, 128, 1); >>>>>> >>>>>> ( >>>>>> SynthDef(\tryDelay, {|bufnum, delay = 1| >>>>>> var source, capture, delayed; >>>>>> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >>>>>> capture = RecordBuf.ar( source, bufnum ); >>>>>> >>>>>> delayed = PlayBuf.ar(1, bufnum, 1, 0, >>>>>> (delay/SampleRate.ir) * SampleRate.ir.neg, >>>>>> 1); >>>>>> >>>>>> Out.ar(0, delayed); >>>>>> >>>>>> }).send(s); >>>>>> ) >>>>>> >>>>>> x=Synth(\tryDelay,[\bufnum, b]); >>>>>> >>>>>> /* >>>>>> works but >>>>>> */ >>>>>> >>>>>> ( >>>>>> SynthDef(\tryDelay, {|bufnum, delay = 1| >>>>>> var source, capture, delayed; >>>>>> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >>>>>> capture = RecordBuf.ar( source, bufnum ); >>>>>> >>>>>> delayed = PlayBuf.ar(1, bufnum, 1, 0, >>>>>> delay.neg, // simplified >>>>>> 1); >>>>>> >>>>>> Out.ar(0, delayed); >>>>>> >>>>>> }).send(s); >>>>>> ) >>>>>> >>>>>> >>>>>> x=Synth(\tryDelay,[\bufnum, b]); >>>>>> >>>>>> /* >>>>>> doesn't work? I get distorted sound with the second one.. Buffer >>>>>> size >>>>>> doesn't seem to matter, although at <64 samples I get distorted >>>>>> sound >>>>>> on both examples. >>>>>> */ >>>>>> >>>>>> >>>>>> cheers & thanks, >>>>>> Wouter >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Wouter Snoei >>>>>> >>>>>> info@... >>>>>> http://www.woutersnoei.nl >>>>>> >>>>>> _______________________________________________ >>>>>> sc-users mailing list >>>>>> sc-users@... >>>>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>>>>> >>>>>> >>>>>> >>>>> _______________________________________________ >>>>> sc-users mailing list >>>>> sc-users@... >>>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>>>> >>>> >>>> Wouter Snoei >>>> >>>> info@... >>>> http://www.woutersnoei.nl >>>> >>>> _______________________________________________ >>>> sc-users mailing list >>>> sc-users@... >>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>>> >>>> >>> >>> _______________________________________________ >>> sc-users mailing list >>> sc-users@... >>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >> >> Wouter Snoei >> >> info@... >> http://www.woutersnoei.nl >> >> _______________________________________________ >> sc-users mailing list >> sc-users@... >> http://lists.create.ucsb.edu/mailman/listinfo/sc-users > > ****************************************** > /* Joshua D. Parmenter > http://www.realizedsound.net/josh/ > > “Every composer – at all times and in all cases – gives his own > interpretation of how modern society is structured: whether actively > or passively, consciously or unconsciously, he makes choices in this > regard. He may be conservative or he may subject himself to continual > renewal; or he may strive for a revolutionary, historical or social > palingenesis." - Luigi Nono > */ > > _______________________________________________ > sc-users mailing list > sc-users@... > http://lists.create.ucsb.edu/mailman/listinfo/sc-users Wouter Snoei info@... http://www.woutersnoei.nl _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please helpOn May 15, 2008, at 3:40 PM, Wouter Snoei wrote:
> The thing is; I want to be able to put various UGens inside the > feedback loop (filters, multipliers, phasers, reverbs etc). Comb or > AllPass won't let me do that. Ideally I would like to have a LocalIn/ > LocalOut pair but with only one sample delay instead of 64. Would > that be possible based on a Delay1? No. There is no way to tell a UGen in a graph to only calculate a single sample, run the rest of the graph, then loop again. You would need to set your block size to 1 (which is possible in NRT) and use LocalIn and LocalOut. Josh ****************************************** /* Joshua D. Parmenter http://www.realizedsound.net/josh/ “Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono */ _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please helpIt would be nice to have a Buffer ugen analogous to LocalIn
(LocalBuf) that instanciates a buffer local to the synthdef. This would mean a little change to GraphDef in the sources, but would be very handy for some things like FFTs or single sample feedbacks via demand ugens. >So you basically want a single sample feedback delay that is NOT >buffer based... is this it (sorry - just skimming the thread)? > >If it is, this would be fairly easy to build as a UGen. I could >probably build one quickly based on Delay1. Or - is more flexibility >wanted? > >Another option would be versions of Delay1, Delay2, DelayN, L and C >with a feedback component. > >Have you tried a CombN or AllpassN with a delay of one sample? Of >course, these have a color to them, but maybe this would work at such >a small delay time??? > >Best, > >Josh > > >On May 15, 2008, at 9:03 AM, Wouter Snoei wrote: > >> Well, what I'm doing is writing into a buffer with RecordBuf, and >> read out immediately after that. This is why the startpos for PlayBuf >> is below zero. The same thing could be done by giving RecordBuf a >> positive offset and PlayBuf no offset. However, giving PlayBuf a >> positive offset makes the read pointer go before the write pointer, >> and results in a delay as big as the size of the buffer. Which works >> but is not what I want :-). >> >> The bottom line is: as soon as I try to read from and write to a >> buffer frame within the timespan of a control frame (64 samples) >> thing become unstable, resulting in the distortion. This seems to go >> for any UGen I tried to achieve it with. The working example I gave >> earlier was probably a lucky exception. Or was it.. ? >> >> cheers, >> Wouter >> >> >> Op 15-mei-2008, om 17:35 heeft nonprivate het volgende geschreven: >> >>> hi wouter, i must admit i don't understand, but if startPos is -1 >>> then >>> the "distortion" is apparent, but if it is set to 1 it isn't. i never >>> tried giving startPos negative values before, so i wonder if it's an >>> intentional thing in order to do something specific, or something >>> you're >>> not supposed to do but sounds interesting anyway. >>> >>> Wouter Snoei wrote: >>>> I copied the code from Tap.ar. PlayBuf has loop:1 here, so >>>> startOffset is wrapped internally. Using .wrap has no effect on >>>> result. >>>> >>>> It seems to be something to do with when the buffer is updated. In >>>> the first example this always happens straight away, in the second >>>> it >>>> seems to sometimes wait for a control frame duration. I want to use >>>> this for internal single-sample feedback, but there is no way I can >>>> get that to work. As soon as I try to route the delayed into the >>>> recordbuf the same distortion problems start showing up as in the >>>> second example. Really, can't SC do single-sample feedback? The >>>> example in the examples folder only does it at Demand rate. As soon >>>> as I mix in audio signals there again the same problems as in the >>>> example below start showing up.. help welcome here.. >>>> >>>> cheers, >>>> Wouter >>>> >>>> >>>> Op 15-mei-2008, om 17:04 heeft nonprivate het volgende geschreven: >>>> >>>> >>>>> startPos in the PlayBuf is negative, is it supposed to be like >>>>> that? >>>>> interesting effect to play with, using different values. >>>>> >>>>> Wouter Snoei wrote: >>>>> >>>>>> Hi all, >>>>>> >>>>>> can any of you explain why: >>>>>> >>>>>> b=Buffer.alloc(s, 128, 1); >>>>>> >>>>>> ( >>>>>> SynthDef(\tryDelay, {|bufnum, delay = 1| >>>>>> var source, capture, delayed; >>>>>> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >>>>>> capture = RecordBuf.ar( source, bufnum ); >>>>>> >>>>>> delayed = PlayBuf.ar(1, bufnum, 1, 0, >>>>>> (delay/SampleRate.ir) * SampleRate.ir.neg, >>>>>> 1); >>>>>> >>>>>> Out.ar(0, delayed); >>>>>> >>>>>> }).send(s); >>>>>> ) >>>>>> >>>>>> x=Synth(\tryDelay,[\bufnum, b]); >>>>>> >>>>>> /* >>>>>> works but >>>>>> */ >>>>>> >>>>>> ( >>>>>> SynthDef(\tryDelay, {|bufnum, delay = 1| > >>>>> var source, capture, delayed; >>>>>> source= SinOsc.ar( SinOsc.ar(2).range(400,500), 0, 0.125 ); >>>>>> capture = RecordBuf.ar( source, bufnum ); >>>>>> >>>>>> delayed = PlayBuf.ar(1, bufnum, 1, 0, >>>>>> delay.neg, // simplified >>>>>> 1); >>>>>> >>>>>> Out.ar(0, delayed); >>>>>> >>>>>> }).send(s); >>>>>> ) >>>>>> >>>>>> >>>>>> x=Synth(\tryDelay,[\bufnum, b]); >>>>>> >>>>>> /* >>>>>> doesn't work? I get distorted sound with the second one.. Buffer >>>>>> size >>>>>> doesn't seem to matter, although at <64 samples I get distorted >>>>>> sound >>>>>> on both examples. >>>>>> */ >>>>>> >>>>>> >>>>>> cheers & thanks, >>>>>> Wouter >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Wouter Snoei >>>>>> >>>>>> info@... >>>>>> http://www.woutersnoei.nl >>>>>> >>>>>> _______________________________________________ >>>>>> sc-users mailing list >>>>>> sc-users@... >>>>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>>>>> >>>>>> >>>>>> >>>>> _______________________________________________ >>>>> sc-users mailing list >>>>> sc-users@... >>>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>>>> >>>> >>>> Wouter Snoei >>>> >>>> info@... >>>> http://www.woutersnoei.nl >>>> >>>> _______________________________________________ >>>> sc-users mailing list >>>> sc-users@... >>>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >>>> >>>> >>> >>> _______________________________________________ >>> sc-users mailing list >>> sc-users@... >>> http://lists.create.ucsb.edu/mailman/listinfo/sc-users >> >> Wouter Snoei >> >> info@... >> http://www.woutersnoei.nl >> >> _______________________________________________ >> sc-users mailing list >> sc-users@... >> http://lists.create.ucsb.edu/mailman/listinfo/sc-users > >****************************************** >/* Joshua D. Parmenter >http://www.realizedsound.net/josh/ > >"Every composer - at all times and in all cases - gives his own >interpretation of how modern society is structured: whether actively >or passively, consciously or unconsciously, he makes choices in this >regard. He may be conservative or he may subject himself to continual >renewal; or he may strive for a revolutionary, historical or social >palingenesis." - Luigi Nono >*/ > >_______________________________________________ >sc-users mailing list >sc-users@... >http://lists.create.ucsb.edu/mailman/listinfo/sc-users -- . _______________________________________________ sc-users mailing list sc-users@... http://lists.create.ucsb.edu/mailman/listinfo/sc-users |
|
|
Re: single sample delay from buffer; please help |