Skip to content

Instantly share code, notes, and snippets.

View juliancheal's full-sized avatar

Julian Cheal juliancheal

View GitHub Profile
@postspectacular
postspectacular / retune-dnb.rb
Last active August 22, 2021 16:08
Sonic-PI livecoding demo @ Retune 2014 - only temporary home here until repo w/ talk slides is up
# Live coding example for Retune conference 2014
# 1) Press Run (Cmd+R) to start
# 2) Make changes (e.g. comment in/out various lines in :beats & :amen)
# 3) Press Run again (changes will only be audible from next queue point)
# compute loop length (4 bars), bar & quarter note durations
dur = sample_duration :loop_compus
bar = dur / 4
quart = dur / 16
@johnnyman727
johnnyman727 / listening-client.js
Created September 23, 2014 19:57
Simple MQTT Server. Tessel acts as an MQTT client sending temperature data to a host
var mqtt = require('mqtt')
// Make sure to change this to the IP address of your MQTT server
, host = '192.168.128.204' // or localhost
client = mqtt.createClient(1883, host, {keepalive: 10000});
// Subscribe to the temperature topic
client.subscribe('temperature');
// When a temperature is published, it will show up here
client.on('message', function (topic, message) {
@xavriley
xavriley / README.md
Last active December 30, 2023 12:17
Original NES Mario Theme for Sonic Pi

Making Chiptune Music using Sonic Pi v2.0

Warning: this might not work on a RaspberryPi yet

I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.

I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!

Getting the sounds of the NES chip

@DamirSvrtan
DamirSvrtan / app_template.rb
Last active August 29, 2015 14:05
Rails application generator template
### Rails app generator template. Run it:
### rails new _app_name_ -m https://gist.githubusercontent.com/DamirSvrtan/28a28e50d639b9445bbc/raw/app_template.rb
remove_file "README.rdoc"
create_file "README.md", "Development: run ./bin/setup"
run 'mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss'
database_type = ask("Do you want to use postgres or mysql?", limited_to: ["pg", "mysql"])
adapter = if database_type == 'pg'
@tcr
tcr / beaglebone-instructions.md
Last active February 16, 2016 10:59
Creating a reusable Beaglebone Debian Image
@ToeJamson
ToeJamson / 1.swift
Last active February 19, 2020 18:41
Smart iBeacons in the Swift Programming Language
class Brain: NSObject, PNDelegate {
let config = PNConfiguration(forOrigin: "pubsub.pubnub.com", publishKey: "demo", subscribeKey: "demo", secretKey: nil)
var channel = PNChannel()
var serverStatus = UILabel()
init() {
super.init()
}
}
@xavriley
xavriley / auto_dubstep.rb
Created June 10, 2014 21:33
Auto generating dubstep with Sonic Pi
# DUBSTEP
# Combines ideas from my other gists
current_bpm = 140.0
use_bpm current_bpm
# WOBBLE BASS
define :wob do
use_synth :dsaw
lowcut = note(:E1) # ~ 40Hz
highcut = note(:G8) # ~ 3000Hz
@xavriley
xavriley / wobwob.rb
Created June 10, 2014 21:30
Standalone Sonic Pi wobble bass
# Defining standalone wobble
# WOBBLE BASS
define :wob do |note, no_of_wobs, duration|
# using in_thread so we don't block everything
in_thread do
use_synth :dsaw
lowcut = note(:E1) # ~ 40Hz
highcut = note(:G8) # ~ 3000Hz
@xavriley
xavriley / drum_tab_player.rb
Created June 10, 2014 21:22
Playing ASCII Drum Tabs with Sonic Pi
# Playing ASCII drum tabs with Sonic Pi
# Ruby is an awesome language for String manipulation.
# Lets use that fact to play some drums!
# Tab for the Amen break taken from Wikipedia
# http://en.wikipedia.org/wiki/Amen_break
# Note that %Q{ ... } is just another way
# to define a string in Ruby
@xavriley
xavriley / clyde_stubblefield.rb
Created June 10, 2014 21:15
Funky drummer with Sonic Pi
# The funky drummer
# The aim here is to experiment with
# a) sequencing drums
# b) playing with 'time feel' which is
# music-speak for how the beat feels,
# ranging from robotic (0.0 swing_time)
# to ultra funky Fresh Prince of Bel Air
# theme tune style (0.2+ swing_time)
current_bpm = 180.0