Please login or register. December 14, 2018, 10:23:47 AM

Author Topic: from stereo to multi-channel  (Read 12929 times)

Coeur Noir

  • Jr. Member
  • ***
  • Posts: 77
    • View Profile
from stereo to multi-channel
« on: November 26, 2011, 08:30:06 AM »
Hello !

I'm still trying to find a "clean" way to make 5.1 sound with audacity or sox. My best attempt is to distribute frequency range channel by channel...

But googling over internet I've found this page :

http://harpex.net/convert.html

and this one http://harpex.net/licensing.html that might be interesting for developers - which I'm not.

It converts your 2.0 source to a multi-channel file. Source must be less than 50 Mb - enough for short content - as its a trial purpose for a commercial product. No "watermarking" in result.

Use the Quad Diagonal Blumlein pair or Back-to-back cardioids or X/Y pair as input - according to my ears X/Y pair suits very well for "cinema".

If U know other open-source way for this kind of processing, I am very curious !

jonathanj

  • Full Member
  • ****
  • Posts: 110
    • View Profile
Re: from stereo to multi-channel
« Reply #1 on: November 28, 2011, 08:07:25 AM »
I've been researching a bit on this topic, but haven't found anything that creates something really useful.
You could take a look at the 'BeHappy' tool though: http://forum.doom9.org/showthread.php?t=104686
There are some presets for creating fake 5.1 from stereo. The 'MultiSonic' one is one of the better ones...

I also found this guide, though I couldn't make it work...
http://originaltrilogy.com/forum/topic.cfm/Doctor-Ms-Stereo-to-51-Dolby-Prologic-II-Upmix-Guide/topic/11546/

Coeur Noir

  • Jr. Member
  • ***
  • Posts: 77
    • View Profile
Re: from stereo to multi-channel
« Reply #2 on: November 30, 2011, 06:37:19 AM »
Thanx ! I'll try to try... Too bad I have to go back to M$Windows...

jonathanj

  • Full Member
  • ****
  • Posts: 110
    • View Profile
Re: from stereo to multi-channel
« Reply #3 on: November 30, 2011, 12:17:18 PM »
check this guide here...
http://forum.videohelp.com/threads/335904-How-to-Convert-2-channel-stereo-wave-into-DD5-1-AC3-448-AC-640

Specially the sox sample code part and this part aswell:

Code: [Select]
4) DOLBY PROLOGIC-II ORIGINAL UPMIX MATRIX (As per Specification)
===============================================
LEFT CHANNEL = AS IS
RIGHT CHANNEL = AS IS
CENTER CHANNEL = (0.7071 LEFT CHANNEL + 0.7071 RIGHT CHANNEL) BANDPASS 70 20000
LFE CHANNEL = (0.7071 LEFT CHANNEL + 0.7071 RIGHT CHANNEL) LOWPASS FILTER 120
REAR LEFT CHANNEL = 0.8718 LT CH WITH -90 DEG PHASE SHIFT + 0.4898 RT CH WITH +90 DEG PHASE SHIFT
REAR RIGHT CHANNEL = 0.4898 LT CH WITH -90 DEG PHASE SHIFT + 0.8718 RT CH WITH +90 DEG PHASE SHIFT

Coeur Noir

  • Jr. Member
  • ***
  • Posts: 77
    • View Profile
Re: from stereo to multi-channel
« Reply #4 on: November 30, 2011, 04:30:02 PM »
ooow many thanks ! I really have to read carefully and experiment - I'm not that comfortable with english, alas. But this is exactly kind of examples I was looking for about sOx !

jaminmc

  • New Member
  • **
  • Posts: 1
    • View Profile
Re: from stereo to multi-channel
« Reply #5 on: July 19, 2013, 03:23:23 PM »
I have sox installed on my mac through macports (sudo port install sox)

I made this script that makes stems, and a multi channel wav. I use this to make 5.1 for DCP's that I need to make that the source I had only was stereo.

