Skip to content

Instantly share code, notes, and snippets.

View automata's full-sized avatar

Vilson Vieira automata

View GitHub Profile
@automata
automata / test_osc.js
Created February 13, 2011 03:54
testing OSC under UDP on FF4
// asking for permission to use XPCOM
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
} catch (e) {
alert("Error: " + e);
}
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
// output
var synth = new Synth(audiolet);
var metaPattern = new PProxy(new PSequence([440, 660], Infinity));
var metaDuration = new PProxy(new PSequence([0.5, 1], Infinity));
audiolet.scheduler.play([metaPattern], metaDuration,
function (foo) {
synth.saw.frequency.setValue(foo);
});
@automata
automata / listando diretório em C
Created April 4, 2011 02:38
usando opendir para listar diretório
#include <sys/types.h>
#include <dirent.h>
#include <stdio.h>
int main(void) {
DIR *diretorio;
struct dirent *navegador;
char foo[100];
sprintf(foo, "%s", "nome_do_diretorio");
@automata
automata / gist:1094304
Created July 20, 2011 03:51
requisicao aa
import urllib, urllib2
val = {'user': '1', 'log': '2011-07-19 12:30:10::texto engracado'}
dados = urllib.urlencode(val)
req = urllib2.Request('http://nightsc.com.br/aa/novo_log.php', dados)
res = urllib2.urlopen(req)
pagina = res.read ()
print pagina
vilson@automata:~/Misc/repos/miniaudicle/src$ make linux-jack
make -f makefile.jack
make[1]: Entrando no diretório `/home/vilson/Misc/repos/miniaudicle/src'
gcc -D__LINUX_ALSA__ -D__LINUX__ -D__MA_WXWIDGETS__ `wx-config --cppflags` -O3 -c -fno-strict-aliasing -D__CK_SNDFILE_NATIVE__ -Ichuck -Iwxw -I/home/vilson/Misc/repos/miniaudicle/src miniAudicle.cpp
miniAudicle.cpp: In member function ‘long unsigned int miniAudicle::start_vm()’:
miniAudicle.cpp:869:81: warning: format ‘%i’ expects type ‘int’, but argument 3 has type ‘long int’
gcc -o wxw/mAParentFrame.o -D__LINUX_ALSA__ -D__LINUX__ -D__MA_WXWIDGETS__ `wx-config --cppflags` -O3 -c -fno-strict-aliasing -D__CK_SNDFILE_NATIVE__ -Ichuck -Iwxw -I/home/vilson/Misc/repos/miniaudicle/src wxw/mAParentFrame.cpp
In file included from wxw/mAParentFrame.h:46:0,
from wxw/mAParentFrame.cpp:43:
wxw/mAPreferencesWindow.h:121:5: error: ‘wxNotebook’ does not name a type
macbook-de-vilson-vieira:rainbow vilson$ make
make -C components
g++ -o MediaRecorder.o -DRAINBOW_Mac -c -pipe -Os -arch i386 -dynamiclib -mmacosx-version-min=10.5 -DMOZ_NO_MOZALLOC -fPIC -fno-rtti -fno-exceptions -fno-strict-aliasing -fno-common -fshort-wchar -fpascal-strings -pthread -Wall -Werror -Wconversion -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-long-long -include xpcom-config.h -I. -IDarwin -I/Users/vilson/Repos/xulrunner-sdk/include -I/Users/vilson/Repos/xulrunner-sdk/include/system_wrappers -I/Users/vilson/Repos/xulrunner-sdk/include/xpcom -I/Users/vilson/Repos/xulrunner-sdk/include/string -I/Users/vilson/Repos/xulrunner-sdk/include/content -I/Users/vilson/Repos/xulrunner-sdk/include/dom -I/Users/vilson/Repos/xulrunner-sdk/include/nspr -I/Users/vilson/Repos/xulrunner-sdk/sdk/include -I../lib/Darwin_i386-gcc3/include MediaRecorder.cpp
MediaRecorder.cpp: In member function ‘void MediaRecorder::ParseProperties(nsIPropertyBag2*)’:
MediaR
100, 100, 0.09
20, 20, 0.1
220, 220, 0.1
20, 200, 0.05
20, 20, 0.05
@automata
automata / gist:1360504
Created November 12, 2011 13:14
pd-macambira. build errors
after a "make install && make package"...
rm -f -- /home/vilson/src/labmacambira/pd-macambira/externals/creb/modules/scrollgrid1D~.o
cc -g -mtune=i686 -march=i386 -DPD -DHAVE_G_CANVAS_H -I/home/vilson/src/labmacambira/pd-macambira/pd/src -Wall -W -ggdb -I/home/vilson/src/labmacambira/pd-macambira/externals/Gem -I/home/vilson/src/labmacambira/pd-macambira/externals/pdp/include -DUNIX -Dunix -DDL_OPEN -fPIC -o "/home/vilson/src/labmacambira/pd-macambira/externals/creb/modules/statwav~.o" -c "/home/vilson/src/labmacambira/pd-macambira/externals/creb/modules/statwav~.c"
/home/vilson/src/labmacambira/pd-macambira/externals/creb/modules/statwav~.c: In function ‘statwav_tilde_perform’:
/home/vilson/src/labmacambira/pd-macambira/externals/creb/modules/statwav~.c:73:18: warning: unused variable ‘count’
/home/vilson/src/labmacambira/pd-macambira/externals/creb/modules/statwav~.c:56:31: warning: unused variable ‘fp’
/home/vilson/src/labmacambira/pd-macambira/externals/creb/modules/statwav~.c: In function ‘statwav_tilde
@automata
automata / foo.ck
Created November 19, 2011 18:05
foobarbaz
// manipula esse
["samples/fx/s20.wav"] @=> Foo.name;
[0.] @=> Foo.prop;
[.25, .15] @=> Foo.rate;
[2., 1., 1., 4.] @=> Foo.du;
[.8] @=> Foo.gain;
@automata
automata / gist:2185158
Created March 24, 2012 17:02
testing with d3 and water
$('#main').css('background', "#25322d");
var g = d3.select('svg')
.append('g')
.attr('transform', 'translate(' + $('#main').width()/2 + ', ' + 889 + ')');
var randomNumbers;
if ($('#main').data('randomNumbers')) {
randomNumbers = $('#main').data('randomNumbers');
} else {