Skip to content

Instantly share code, notes, and snippets.

@r618
r618 / trance_of_an_old_clockwork.rb
Last active October 23, 2015 00:40
#SonicPi #compo
#set_mixer_control! lpf: 100, lpf_slide: 32
#set_mixer_control! amp: 0, amp_slide: 32
#set_mixer_control! amp: 2, amp_slide: 32
# Trance of an old clockwork
use_bpm 60
# ---------------------------------------------------------------------------------------
# Beats
# MIDI notes ~~
anote = play :C4, sustain: 60
anote.pause
sleep 1
anote.run
sleep 1
@r618
r618 / OSCclient.rb
Last active December 10, 2018 18:46
#SonicPi #OSC #Reaktion
# adopted from https://github.com/repl-electric/live-coding-space
require 'osc-ruby'
def reaktion(endpoint, *args)
args = [endpoint] + args
endpoint = :reaktion
endpoint = "/#{endpoint}"
@client ||= OSC::Client.new('localhost', 9000)
begin
args = args.map{|a| a.is_a?(Symbol) ? a.to_s : a}
@r618
r618 / TransformAccessTester.cs
Last active October 24, 2015 12:47
simple cached vs. non cached transform access measurement in Unity
Results:
========================================================
iPod Touch 4th gen
========================================================
===== seconds avg / frame batches ( * 100 actual frames )
========================================================
Unity 4.6.9
@r618
r618 / builtin_profiler_usage.cs
Created October 24, 2015 14:47
builint profiler usage in Unity
using UnityEngine;
using System.Collections;
using System.Runtime.CompilerServices;
public class Tester : MonoBehaviour
{
const int kRuns = 10000000;
const string
@r618
r618 / BWV1007.rb
Last active November 9, 2015 13:34
bit crushed vibrato on BWV1007 in #SonicPi
# The Bach robot plays BWV murder
# Suite No.1 in G Major BWV 1007 MIDI notes (on only)
notes = (ring
43, 50, 59, 57, 59, 50, 59, 50, 43, 50, 59, 57, 59, 50, 59, 50,
43, 52, 60, 59, 60, 52, 60, 52, 43, 52, 60, 59, 60, 52, 60, 52,
43, 54, 60, 59, 60, 54, 60, 54, 43, 54, 60, 59, 60, 54, 60, 54,
43, 55, 59, 57, 59, 55, 59, 55, 43, 55, 59, 57, 59, 55, 59, 54,
43, 52, 59, 57, 59, 55, 54, 55, 52, 55, 54, 55, 47, 50, 49, 47,
@r618
r618 / notes_glitch.rb
Created November 12, 2015 09:39
#SonicPi #Unity3d OSC reaktion test
# SonicPi <-> Unity OSC test
# https://www.youtube.com/watch?v=7hYmcYg4WEY
notes = (ring :E4, :Fs4, :B4, :Cs5, :D5, :Fs4, :E4, :Cs5, :B4, :Fs4, :D5, :Cs5 )
live_loop :slow do
#stop
#sync :moon_bass
use_synth :beep
with_fx :reverb, room: 1 do
play notes.tick, release: 0.125
@r618
r618 / now-play-this.rb
Created June 3, 2016 10:38 — forked from AlexandreRangel/now-play-this.rb
Sonic Pi 2.10 music code
use_synth :growl
64.times do
play rrand(30,90),
attack: rrand(4,16), sustain: rrand(2,4),
release: rrand(4,24), slide_shape: 3,
cutoff: rrand(62,112),
cutoff_slide: [2,4,8,12].choose,
res: rrand(0,0.99),
res_slide: [2,4,6].choose,
pan: rrand(-0.4,0.4),

Keybase proof

I hereby claim:

  • I am r618 on github.
  • I am r618 (https://keybase.io/r618) on keybase.
  • I have a public key ASCRG6Jzm4syu1H5IJv2tzTlo0yFpBdaQhZk-CeUNtLKQQo

To claim this, I am signing this object:

@r618
r618 / AudioInputLasp.cs
Created October 21, 2017 12:01
example of some LASP <-> Unity
/*
* just example of tighter LASP <-> Unity exchange
*/
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
[RequireComponent(typeof(AudioSource))]
public class AudioInputLasp : MonoBehaviour