I saved this as /bin/st251, then did a "sudo chmod +x /bin/st251". Now it works in the terminal by typing in st251 and dragging the stereo aiff or wave file to the terminal. It will work with multiple files, so it is great for batching.
Code: [Select]
#!/bin/sh
for i in "[email protected]";
do
if [ ${i: -4} == ".wav" ] ; then
OUT51="${i%.wav}"
echo "Converting $i to Surround stems."
# create front channel
sox -S -V -v .99 "$i" "$OUT51"front.wav sinc 20-20000
# Seperate Left and Richt
sox -S -V "$OUT51"front.wav "$OUT51"-L2.wav remix 1
sox -S -V "$OUT51"front.wav "$OUT51"-R2.wav remix 2
# create mono for processing
sox -S -V "$OUT51"front.wav "$OUT51"-C.wav remix -m 1v0.5,2v0.5
#create front Left and right by the difference from the mono
sox -S -V -M "$OUT51"-L2.wav "$OUT51"-C.wav "$OUT51"-L.wav remix -m 1v1,2v-.75
sox -S -V -M "$OUT51"-R2.wav "$OUT51"-C.wav "$OUT51"-R.wav remix -m 1v1,2v-.75
#create the center from what is missing in Left and right channels
sox -S -V -M "$OUT51"-L2.wav "$OUT51"-L.wav "$OUT51"centerL.wav remix -m 1v1,2v-1
sox -S -V -M "$OUT51"-R2.wav "$OUT51"-R.wav "$OUT51"centerR.wav remix -m 1v1,2v-1
sox -S -V -m -v .5 "$OUT51"centerL.wav "$OUT51"centerR.wav "$OUT51"-C.wav

#create our rear work file
sox -S -V -v .99 "$i" "$OUT51"rear.wav sinc 100-7000

# Make our rear channels
sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Ls.wav remix -m 1v-0.8718,2v0.4898 delay 0.03
sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Rs.wav remix -m 1v0.4898,2v-0.8718 delay 0.03
#Make our LFE Channel
sox -S -V -v -0.5 "$i" -c 1 "$OUT51"-LFE.wav lowpass 120 remix -

#Make a Merged file. L R C LFE Ls Rs
sox -S -V -M "$OUT51"-L.wav "$OUT51"-R.wav "$OUT51"-C.wav "$OUT51"-LFE.wav "$OUT51"-Ls.wav "$OUT51"-Rs.wav  "$OUT51"-5.1.wav
#Cleanup
rm "$OUT51"front.wav "$OUT51"rear.wav "$OUT51"-L2.wav "$OUT51"-R2.wav "$OUT51"centerL.wav "$OUT51"centerR.wav
elif [ ${i: -4} == ".WAV" ] ; then
OUT51="${i%.WAV}"
echo "Converting $i to Surround stems."
# create front channel
sox -S -V -v .99 "$i" "$OUT51"front.wav sinc 20-20000
# Seperate Left and Richt
sox -S -V "$OUT51"front.wav "$OUT51"-L2.wav remix 1
sox -S -V "$OUT51"front.wav "$OUT51"-R2.wav remix 2
# create mono for processing
sox -S -V "$OUT51"front.wav "$OUT51"-C.wav remix -m 1v0.5,2v0.5
#create front Left and right by the difference from the mono
sox -S -V -M "$OUT51"-L2.wav "$OUT51"-C.wav "$OUT51"-L.wav remix -m 1v1,2v-.75
sox -S -V -M "$OUT51"-R2.wav "$OUT51"-C.wav "$OUT51"-R.wav remix -m 1v1,2v-.75
#create the center from what is missing in Left and right channels
sox -S -V -M "$OUT51"-L2.wav "$OUT51"-L.wav "$OUT51"centerL.wav remix -m 1v1,2v-1
sox -S -V -M "$OUT51"-R2.wav "$OUT51"-R.wav "$OUT51"centerR.wav remix -m 1v1,2v-1
sox -S -V -m -v .5 "$OUT51"centerL.wav "$OUT51"centerR.wav "$OUT51"-C.wav

#create our rear work file
sox -S -V -v .99 "$i" "$OUT51"rear.wav sinc 100-7000

