Categories

Elsewhere

Development Log




DevLog.120117_Userstyle for stylish for launchpad - improved dark-grey version

@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("launchpad.net") {


html, body, h1, h2, h3, h4, h5, .side .portlet, .results, li, table.listing thead th, table.listing tr.thead th, table.listing td, .boardCommentDetails, .boardBugActivityBody, .message, #duplicate-actions, .upper-batch-nav, .lower-batch-nav {
    background: #383838 !important;
    color: silver !important;
}


.watermark-apps-portlet li a:link, .watermark-apps-portlet li a:visited, .footer .lp-arcana {
    background: #333 !important;
    color: #ee6 !important;
}

a {
    color:#aae !important;
}


table {
    border:black !important;
}


.version, .released {
    background: #777 !important;
}

.latest-announcement {
    background: #555 !important;
}

}

simple install into stylish and updates be at http://userstyles.org/styles/59554/launchpad-dark-grey





DevLog.110922 SenseStage in SuperCollider - newbie stumbling

// so the problem at the moment is that i don't know how to get
// running data from a bus into the synthDef - more specifically
// data on the bus which is a list of three value (array?) [1,2,3]

y = SWDataNetworkClient( "localhost", "NovaSC"); // create client
y.subscribeNode(1); // subscribe to a DN node which is a miniBee with accel. sensors
m = y.nodes[1]; // assign node 1 to a variable m
m.createBus; // put data coming from node 1 into a bus
m.value; // returns three values.

// how to use them in here:
(
        SynthDef(\ThreeWF, { |freq1=0.5, freq2=1, freq3=2, amp=0.05|
                Out.ar([0,1],
                        SinOsc.ar(freq1 * 1000 - 300, 0, [amp,0]) +
                        SinOsc.ar(freq2 * 1000 - 300, 0, [0,amp]) +
                        SinOsc.ar(freq3 * 1000 - 300, 0, [amp,amp])
                );
        }).send(s)
)

i = Synth(\ThreeWF);

i.map(\freq1, m.bus); // this maps three values automatically to
                      // all three parameters \freq1 \freq2 \freq3, why?
                      // are they automatically mapped to further arguments of \ThreeWF?
                      // how can i map a single index to a single argument??

// these are traditional
i.set(\freq1, 0.6);
i.set(\freq2, 1);
i.set(\freq3, 2);
i.set(\amp,0.05);

// and:
i.free; // this works.
y.free; // this has no visible effect?
m.free; // this as well.
 





DevLog.110907 bash script to download clips from the camera, recode, and upload

I wrote this little bash script so that it automatically (in one go) sends clips from camera to an online location.


#!/bin/bash
# a script to download clips from camera, convert them and uploads them to server

# cleanup
mv -v *.mts mts/



# copy all MTS clips to harddrive

cd /media/CAM_MEM/AVCHD/BDMV/STREAM/
echo; echo "now working in" `pwd` "..."; echo; echo "copying ..."

for i in *.MTS
do
        cp -v $i /media/2T-1/111104_sramota_cont_docu/shame_rehearsal_`stat -c %y $i | sed 's/.000000000 +0200//g' | sed 's/:/_/g' | sed 's/ /__/'`.mts;
done


# go to working dir.
cd /media/2T-1/111104_sramota_cont_docu/

echo
echo "now working in" `pwd` "..."
echo



# convert upload and move away


for i in *.mts
do
        # convert to theora
        /home/random/bin/ffmpeg2theora.linux -v 10 -x 512 -y 288 $i

        ( # upload in the background
        scp `echo $i | sed 's/.mts/.ogv/'` luka@skylined.org:/home/www/emanat.si/var/shame/.
        # cleanup
        mv -v `echo $i | sed 's/.mts/.ogv/'` ogv/
        ) &

        # convert to flv
        ffmpeg -i $i -s 512x288 -g 160 -cmp dct -subcmp dct -mbd 2 -flags +aic+cbp+mv0+mv4 -trellis 1 -ar 44100 -ac 2 -b 1200kb `echo $i | sed 's/.mts/.flv/'`

        ( # upload
        scp `echo $i | sed 's/.mts/.flv/'` luka@skylined.org:/home/www/emanat.si/var/shame/.
        # cleanup
        mv -v `echo $i | sed 's/.mts/.flv/'` flv/
        ) &

        mv $i mts/

done


echo
echo
echo "seems like done!"
echo
echo


 

filed under DevelopmentLog Bash Tricks Video





DevLog.110710 thoughts about 21st century literacy

be literate in 21st century = know programming languages


