Tagged: sc3

Which category? The community suggests “Most likely to change the way you do everything”.

Me likes that.

Great to see how other people use sc. Thanx for sharing, Marije!

Code LiveCode Live – Greyhound

[From nescivi.nl » Downloads]

2009-SoundCommunication.jpgToday, I stumbled across this article that investigates into using sound as a transfer medium for digital information.

Though this is actually a very old and commonly used method for transferring files back in the 90s (we did this via tty telephone modems), it is kind-of pleasing to see this idea popping up again, and triggered some thoughts about it’s usefulness in cooperative livecoding situations.  

Yes, it would be really fun not have to setup wireless LAN that invisibly and–for the audience–almost magically transfer information from one laptop to another, and, instead, having some sort of musical/non-aweful sound that transmit additional information from one laptop to another.

I wonder if anyone ever thought of this in the SuperCollider / LiveCoding community, but I think it’s worth!

This patch extracts color values from the kuler api via a themeID and converts them to Color objects.

It requires 
- the XML quark by Jens Gulden (wow! thanx) for parsing the xml stuff and
- the wslib quark by wouter snoei (wow, too!) for Meta_Color:newHex
- a valid kuler dev-key (see http://kuler.adobe.com/api/ for details)


// Process Kuler rss feed for Color extraction

(
~getFeed = {
arg
fileName,
kulerKey, // insert your kuler key
themeID(347630); // ID of a kuler theme

"curl \"http://kuler-api.adobe.com/rss/search.cfm?itemsPerPage=20&startIndex=0&searchQuery=themeID:%&key=%\" > /tmp/%"
.format(themeID, kulerKey, fileName).unixCmd;
};
~xml2color = {|fileName|
DOMDocument("/tmp/%".format(fileName))
.getElementsByTagName("kuler:swatch")
.collect{|swatch|
swatch.getElementsByTagName("kuler:swatchHexColor")
.collect(_.getText)
}.flatten.collect{|str|
Color.newHex(str)
}
};
~tidy = {|fileName|
"rm /tmp/%".format(fileName).unixCmd;
};
~show = {|color, bounds(Rect(30,300, 100, 30))|
var window;
var extent = bounds.extent.asArray;
window = Window.new("ColorTest", bounds, false);
window.drawHook = {
3.do{|i|
Pen.color = Color.gray(i * 0.5);
Pen.fillRect(
Rect.fromArray([i*(extent.first/3),0] ++
(extent * [1/3, 1]))
);
};
Pen.color = color;
Pen.fillRect(Rect.fromArray(extent*0.1 ++ extent * 0.8));
};
window.front;
}
)
(
{
~fileName = "%.xml".format(Date.getDate.stamp);
~getFeed.value(~fileName, "your Kuler key here");
2.wait;
"less /tmp/%".format(~fileName).unixCmd;
a = ~xml2color.value(~fileName);
1.wait;
~tidy.value(~fileName)
}.fork;
)

a.do{|c| ~show.(c)}

Awesome simple; Simply awesome.

q = ();
s.boot;

// get sounds
q.soundFiles = SoundFile.collect(
"/localvol/sound/share/audiosamples/freesound/birdsong/*.wav"
);

// play back in order of their appearance
Pseq(q.soundFiles.collect{|file| file.cue((\dur: file.duration))}, 1).play;

[this particular example plays back files downloaded from a freesound samplepack]