Csound Csound-dev Csound-tekno Search About

[Csnd] How to simulate a stereo file from a mono file.

Date2020-05-07 19:49
FromCsounder Csounder <0000017e1be09e0e-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] How to simulate a stereo file from a mono file.
Hi all,
i record sometimes with my smartphone. The file are mono, and i want to simulate a stereo recording. The sound should be "reflected'
by "virtual walls" to get deepness and the stereo effect. Is there an opcode that can do that? If not, may someone build some UDO for it?
I guess it's not difficult for any intermediate csound user. Thanks in advance!


Date2020-05-08 03:24
FromPete Goodeve
SubjectRe: [Csnd] How to simulate a stereo file from a mono file.
AttachmentsNone  

Date2020-05-08 08:54
FromOeyvind Brandtsegg
SubjectRe: [Csnd] How to simulate a stereo file from a mono file.
This is a stereoizer method I learned from Miller Puckette, and then implemented with Csound and Cabbage
In all its simplicity, the result is that frequency bands will be panned left and right alternately. The size of the frequency bands are determined by the delay time like this: 1000/Bw = Dt. E.g. a delay time of 5 ms gives alternating frequency bands every 200 Hz.
It is also mono compatible, if you collapse the stereo track to mono, the effect will cancel itself out.

<Cabbage>
form size(330, 150), caption("Stereoizer"), pluginID("ste1")
hslider channel("deltime"), bounds(10, 20, 300, 40), text("Deltime"), range(0, 20, 5)
hslider channel("amount"), bounds(10, 80, 300, 40), text("Amount"), range(0, 1, 0.7)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d
</CsOptions>
<CsInstruments>
ksmps = 64
nchnls = 2
0dbfs=1

instr 1
a1 inch 1
a2 inch 2
a1 = (a1+a2)*.4
kdelt chnget "deltime"
adelt interp kdelt
kamt chnget "amount"
;adelt = 10
adel vdelayx a1, adelt*0.001, 0.1, 4
aL = a1+(adel*kamt)
aR = a1-(adel*kamt)
outs aL, aR
endin

</CsInstruments>  
<CsScore>
i1 0 84600
</CsScore>
</CsoundSynthesizer>

fre. 8. mai 2020 kl. 04:24 skrev Pete Goodeve <pete.goodeve@computer.org>:
On Thu, May 07, 2020 at 06:49:16PM +0000, Csounder Csounder wrote:
> Hi all,i record sometimes with my smartphone. The file are mono, and i want to simulate a stereo recording. The sound should be "reflected'by "virtual walls" to get deepness and the stereo effect. Is there an opcode that can do that? If not, may someone build some UDO for it?I guess it's not difficult for any intermediate csound user. Thanks in advance!

Hi,

A couple of suggestions....  You might find that a simple stereo
reverb is good enough.  I've used 'reverbsc', which I've found sounds
pretty good when applied to, say, my "Hammond" CSD.  There's
also 'freeverb', which has an explicit 'room-size' parameter.

If you want more explicit 'reflections from walls' you could use one
or more delay lines, with the delay based on the distance of the
wall from the source and you.  You'd probably want to feed that
into a reverb, too, to reflect the real world.  If the 'wall' is on the
left, you could only feed the left input of the reverb opcode, and
similarly for the right wall.  (Never tried anything like that, but it
sounds plausible... (:-))

Just some ideas.

        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-05-08 12:44
From"Jeanette C."
SubjectRe: [Csnd] How to simulate a stereo file from a mono file.
May 8 2020, Oeyvind Brandtsegg has written:
...
> In all its simplicity, the result is that frequency bands will be panned
> left and right alternately. The size of the frequency bands are determined
> by the delay time like this: 1000/Bw = Dt. E.g. a delay time of 5 ms gives
> alternating frequency bands every 200 Hz.
This is a nice one. It's sounds like a by-product of mid/side
processing.

I'm not sure if this is an "approved" use, but the hilbert filter also
works and also appears to be mono compatible.
...
instr Play
   a1 soundin "file.wav"
   al, ar hilbert a1
   outs al, ar
endin

Best wishes,

Jeanette
> It is also mono compatible, if you collapse the stereo track to mono, the
> effect will cancel itself out.
>
> 
> form size(330, 150), caption("Stereoizer"), pluginID("ste1")
> hslider channel("deltime"), bounds(10, 20, 300, 40), text("Deltime"),
> range(0, 20, 5)
> hslider channel("amount"), bounds(10, 80, 300, 40), text("Amount"),
> range(0, 1, 0.7)
> 
> 
> 
> -n -d
> 
> 
> ksmps = 64
> nchnls = 2
> 0dbfs=1
>
> instr 1
> a1 inch 1
> a2 inch 2
> a1 = (a1+a2)*.4
> kdelt chnget "deltime"
> adelt interp kdelt
> kamt chnget "amount"
> ;adelt = 10
> adel vdelayx a1, adelt*0.001, 0.1, 4
> aL = a1+(adel*kamt)
> aR = a1-(adel*kamt)
> outs aL, aR
> endin
>
> 
> 
> i1 0 84600
> 
> 
>
> fre. 8. mai 2020 kl. 04:24 skrev Pete Goodeve :
>
>> On Thu, May 07, 2020 at 06:49:16PM +0000, Csounder Csounder wrote:
>>> Hi all,i record sometimes with my smartphone. The file are mono, and i
>> want to simulate a stereo recording. The sound should be "reflected'by
>> "virtual walls" to get deepness and the stereo effect. Is there an opcode
>> that can do that? If not, may someone build some UDO for it?I guess it's
>> not difficult for any intermediate csound user. Thanks in advance!
>>
>> Hi,
>>
>> A couple of suggestions....  You might find that a simple stereo
>> reverb is good enough.  I've used 'reverbsc', which I've found sounds
>> pretty good when applied to, say, my "Hammond" CSD.  There's
>> also 'freeverb', which has an explicit 'room-size' parameter.
>>
>> If you want more explicit 'reflections from walls' you could use one
>> or more delay lines, with the delay based on the distance of the
>> wall from the source and you.  You'd probably want to feed that
>> into a reverb, too, to reflect the real world.  If the 'wall' is on the
>> left, you could only feed the left input of the reverb opcode, and
>> similarly for the right wall.  (Never tried anything like that, but it
>> sounds plausible... (:-))
>>
>> Just some ideas.
>>
>>         -- Pete --
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>>
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

And when you say those words
It's the sweetest thing I've ever heard <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-05-09 13:24
Fromcsoundercsounder <0000017e1be09e0e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] How to simulate a stereo file from a mono file.
please can you adapt the cabbage code to a .csd code, runnable in csound?
(csoundqt or whatever editor)



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-05-09 15:55
FromRichard Knight
SubjectRe: [Csnd] How to simulate a stereo file from a mono file.

there are four approaches pseudo-stereo techniques in the Csound journal here which may be of interest:
http://www.csounds.com/journal/issue14/PseudoStereo.html

 


Date2020-05-09 19:40
FromPete Goodeve
SubjectRe: [Csnd] How to simulate a stereo file from a mono file.
AttachmentsNone