filed under SkizoMachines





DevLog.110708 SuperCollider Highlighting in GeSHi and more

Sourceblock GeSHi For SuperCollider

testing sc syntax highlighting with new GeSHi file

lang=supercollider by way of http://www.listarc.bham.ac.uk/lists/sc-users-2006/msg06298.html


// trying again:
(
{
        var rate = Line.kr(1,10,60) , carrier, modRatio, env; // declare variables
        carrier = LFNoise0.kr(rate) * 500 + 700;
        modRatio = MouseX.kr (1, 2.0);
        env = Linen.kr(gate:Impulse.kr(rate), attackTime:(1/(rate+1)), susLevel:0.5,releaseTime:0);
        PMOsc.ar(carrier, carrier*modRatio, Line.kr(1,12,20), mul:env) * 0.3
}.play
)
// this works to a degree
 

lang=c


// trying again:
(
{
        var rate = Line.kr(1,10,60) , carrier, modRatio, env; // declare variables
        carrier = LFNoise0.kr(rate) * 500 + 700;
        modRatio = MouseX.kr (1, 2.0);
        env = Linen.kr(gate:Impulse.kr(rate), attackTime:(1/(rate+1)), susLevel:0.5,releaseTime:0);
        PMOsc.ar(carrier, carrier*modRatio, Line.kr(1,12,20), mul:env) * 0.3
}.play
)
// this works to a degree
 

