Logo

ZLB



Uncategorized


SC Hint #1 - reduce

Thursday, November 26th, 2009

A great way to apply a binary operator successively  to the elements of an array is to use reduce.

e.g.

[true,false,true].reduce('&&')
["This ","is ","a string."].reduce('++')

Guide to making Audio only DVDs with open-source tools in GNU/Linux

Wednesday, November 11th, 2009

Due to an upcoming release involving a DVD I’ve had to figure out how to make a dvd from a couple of multichannel tracks. I’m using a mac and I wanted to use open-source tools. The road wasn’t that easy to travel, so I’m posting my findings for other travelers in the brave new world of Linux.

1 - You will need to use dvd-author and some other tools. I tried to install them in osx, but it was just to difficult, in the end I decided to just make a virtual machine in parallels and install ubuntu 9.10.

2 - After installing ubuntu, install dvd-author (from ubuntu software center) and aften (from synaptic).

3 - The files should be multi-channel interleaved wavs. If you have them as mono files, interleave them on osx with de-interleave or use sox.

4 - In dvds the files always need audio and video, so you need to have a background image. For pal these can ben 720×576 png files.

5 - Put the png files and the wav files in a folder in ubuntu. They should be named dvd1.png, dvd2.png and dvd1.wav, dvd2.wav, etc.

6 - Depending on how many tracks you have to make a dvd.xml file for dvdauthor like this:

?Download dvd.xml
<dvdauthor>
    <vmgm />
    <titleset>
        <titles>
            <pgc>
                <vob file="dvd1.mpg" />
                <vob file="dvd2.mpg" />
                <!- etc -->
            </pgc>
        </titles>
    </titleset>
</dvdauthor>

7 - Then run this script on that folder and wait (one hour or so in my machine)

?Download builddvd.sh
#!/bin/bash
# Miguel Negrão 2009
 
for file in `ls *.png` ; do
 
echo "File is $file"
# name without extension
name=${file%\.*}
# number of samples in audio file
SAMPLES=`sox --info -s "$name".wav`
echo "Number of samples is $SAMPLES"
# number of corresponding pal frames
PALFRAMES=`expr $SAMPLES '/' 1920`
echo "Number of pal frames is $PALFRAMES"
 
echo "converting to ac3"
aften -b 448 -smix 2 -dsur 1 -acmod 6 -lfe 0 -xbsi1 1 -dmixmod 2 -lorosmix 2 "$name".wav "$name".ac3
 
echo "making m2v from png"
pngtopnm "$file" | ppmtoy4m -F 25:1 -A 59:54 -I p -n "$PALFRAMES" -S 420mpeg2 -r  | mpeg2enc -a 2 -n p -f 8 -v 2 -o "$name".m2v
 
echo "muxing m2v and ac3"
mplex -f 8 -o "$name".mpg "$name".m2v "$name".ac3
 
done
 
echo "Creating DVD structure"
dvdauthor -o DVDFOLDER -x dvd.xml

8 - to make a dvd image in osx that is compatible with dvd players type in the terminal:

 
hdiutil makehybrid -udf -udf-volume-name MYDVD 
-o MY_DVD.iso DVDFOLDER

What’s your stance on free will ?

Tuesday, June 2nd, 2009
  1. We have souls, but they’re a bunch of robots (strong AI).
  2. We have souls, but they’re a bunch of quantum robots.
  3. We don’t have souls, all is illusion.
  4. We have souls, but they do not respect the laws physics.

I’m currently divided between 1 and 2, but leaning towards nº1.

  To the question “How can something with free will (us) be made out of lots of things without free will (atoms, cells) ?” one can retort with “How can something alive (a cell) be made of lots of things which are not alive (atoms) ?”. Well the answer to the second case will hardly cause much problems for most people. Atoms through a process of evolution have entered into complex structures, the organization of which is what we call life. Well, Daniel Dennett argues that the same is true of free will: cells have entered into very complex structures the net result of which is the emergence of consciousness and free will. 

 The main question of determinism vs free will is: If the the future is totally determined by the past (determinism), then how can we decide to do anything, how can we be moral agents ?

   Now, the exact meaning of the future being determined by the past is a tricky concept. What it actually means is that should we think of time like the timeline of Cubase, if we bring the cursor to a previous point and press play the same events would happen again. In that sense our actions are determined, that is, if I would bring the cursor of time one year back in time I would do the exact same things I did. Since I accept determinism, I believe this conclusion is correct. But the point is that we can never bring the cursor back, and “conditions can never be the same”, therefore it is for all practical purposes irrelevant the fact that if the cursor went back we would do the same, because those decisions we’re in fact our decisions, and what we are is caused by millions of causes such as the physics that governs the universe, the evolution on our planet, the social and cultural place we we’re born, our particular experiences. So it’s true that we are the net result of those causes, but one of the net results of those causes is the fact that we have consciousness, and in the parlance of Dennett, the ability to avoid things. Therefore things are not inevitable, since we can avoid them, although they are determined nonetheless. This argument is somewhat mind boggling, and I’m still trying to grasp it entirely.


info_at_friendlyvirus.org
sales_at_friendlyvirus.org
www.myspace.com/friendlyvirus/