# Make our rear channels
sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Ls.wav remix -m 1v-0.8718,2v0.4898 delay 0.03
sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Rs.wav remix -m 1v0.4898,2v-0.8718 delay 0.03
#Make our LFE Channel
sox -S -V -v -0.5 "$i" -c 1 "$OUT51"-LFE.wav lowpass 120 remix -

#Make a Merged file. L R C LFE Ls Rs
sox -S -V -M "$OUT51"-L.wav "$OUT51"-R.wav "$OUT51"-C.wav "$OUT51"-LFE.wav "$OUT51"-Ls.wav "$OUT51"-Rs.wav  "$OUT51"-5.1.wav
#Cleanup
rm "$OUT51"front.wav "$OUT51"rear.wav "$OUT51"-L2.wav "$OUT51"-R2.wav "$OUT51"centerL.wav "$OUT51"centerR.wav
elif [ ${i: -4} == ".aif" ] ; then
OUT51="${i%.aif}"
echo "Converting $i to Surround stems."
# create front channel
sox -S -V -v .99 "$i" "$OUT51"front.wav sinc 20-20000
# Seperate Left and Richt
sox -S -V "$OUT51"front.wav "$OUT51"-L2.wav remix 1
sox -S -V "$OUT51"front.wav "$OUT51"-R2.wav remix 2
# create mono for processing
sox -S -V "$OUT51"front.wav "$OUT51"-C.wav remix -m 1v0.5,2v0.5
#create front Left and right by the difference from the mono
sox -S -V -M "$OUT51"-L2.wav "$OUT51"-C.wav "$OUT51"-L.wav remix -m 1v1,2v-.75
sox -S -V -M "$OUT51"-R2.wav "$OUT51"-C.wav "$OUT51"-R.wav remix -m 1v1,2v-.75
#create the center from what is missing in Left and right channels
sox -S -V -M "$OUT51"-L2.wav "$OUT51"-L.wav "$OUT51"centerL.wav remix -m 1v1,2v-1
sox -S -V -M "$OUT51"-R2.wav "$OUT51"-R.wav "$OUT51"centerR.wav remix -m 1v1,2v-1
sox -S -V -m -v .5 "$OUT51"centerL.wav "$OUT51"centerR.wav "$OUT51"-C.wav

#create our rear work file
sox -S -V -v .99 "$i" "$OUT51"rear.wav sinc 100-7000

# Make our rear channels
sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Ls.wav remix -m 1v-0.8718,2v0.4898 delay 0.03
sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Rs.wav remix -m 1v0.4898,2v-0.8718 delay 0.03
#Make our LFE Channel
sox -S -V -v -0.5 "$i" -c 1 "$OUT51"-LFE.wav lowpass 120 remix -

#Make a Merged file. L R C LFE Ls Rs
sox -S -V -M "$OUT51"-L.wav "$OUT51"-R.wav "$OUT51"-C.wav "$OUT51"-LFE.wav "$OUT51"-Ls.wav "$OUT51"-Rs.wav  "$OUT51"-5.1.wav
#Cleanup
rm "$OUT51"front.wav "$OUT51"rear.wav "$OUT51"-L2.wav "$OUT51"-R2.wav "$OUT51"centerL.wav "$OUT51"centerR.wav
elif [ ${i: -5} == ".aiff" ] ; then
OUT51="${i%.aiff}"
echo "Converting $i to Surround stems."
# create front channel
sox -S -V -v .99 "$i" "$OUT51"front.wav sinc 20-20000
# Seperate Left and Richt
sox -S -V "$OUT51"front.wav "$OUT51"-L2.wav remix 1
sox -S -V "$OUT51"front.wav "$OUT51"-R2.wav remix 2
# create mono for processing
sox -S -V "$OUT51"front.wav "$OUT51"-C.wav remix -m 1v0.5,2v0.5
#create front Left and right by the difference from the mono
sox -S -V -M "$OUT51"-L2.wav "$OUT51"-C.wav "$OUT51"-L.wav remix -m 1v1,2v-.75
sox -S -V -M "$OUT51"-R2.wav "$OUT51"-C.wav "$OUT51"-R.wav remix -m 1v1,2v-.75
#create the center from what is missing in Left and right channels
sox -S -V -M "$OUT51"-L2.wav "$OUT51"-L.wav "$OUT51"centerL.wav remix -m 1v1,2v-1
sox -S -V -M "$OUT51"-R2.wav "$OUT51"-R.wav "$OUT51"centerR.wav remix -m 1v1,2v-1
sox -S -V -m -v .5 "$OUT51"centerL.wav "$OUT51"centerR.wav "$OUT51"-C.wav

