Skip to content

Instantly share code, notes, and snippets.

@tado
tado / SonicPiOsc.pde
Created November 22, 2016 03:00
Perser for log forwarding on Haskap Jam Pack
class SonicPiOsc {
String synth;
String[] paramList;
void perse(OscMessage msg) {
if (msg.checkAddrPattern("/log/multi_message")) {
String[] allList = split(msg.get(5).stringValue(), ',');
String[] synthList = split(allList[0], ':');
synth = synthList[1];
String str = msg.get(5).stringValue();
@tado
tado / send_to_sonicPi.pde
Last active November 28, 2016 22:03
Send message form Processing to Sonic Pi via OSC
import oscP5.*;
import netP5.*;
OscP5 oscP5;
NetAddress location;
void setup() {
size(400, 400);
oscP5 = new OscP5(this, 12000);
location = new NetAddress("127.0.0.1", 4557);
@tado
tado / additional.css
Last active January 10, 2017 22:46
yoppa.org wordpress additional css
@import url(http://fonts.googleapis.com/earlyaccess/notosansjapanese.css);
html[lang=ja] #content address,
html[lang=ja] #content blockquote,
html[lang=ja] #content caption,
html[lang=ja] #content cite,
html[lang=ja] #content code,
html[lang=ja] #content dl,
html[lang=ja] #content figcaption,
html[lang=ja] #content h1,
@tado
tado / hoge.cpp
Created March 22, 2017 03:57
ofTexture to ofImage
ofTexture texture = cam.getTexture();
ofPixels pixels;
texture.readToPixels(pixels);
ofImage img;
img.setFromPixels(pixels);
@tado
tado / bookcover.pde
Last active March 31, 2017 08:30
Generative Book Cover (http://amzn.asia/bUpMMUO)
import processing.pdf.*; //PDF Exportライブラリのインポート
float strength = 1400.0; //ノイズの強さ
int step = 6; //グリッドの細かさ
float noiseScale = 0.002; //パーリンノイズのスケール
void setup() {
size(1920, 1200);
noLoop(); //ループさせない(1フレームのみ書き出す)
}
@tado
tado / SG.tidal
Last active May 2, 2017 23:17
TidalCycles Pattern Generator using Syncopation Degrees
-- Example
d1 $ metre "[1 2 3 4]/8" $ sound "cp"
d1 $ metre (slow 256 $ run 256) $ sound "cp"
-- Patterns sorted by syncopation degree
-- using Sioros and Guedes (2011) syncopation models [1]
-- revised by Alex McLean https://gist.github.com/tado/7785ba7145f4c75ecbba1ababe68483f#gistcomment-2081699
let metre metrep p = unwrap $ (\metren -> struct (xs !!! metren) p) <$> metrep
(!!!) xs n = xs !! (n `mod` length xs)
@tado
tado / ofApp.cpp
Last active May 20, 2017 23:47
Quick, Draw! example for openFrameworks
#include "ofApp.h"
#include <fstream>
void ofApp::setup(){
ofBackground(255);
ofSetColor(0);
ofNoFill();
ofSetBackgroundAuto(false);
//select file
@tado
tado / hoo.cpp
Created May 28, 2017 08:40
Memo: finding min and max value in vector
std::vector<float> data;
float min = *min_element(data.begin(), data.end());
float max = *max_element(data.begin(), data.end());
@tado
tado / drawSpot.pde
Last active June 12, 2017 06:06
TEU class 170612 template
// Spotクラスを宣言
Spot spot;
void setup() {
size(800, 600);
noStroke();
frameRate(60);
//位置ベクトルをランダムに生成
PVector loc = new PVector(width/2.0, height/2.0);
//速度ベクトルをランダムに生成
@tado
tado / tidalForwardOsc.scd
Last active March 19, 2021 13:58
Forwarding TidalCycles OSC messages via SuperCollider
SuperDirt.start
(
//forward OSC message (localhost, port 3333)
var addr = NetAddr.new("127.0.0.1", 3333);
OSCdef(\tidalplay2, {
arg msg;
addr.sendMsg("/play2", *msg);
}, '/play2', n);
)