Interesting stereo widening effect
This "algorithm" such as it is came from an old amplifier. I think it was a Carver amp circa 1978. It used all analog circuitry to do the following (never actually heard the beast, but always wanted to implement this to see what it sounded like). Now, thanx to chuck, I have. I'm sure the original implementation didn't have randomly varying delay line lengths! <smile> The idea is that you feed the right channel back to the left inverted and with delay. Do the same to the left. Its supposed to cancel out the "crosstalk" between the channels thus subjectively "widening" the image. Try it with headphones. If you crank up the gain, then you'll hear it better through speakers. Thanx to the person who helped me with the inversion (sorry I forget your name, but you know who you are <smile>). Here's the code: // gain (higher produces more noticable effect) 0.4 => float gain; // whether to invert 1 => int invert; // delay time range 1.0 => float minDelay; 10.0 => float maxDelay; // sound file "music.wav" => string sourceFile; if (me.args()) me.arg(0) => sourceFile; // the patch SndBuf l, r; Step lInverted,rInverted; DelayL dl, dr; l => dac.left; if (invert) l => lInverted => dl => dac.right; else l => dl => dac.right; r => dac.right; if (invert) r => rInverted => dr => dac.left; else r => dr => dac.left; // set initial delay length, gain, and max delay times .2::second => dl.max => dr.max; 4::ms => dur lDelayTime => dur rDelayTime => dl.delay => dr.delay; gain => dl.gain => dr.gain; // load the file sourceFile => l.read; sourceFile => r.read; 1 => r.channel; // start the inverters if (invert) spork ~ inverter(l, lInverted); spork ~ inverter(r, rInverted); // time loop 0 => float whichDelay; while( true ) { .4::second => now; Math.rand2f(0,1) => whichDelay; //<<<whichDelay>>>; if (whichDelay > .5) { Math.rand2f(minDelay,maxDelay) * 1::ms => dl.delay; //<<<"left">>>; } else { Math.rand2f(minDelay,maxDelay) * 1::ms => dr.delay; //<<<"right">>>; } // which channel to affect } // main loop fun void inverter(UGen in, Step out){ while(true){ - in.last() => out.next; 1::samp => now; } }
Rich Caloggero wrote:
Try it with headphones. If you crank up the gain, then you'll hear it better through speakers.
We discussed this kind of effect over at linux audio user, and it seems that this effect is a very specialized effect, only applicable at the listeners end. This is not to discourage you, just to pass on advise from a person who's knowledge I respect (Fons Adriaensen). That said I'm gonna check your code out for sure, it sounds interesting!!! Me: "So the delay part is crucial and the result can be good? I don't understand how long the delay should be (although I know how fast sound travels and how far apart my ears are). Supposed I'm 10 meters away from a PA (speakers 10 meters apart), what should the delay be? What if I'm listening at home, 3 meters away from my home stereo (speakers 3 meters apart)?" Fons Adriaensen: "It's not supposed to work in those conditions. What you need is two speakers that you see in an angle of about 20 degrees (so much closer than normal), and a distance of around 2 to 3 meters. The 'sweet spot' is quite small. Two or more listeners should be behind each other, not besides. The required delay is very small, around 100 us." Me: "What if I'm listening through headphones?" Fons Adriaensen: "Bad idea ! Xtalk cancellation is used to *replace* headphones, while allowing the listener to turn his/her head w.r.t. the speakers. Allowing this makes the image much more 'real' than with headphones."
Thanx to the person who helped me with the inversion (sorry I forget your name, but you know who you are <smile>).
That would be me :-) -- peace, love & harmony Atte http://atte.dk | http://myspace.com/attejensen http://anagrammer.dk | http://modlys.dk
Wow, very cool. Will chuck do delays that short? I assume it probably has
more to do with the speed of the hardware than anything inherent about
chuck?
-- Rich
----- Original Message -----
From: "Atte André Jensen"
Try it with headphones. If you crank up the gain, then you'll hear it better through speakers.
We discussed this kind of effect over at linux audio user, and it seems that this effect is a very specialized effect, only applicable at the listeners end. This is not to discourage you, just to pass on advise from a person who's knowledge I respect (Fons Adriaensen). That said I'm gonna check your code out for sure, it sounds interesting!!! Me: "So the delay part is crucial and the result can be good? I don't understand how long the delay should be (although I know how fast sound travels and how far apart my ears are). Supposed I'm 10 meters away from a PA (speakers 10 meters apart), what should the delay be? What if I'm listening at home, 3 meters away from my home stereo (speakers 3 meters apart)?" Fons Adriaensen: "It's not supposed to work in those conditions. What you need is two speakers that you see in an angle of about 20 degrees (so much closer than normal), and a distance of around 2 to 3 meters. The 'sweet spot' is quite small. Two or more listeners should be behind each other, not besides. The required delay is very small, around 100 us." Me: "What if I'm listening through headphones?" Fons Adriaensen: "Bad idea ! Xtalk cancellation is used to *replace* headphones, while allowing the listener to turn his/her head w.r.t. the speakers. Allowing this makes the image much more 'real' than with headphones."
Thanx to the person who helped me with the inversion (sorry I forget your name, but you know who you are <smile>).
That would be me :-) -- peace, love & harmony Atte http://atte.dk | http://myspace.com/attejensen http://anagrammer.dk | http://modlys.dk _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
2008/5/29 Rich Caloggero
Wow, very cool. Will chuck do delays that short? I assume it probably has more to do with the speed of the hardware than anything inherent about chuck?
I think it will, delay lines need not be a integer multiple of 1::samp either, at least not for a interpolating delay (which we have). I'm not 100% sure what will happen if the delay length becomes less then a samp and you still want to use feedback. Feedback loops in ChucK Ugens will always add a single sample delay. You may have to fake this be putting a few delays in series. Delaylines aren't especially hard on the CPU, the main cost is probably the interpolation but I can't imagine why that would take more for extremely short delays. It'd be a different issue if you wanted delaylines considderably shorter then a samp with feedback in one Ugen. Clearly that would create a need to interpolate multiple times per sample and place some rather large demands on the quality of the interpolation. BTW, I'm rather surprised that this technique was used in a guitar amp; I thought the sweetspot was relatively small? Wouldn't that be unpractical for guitar amps? Yours, Kas.
BTW, I'm rather surprised that this technique was used in a guitar amp; I thought the sweetspot was relatively small? Wouldn't that be unpractical for guitar amps? No, this was a consumer stereo (hi-fi) amp made in the '70s. I think the designers (and companies) name was Carver (George Carver) or some such.
So I take it that 100 us
is 100 microseconds (the suggested delay for speakers placed 3 meters apart)? Sampling rate is aprox. 40k so 1 sample every 250 microseconds? So from what your saying, this means you'd need to interpelate 250 times per sample? Now that I think about it (outch this math stuff makes my brain hurt), what does it even mean to hae a delay smaller than the time between samples?
-- Rich
----- Original Message -----
From: Kassen
To: ChucK Users Mailing List
Sent: Thursday, May 29, 2008 12:56 PM
Subject: Re: [chuck-users] Interesting stereo widening effect
2008/5/29 Rich Caloggero
2008/5/29 Rich Caloggero
So I take it that 100 us is 100 microseconds (the suggested delay for speakers placed 3 meters apart)?
Yes, μs = microsecond == .001::ms I don't feel like doing math on the speed of sound right now but I do think that I keep hearing that with this technique you are supposed to keep the speakers close together and at 60° or something pointing outwards.
Sampling rate is aprox. 40k so 1 sample every 250 microseconds?
I think you are off; <<<(samp / ms) * 1000>>>; gets me 22.675737. Unless I'm confused (again!) that means 22.7 microseconds per sample.
So from what your saying, this means you'd need to interpelate 250 times per sample?
I think it's more like 23 but yes. You'd have to do that in the case that you'd have a interpolating delay Ugen with feedback built in, something I don't think we have. I'd put a few in series without feedback to get around this as you're likely using a amount of feedback that makes a impulse drop below the noise floor of your listening environment after a few iterations anyway.
Now that I think about it (outch this math stuff makes my brain hurt), what does it even mean to hae a delay smaller than the time between samples?
Well, obviously there is nothing "between" digital values... but the values represent a continuous wave so we can interpolate in the hope of figuring out what the value between two samples would be if it were there. Let's say we are a delay line and right now we are getting a value of .2 at our input and we know that a sample ago it was .1 ok? Assuming linear interpolation (for convenience sake) we could then say that half a sample ago we had a input of .15 We never actually saw that input, of cource, but we could still output .15 and pretend we got this half a sample ago as our unput. We'd still be able to calculate one such value every time the VM "ticked" us which is once per sample. I don't really see any big problem here, it's not harder then a delay of length 100000.5 samples and nobody frowns at those, I think. If we'd be expected to do feedback we'd have a problem because that would mean multiple passes to calculate a single sample.... Which is why I'd lean towards faking it and putting a few delaylines in series. I hope that helps. Actually I hope it was correct at all; I'm no certified DSP guru... Yours, Kas.
Is this list (Linux Audio Users) dead? THe archives stop in April 2007.
http://music.columbia.edu/pipermail/linux-audio-user/
Am I missing something?
----- Original Message -----
From: "Atte André Jensen"
Try it with headphones. If you crank up the gain, then you'll hear it better through speakers.
We discussed this kind of effect over at linux audio user, and it seems that this effect is a very specialized effect, only applicable at the listeners end. This is not to discourage you, just to pass on advise from a person who's knowledge I respect (Fons Adriaensen). That said I'm gonna check your code out for sure, it sounds interesting!!! Me: "So the delay part is crucial and the result can be good? I don't understand how long the delay should be (although I know how fast sound travels and how far apart my ears are). Supposed I'm 10 meters away from a PA (speakers 10 meters apart), what should the delay be? What if I'm listening at home, 3 meters away from my home stereo (speakers 3 meters apart)?" Fons Adriaensen: "It's not supposed to work in those conditions. What you need is two speakers that you see in an angle of about 20 degrees (so much closer than normal), and a distance of around 2 to 3 meters. The 'sweet spot' is quite small. Two or more listeners should be behind each other, not besides. The required delay is very small, around 100 us." Me: "What if I'm listening through headphones?" Fons Adriaensen: "Bad idea ! Xtalk cancellation is used to *replace* headphones, while allowing the listener to turn his/her head w.r.t. the speakers. Allowing this makes the image much more 'real' than with headphones."
Thanx to the person who helped me with the inversion (sorry I forget your name, but you know who you are <smile>).
That would be me :-) -- peace, love & harmony Atte http://atte.dk | http://myspace.com/attejensen http://anagrammer.dk | http://modlys.dk _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Rich Caloggero wrote:
Is this list (Linux Audio Users) dead? THe archives stop in April 2007. http://music.columbia.edu/pipermail/linux-audio-user/
It moved here: http://lists.linuxaudio.org/mailman/listinfo/linux-audio-user -- peace, love & harmony Atte http://atte.dk | http://myspace.com/attejensen http://anagrammer.dk | http://modlys.dk
participants (3)
-
Atte André Jensen
-
Kassen
-
Rich Caloggero