Gist access through SuperCollider, part 2


30 July 2011

I completely rewrote the Gist class. It is now quite nice to use so please check it out! To give you a starting point, I wrote a small tutorial on how to do tree-like cadavre exquis movements. The tutorial is now part of the json quark. I already made an initial cadavre; you can find it here:

Comments

  • If someone is eager to wrap this cadavre stuff into a class, I would be happy
  • I’m open for any suggestions etc.
  • this little gimmick serves as a proof of concept for a social synthdef site for SuperCollider

Enjoy and don’t forget to

"json".include;

Code example

This is a wrap-up on how to access this particular cadavre from within supercollider and how to fork new cadavres from it.

//////////////////// if you just want to explore existing cadavres /////////////////////////////////////
(
var id = 1114384; // the cadavre's id
// get an existing cadavre, possibly yours
g = Gist(id).pull;
)

g['Ndef.scd']
// copy-paste from post window and play it...


// pull all nkown forks; takes a while to complete...
h = g.forks.collect{|item| Gist(item.id).pull}

// prettyprint them including sourcecode
h.do(_.prettyprint(true))

// copy-paste from post window and play it...
h.last['Ndef.scd']

// get all forks of one of the next cadavres
h = h.choose.forks.collect{|item| Gist(item.id).pull}



//////////////////// if you want to fork from an existing cadavre, do this /////////////////////////////

(
var id = 1114384; // the cadavre's id
// fork an existing cadavre
var username = nil; // set your user and pasword if you want to follow forks
var password = nil;

g = Gist(id).fork(q.username, q.password);
)

// pull content from github
g.pull

// see content
g['Ndef.scd']

// copy-paste from post window and edit it...

(
Ndef('gistCadavre', {SplayAz.ar(2, SinOsc.ar({LFDNoise3.ar(Rand(0.1, 0.4)).exprange(200, 800)}!50, 0, 1).tanh, spread: 2, orientation: WhiteNoise.ar.lag(LFDNoise3.ar(2pi.reciprocal).exprange(0.000001, 0.001))).tanh});
Ndef('gistCadavre').set('fadeTime', 2);
);


Ndef('gistCadavre').play

// update the gist's content
g['Ndef.scd'] = Ndef('gistCadavre').asCode(true, true);

(
// push updated version to server
var username = nil; // set your user and pasword if you want to follow forks, edit, or let your successor be able to track your cadavre.
var password = nil;
g.push(username, password);
)

// look at it in the web browser
g.html_url.openInFinder