#create our rear work file
sox -S -V -v .99 "$i" "$OUT51"rear.wav sinc 100-7000

# Make our rear channels
sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Ls.wav remix -m 1v-0.8718,2v0.4898 delay 0.03
sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Rs.wav remix -m 1v0.4898,2v-0.8718 delay 0.03
#Make our LFE Channel
sox -S -V -v -0.5 "$i" -c 1 "$OUT51"-LFE.wav lowpass 120 remix -

#Make a Merged file. L R C LFE Ls Rs
sox -S -V -M "$OUT51"-L.wav "$OUT51"-R.wav "$OUT51"-C.wav "$OUT51"-LFE.wav "$OUT51"-Ls.wav "$OUT51"-Rs.wav  "$OUT51"-5.1.wav
#Cleanup
rm "$OUT51"front.wav "$OUT51"rear.wav "$OUT51"-L2.wav "$OUT51"-R2.wav "$OUT51"centerL.wav "$OUT51"centerR.wav
elif [ ${i: -4} == ".AIF" ] ; then
OUT51="${i%.AIF}"
echo "Converting $i to Surround stems."
# create front channel
sox -S -V -v .99 "$i" "$OUT51"front.wav sinc 20-20000
# Seperate Left and Richt
sox -S -V "$OUT51"front.wav "$OUT51"-L2.wav remix 1
sox -S -V "$OUT51"front.wav "$OUT51"-R2.wav remix 2
# create mono for processing
sox -S -V "$OUT51"front.wav "$OUT51"-C.wav remix -m 1v0.5,2v0.5
#create front Left and right by the difference from the mono
sox -S -V -M "$OUT51"-L2.wav "$OUT51"-C.wav "$OUT51"-L.wav remix -m 1v1,2v-.75
sox -S -V -M "$OUT51"-R2.wav "$OUT51"-C.wav "$OUT51"-R.wav remix -m 1v1,2v-.75
#create the center from what is missing in Left and right channels
sox -S -V -M "$OUT51"-L2.wav "$OUT51"-L.wav "$OUT51"centerL.wav remix -m 1v1,2v-1
sox -S -V -M "$OUT51"-R2.wav "$OUT51"-R.wav "$OUT51"centerR.wav remix -m 1v1,2v-1
sox -S -V -m -v .5 "$OUT51"centerL.wav "$OUT51"centerR.wav "$OUT51"-C.wav

#create our rear work file
sox -S -V -v .99 "$i" "$OUT51"rear.wav sinc 100-7000

# Make our rear channels
sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Ls.wav remix -m 1v-0.8718,2v0.4898 delay 0.03
sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Rs.wav remix -m 1v0.4898,2v-0.8718 delay 0.03
#Make our LFE Channel
sox -S -V -v -0.5 "$i" -c 1 "$OUT51"-LFE.wav lowpass 120 remix -

#Make a Merged file. L R C LFE Ls Rs
sox -S -V -M "$OUT51"-L.wav "$OUT51"-R.wav "$OUT51"-C.wav "$OUT51"-LFE.wav "$OUT51"-Ls.wav "$OUT51"-Rs.wav  "$OUT51"-5.1.wav
#Cleanup
rm "$OUT51"front.wav "$OUT51"rear.wav "$OUT51"-L2.wav "$OUT51"-R2.wav "$OUT51"centerL.wav "$OUT51"centerR.wav
else
echo "$i is not Supported. Please use either a stereo AIF or wave file."
fi

done

tergy

  • New Member
  • **
  • Posts: 12
    • View Profile
Re: from stereo to multi-channel
« Reply #6 on: July 20, 2013, 09:03:17 PM »
here is an article on upmixing for DCP
http://www.knuterikevensen.com/?p=732

