Skip to content

Instantly share code, notes, and snippets.

View Enkerli's full-sized avatar

Alexandre Enkerli Enkerli

View GitHub Profile
@rbnpi
rbnpi / OSC_API_KeyboardInput.rb
Last active September 30, 2021 06:09
Experimental code to play with the new OSC-API in Sonic Pi2.11dev. Note this is highly experimental and will probably change. The two programs allow input from a Mac keyboard to Sonic Pi. You may need to change some of the keyboard mapping on other keyboards. You can here a recording of the system at https://soundcloud.com/scrbn/sonicpiexperimen…
#This program polls the keyboard and then maps the code for detected keys to midi note values
#which are tranmsitted to the new OSC-API in Sonic Pi
#Warning THIS API IS EXTREMEMLY EXPERIMENTAL AND MAY CHANGE (current version 2.11 dev 2d13e)
#This script runs in a terminal window. Once the SP script is running, type in the terminal window to send key presses.
require 'io/wait'
require 'socket'
require 'rubygems'
require 'osc-ruby'
client ||= OSC::Client.new('localhost', 4559) #set up OSC channel to port 4559
@pauginer
pauginer / hype-slides
Last active October 10, 2020 15:12
Add this to the header of a Hype document to be able to move through scenes by using the keyboard arrows which may be convenient for creating presentations with Hype.
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
// http://mikemurko.com/general/jquery-keycode-cheatsheet/
var speed = 0.8; //transition speed
var transition = "push"; //types of transition: instant, fade, swap, push
var nextKeys= [39, 40, 34];
var prevKeys= [37, 38, 33];
$(function(){
@rbnpi
rbnpi / GlassArmonicaPlaysMozart.rb
Last active August 27, 2022 18:47
Glass Armonica for Sonic Pi plays Mozart UPDATED to use rpitch: (introduced after this was first written) to calculate sample rate. MUCH simpler
#a Glass Armonica "voice" for Sonic Pi by Robin Newman November 2014
# revised to use rpitch 2018; corrected 2022 for missing tr function
#This simulates the Glass Armonica invented by Benjamin Franklin and for which Mozart
#composed the piece played here
#This version uses rpitch: parameter added to Sonic Pi after the original was written in 2014
##| sample :ambi_glass_rub
##| play :fs5
##| puts note(:fs5)
##| stop
use_debug false
@bbest
bbest / .block
Last active January 7, 2020 14:47
Aster Plot in D3
license: mit
height: 300
scrolling: no
border: no