lang=sclang (modified c with keywords from supercollider.php


// trying again:
(
{
        var rate = Line.kr(1,10,60) , carrier, modRatio, env; // declare variables
        carrier = LFNoise0.kr(rate) * 500 + 700;
        modRatio = MouseX.kr (1, 2.0);
        env = Linen.kr(gate:Impulse.kr(rate), attackTime:(1/(rate+1)), susLevel:0.5,releaseTime:0);
        PMOsc.ar(carrier, carrier*modRatio, Line.kr(1,12,20), mul:env) * 0.3
}.play
)
// this works to a degree
 

So this is the php file for GeSHi: /w/pub/sclang.php.txt

more...


+

http://thread.gmane.org/gmane.comp.audio.supercollider.user/75213


filed under SuperCollider DevelopmentLog





DevLog.110707 Xkb Slovene keyboard trick

worked this out today, finally: Documentation.XkbXorgGnomeSloveneKeyboardLayouts:

I like to have a simple US programmers keyboard with added slovenian letters and euroSign using right Alt/Gr. The simplest thing to do is to modify one of the already existing keyboard layouts. I took /usr/share/X11/xkb/symbols and changed the variant name[Group1]= "Slovenia - US keyboard with Slovene letters"; to

partial alphanumeric_keys
xkb_symbols "us" {

    name[Group1]= "Slovenia - US keyboard with Slovene letters";

    include "us"

    key <AD01> { [    any,    any,      backslash               ] };
    key <AD02> { [    any,    any,      bar                     ] };
    key <AD03> { [    any,    any,      EuroSign                ] };
    key <AD06> { [    any,    any,      z,              Z       ] };
    key <AD11> { [    any,    any,      scaron,         Scaron  ] };
    key <AD12> { [    any,    any,      dstroke,        Dstroke ] };
    key <AC04> { [    any,    any,      bracketleft             ] };
    key <AC05> { [    any,    any,      bracketright            ] };
    key <AC08> { [    any,    any,      lstroke                 ] };
    key <AC09> { [    any,    any,      Lstroke                 ] };
    key <AC10> { [    any,    any,      ccaron,         Ccaron  ] };
    key <AC11> { [    any,    any,      cacute,         Cacute  ] };
    key <LSGT> { [    any,    any,      bar                     ] };
    key <AB01> { [    any,    any,      y,              Y       ] };
    key <AB04> { [    any,    any,      at                      ] };
    key <AB05> { [    any,    any,      braceleft               ] };
    key <AB06> { [    any,    any,      braceright              ] };
    key <AB07> { [    any,    any,      section                 ] };
    key <AB08> { [    any,    any,      semicolon               ] };
    key <AB09> { [    any,    any,      colon                   ] };
    key <AB10> { [    any,    any,      minus,    underscore    ] };
    key <BKSL> { [    any,    any,      zcaron,     Zcaron      ] };
    key <AB03> { [    any,    any,      ccaron,         Ccaron  ] };
    key <AC02> { [    any,    any,      scaron,         Scaron  ] };
    key <AB01> { [    any,    any,      zcaron,     Zcaron      ] };

    include "level3(ralt_switch)"

};

This way i have slovenian čšžČŠŽ available on AltGr+csz and also on AltGr+;[\ . Also pipe (|) is available at the usual US-key place and also as AltGr-w.





DevLog.110707 SuperCollider Basic Learning

Some fun with SC while I'm stumbling over the first chapter of the SC book.

(
~newsynth = {
        var carrier, modulator, modindex;
        carrier = LFTri.kr([0.1,0.2], 300, 300);
        modulator = SinOsc.kr(0.15, 200, 400);
        modindex = SinOsc.kr(0.05,1,100);
        CombN.ar(
                PMOsc.ar(carfreq: carrier, modfreq: modulator, pmindex: modindex)
                *
                LFPulse.kr([Line.kr(1,10,60),Line.kr(15,2,50)])*0.3,
                1,0.3,2
        );
}.play
)

from Wikipedia:Phase Modulation:

Unlike its more popular counterpart, frequency modulation (FM), PM is not very widely used for radio transmissions. This is because it tends to require more complex receiving hardware and there can be ambiguity problems in determining whether, for example, the signal has changed phase by +180° or -180°. PM is used, however, in digital music synthesizers such as the Yamaha DX7, even though these instruments are usually referred to as "FM" synthesizers (both modulation types sound very similar, but PM is usually easier to implement in this area).

// to understand PM modulation a bit better (in comparison with FM)

// basic FM:
{SinOsc.ar(freq:[440,880],mul:0.5)}.play // test carrier frequency
{SinOsc.ar(freq:SinOsc.kr(freq:20,mul:200,add:100),mul:0.5)}.play // FM
// "classic" FM, a sinewave oscilator's freq
// is modulated with another sinewave oscilator oscilating with 20Hz, sample values
// multiplied by 200 (from -200 to 200) and offset by 100 (from -100 to 300)
// at 0.5 volume

// crude phase modulation:
{SinOsc.ar(freq:1, phase:SinOsc.kr(freq:10,mul:40,add:10),mul:0.5)}.play

( // after playing with this for a while:
var pmosc;
pmosc = {
        PMOsc.ar(
                carfreq:40,
                modfreq:LFTri.kr(
                        freq:[0.5,0.2],
                        mul:LFTri.kr(
                                freq:0.01,
                                mul:10,
                                add:5
                        ),
                        add:5
                ),
                pmindex:90,
                mul:0.2
        )
};

//{CombN.ar(in: pmosc, maxdelaytime:3, delaytime: 1, decaytime: 3)}.play  // problematic
{pmosc}.play;

)


// this works ok
{CombN.ar(Dust.ar(density:[10,11]))}.play

// but this ...
d = { Dust.ar(density:[10,11])};
{d}.play // is ok
{CombC.ar(in:d)}.play // is not ok, why?
 

http://thread.gmane.org/gmane.comp.audio.supercollider.user/75177



17:12


// a little bit on MouseX and MouseY

// why does poll here not produce anything?
(
{Blip.ar(
        freq: 100,
        numharm: MouseX.kr(
                minval: 1,
                maxval: 80).poll,
        mul: LFPulse.kr(
                MouseY.kr(
                        minval:0.01,
                        maxval: 20).poll,
                mul:0.5)
)}.play
)



(
{Blip.ar(
        freq: 100,
        numharm: MouseX.kr(
                minval: 1,
                maxval: 80).poll,
        mul: LFPulse.kr(
                {MouseY.kr(
                        minval:0.01,
                        maxval: 20)}.poll, // neither with curly brackets
                mul:0.5)
)}.play
)
 

17:55

(
var asdfg; // declaring a local variable
asdfg = {
        Blip.ar(
                freq: 50,
                numharm: LFNoise1.kr ( freq:[0.1,0.05], mul: 40, add: 41 ),
                mul: LFPulse.kr (
                        LFNoise1.kr ( freq: [0.1,0.08], mul: 10, add: 11 ), mul: Line.kr()*0.5 )
        )
};

{ GVerb.ar (
                asdfg,
                roomsize: 60,
                drylevel: LFNoise1.kr(  [0.1,0.09], mul: 0.5,add: 0.5 ),
                taillevel: LFNoise1.kr( [0.1,0.09], mul: 0.5, add: 0.5 ),
                earlyreflevel: 0,
                mul:0.3)
}.play
) // fun!

recording:

 M-x sclang-server-record (C-c C-p r r)
 M-x sclang-server-record-stop (C-c C-p r s)

by default it will record into ~/share/SuperCollider/Recordings. In 3.5 this will be configurable in a .sclang.cfg file .. wait, supposedly, in your startup file:

 thisProcess.platform.recordingsDir = "wherever/you/want";

Attach:SC_110707_180239.ogg


23:54

For the end of final assignment of the day, i failed.

starting with

(
{
        var rate = 4, carrier, modRatio; // declare variables
        carrier = LFNoise0.kr(rate) * 500 + 700;
        modRatio = MouseX.kr (1, 2.0);
        // modulator expressed as ratio therefore timbre
        PMOsc.ar(carrier, carrier*modRatio, 12) * 0.3
}.play
)

the assignment was

 6. add new variable called env, and assign it to Linen (an envelope) with 
and attack of 1/rate and a decay of 0 to control the mul of the PMOsc (use keyword assignment)

and this doesn't work (as expected):

(
{
        var rate = 10, carrier, modRatio, env; // declare variables
        carrier = LFNoise0.kr(rate) * 500 + 700;
        modRatio = MouseX.kr (1, 2.0);
        env = Linen.kr(gate:Impulse.ar(rate), attackTime:1/rate, releaseTime:0);
        //SinOsc.ar(440) * env
        // modulator expressed as ratio therefore timbre
        PMOsc.ar(carrier, carrier*modRatio, Line.kr(1,12,20), mul:env) * 0.3
        //PMOsc.ar(carrier, carrier*modRatio, Line.kr(1,12,20), mul:env) * 0.3
}.play
)

but, after midnight, this works, but i don't understand why!


(
{
        var rate = Line.kr(1,10,60) , carrier, modRatio, env; // declare variables
        carrier = LFNoise0.kr(rate) * 500 + 700;
        modRatio = MouseX.kr (1, 2.0);
        env = Linen.kr(gate:Impulse.kr(rate), attackTime:(1/(rate+1)), susLevel:0.5,releaseTime:0);
        PMOsc.ar(carrier, carrier*modRatio, Line.kr(1,12,20), mul:env) * 0.3
}.play
)

I don't understand why the attackTime needs to be 1/(rate+1) but cannot be simply 1/rate.


filed under: SuperCollider





DevLog.110609 Supercollider 3x

1

Today I ordered the "Supercollider Book" from amazon (+ Designing Sound from Andy Farnell), yay!

I guess this goes now off my wishlist!

PS: don't forget there are SC examples for Farnell's book written by Dan Stowel: http://en.wikibooks.org/wiki/Designing_Sound_in_SuperCollider

2

I discovered that at Wikipedia they are using c as language specificator for SuperCollider code for syntax highlighting. I can do that too with my SourceBlock recipe:

// Boot the server
s.boot;

// Load an audio file
s.sendMsg(\b_allocRead, 10, “sounds/a11wlk01.wav);

// Now define the granular synth
(
{
    var b = 10, trate, dur;
    trate = MouseY.kr(2,120,1);
    dur = 1.2 / trate;
    TGrains.ar(2, Impulse.ar(trate), b,
        (1.2 ** WhiteNoise.kr(3).round(1)),
        MouseX.kr(0,BufDur.kr(b)),
        dur,
        WhiteNoise.kr(0.6), 0.1);
}.play;
)

3

If this is how supercollider will look in the future (QT GUI in 3.5 and complete QT IDE in 3.6), than i must say i'm in love!

http://supercollider.sourceforge.net/wiki/index.php/Ben's_Proposition





DevLog.110608 simple bash script for wireless + testing syntax hilighting in pmwiki

Wireless card in my Thinkpad T60p (Intel Corporation PRO/Wireless 3945ABG [Golan]) sometimes (rarely) refuses to connect, it kinda get's stuck. Removing in reinserting the kernel helps him to start anew.

I've put this script (restartwificard.sh) in my ~/bin/ folder and chmod'it to u+x (chmod u+x restartwificard.sh)

#!/bin/bash

# this script tries to remove and reinsert
# driver for wireless card, which sometimes gets stuck.

echo "removing iwl3945..."
sudo rmmod -f iwl3945

echo "sleeping 5 seconds..."
sleep 4

echo "inserting back module iwl3945..."
sudo modprobe iwl3945

To create syntax highlighting in PmWiki I used Cookbook:SourceBlock.





DevLog.110531 Considering the structure of code

When considering the code structure for a possible code repository (even just local, but ultimately, at some point published) immediately the usability for others comes as an important factor.

Just a mental note for thinking further.


filed under SkizoMachines





Edit - History - Print - Recent Changes - Search
Page last modified on July 10, 2011, at 12:31 PM -