Lars_G

  • New Member
  • **
  • Posts: 16
    • View Profile
Re: from stereo to multi-channel
« Reply #7 on: June 19, 2014, 11:19:20 AM »
I have sox installed on my mac through macports (sudo port install sox)

I made this script that makes stems, and a multi channel wav. I use this to make 5.1 for DCP's that I need to make that the source I had only was stereo.

I saved this as /bin/st251, then did a "sudo chmod +x /bin/st251". Now it works in the terminal by typing in st251 and dragging the stereo aiff or wave file to the terminal. It will work with multiple files, so it is great for batching.

A) Wouldn't it be "saner" to bandpass Center to 800Hz-4K as to accentuate vocal space?

B) DRY: Don't Repeat Yourself, it's a nice coding cleanly and reusing code concept I learned doing web sites in Ruby:

Code: [Select]
#!/bin/sh
for i in "[email protected]";
do
        if [ ${i: -4} == ".wav" ] ; then
                OUT51="${i%.wav}"
        elif [ ${i: -4} == ".WAV" ] ; then
                OUT51="${i%.WAV}"
        elif [ ${i: -4} == ".aif" ] ; then
                OUT51="${i%.aif}"
        elif [ ${i: -5} == ".aiff" ] ; then
                OUT51="${i%.aiff}"
        elif [ ${i: -4} == ".AIF" ] ; then
                OUT51="${i%.AIF}"
        else
                echo "$i is not Supported. Please use either a stereo AIF or wave file."
                exit
        fi

        echo "Converting $i to Surround stems."
        # create front channel
        sox -S -V -v .99 "$i" "$OUT51"front.wav sinc 20-20000
        # Seperate Left and Richt
        sox -S -V "$OUT51"front.wav "$OUT51"-L2.wav remix 1
        sox -S -V "$OUT51"front.wav "$OUT51"-R2.wav remix 2
        # create mono for processing
        sox -S -V "$OUT51"front.wav "$OUT51"-C.wav remix -m 1v0.5,2v0.5
        #create front Left and right by the difference from the mono
        sox -S -V -M "$OUT51"-L2.wav "$OUT51"-C.wav "$OUT51"-L.wav remix -m 1v1,2v-.75
        sox -S -V -M "$OUT51"-R2.wav "$OUT51"-C.wav "$OUT51"-R.wav remix -m 1v1,2v-.75
        #create the center from what is missing in Left and right channels
        sox -S -V -M "$OUT51"-L2.wav "$OUT51"-L.wav "$OUT51"centerL.wav remix -m 1v1,2v-1
        sox -S -V -M "$OUT51"-R2.wav "$OUT51"-R.wav "$OUT51"centerR.wav remix -m 1v1,2v-1
        sox -S -V -m -v .5 "$OUT51"centerL.wav "$OUT51"centerR.wav "$OUT51"-C.wav

        #create our rear work file
        sox -S -V -v .99 "$i" "$OUT51"rear.wav sinc 100-7000

        # Make our rear channels
        sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Ls.wav remix -m 1v-0.8718,2v0.4898 delay 0.03
        sox -S -V -v -0.5 "$OUT51"rear.wav "$OUT51"-Rs.wav remix -m 1v0.4898,2v-0.8718 delay 0.03
        #Make our LFE Channel
        sox -S -V -v -0.5 "$i" -c 1 "$OUT51"-LFE.wav lowpass 120 remix -       

        #Make a Merged file. L R C LFE Ls Rs
        sox -S -V -M "$OUT51"-L.wav "$OUT51"-R.wav "$OUT51"-C.wav "$OUT51"-LFE.wav "$OUT51"-Ls.wav "$OUT51"-Rs.wav  "$OUT51"-5.1.wav
        #Cleanup
        rm "$OUT51"front.wav "$OUT51"rear.wav "$OUT51"-L2.wav "$OUT51"-R2.wav "$OUT51"centerL.wav "$OUT51"centerR.wav
       
done

dcinemaforum.com

Re: from stereo to multi-channel
« Reply #7 on: June 19, 2014, 11:19:20 AM »