Skip to content

Instantly share code, notes, and snippets.

@interstar
interstar / more sonic pi chord play
Created April 6, 2021 19:16
More sonic pi chord play
# MIDI Chord generation
# Now with modal interchange, secondary dominants & inversions
# See https://www.youtube.com/watch?v=3yryQbRgsGo
define :oneChord do | tonic, mode, deg |
majorKeyTriads = [:M,:m,:m,:M,:M,:m,:dim]
minorKeyTriads = [:m,:dim,:M,:m,:m,:M,:M]
majorKey7s = [:M7,:m7,:m7,:M7,:dom7,:m7,:halfdiminished]
minorKey7s = [:m7,:halfdiminished,:M7,:m7,:m7,:M7,:dom7]
@interstar
interstar / Sonic Pi Chords with secondary diminisheds.rb
Last active April 6, 2021 23:33
Sonic Pi Chords with Secondary Diminisheds
# MIDI Chord generation
# Now with modal interchange, secondary dominants,
# inversions and secondary diminished
# https://www.youtube.com/watch?v=qd8SEL_rTNw&list=PLuBDEereAQUz2iiEZb7yGLH0Bzi52egGp&t=0s
define :oneChord do | tonic, mode, deg |
majorKeyTriads = [:M,:m,:m,:M,:M,:m,:dim]
minorKeyTriads = [:m,:dim,:M,:m,:m,:M,:M]
majorKey7s = [:M7,:m7,:m7,:M7,:dom7,:m7,:halfdiminished]
minorKey7s = [:m7,:halfdiminished,:M7,:m7,:m7,:M7,:dom7]
@interstar
interstar / Sonic Pi Chords 4.0
Created April 10, 2021 15:54
Sonic Pi Chords 4.0 with modal interchange, secondary dominants, inversions, augmenteds and secondary diminisheds
# MIDI Chord generation
# Now with modal interchange, secondary dominants,
# inversions, augmenteds and secondary diminished
#
define :oneChord do | tonic, mode, deg |
majorKeyTriads = [:M,:m,:m,:M,:M,:m,:dim]
minorKeyTriads = [:m,:dim,:M,:m,:m,:M,:M]
majorKey7s = [:M7,:m7,:m7,:M7,:dom7,:m7,:halfdiminished]
minorKey7s = [:m7,:halfdiminished,:M7,:m7,:m7,:M7,:dom7]
# PLAY OUT
#
# MENTUFACTURER
# Original sketch in Sonic Pi of the track
# https://mentufacturer.bandcamp.com/track/play-out
# Note, because of a bug, there's a long section of just drums before the rest kicks in
# MIDI Chord generation
@interstar
interstar / serial2midi.pde
Last active July 12, 2021 03:41
Processing sketch to turn Microbit Accelerometer data (received from the serial cable) into MIDI
// See https://www.youtube.com/watch?v=DcgRHOqSFm8
import processing.serial.*;
import themidibus.*;
Serial serialPort;
MidiBus midiBus;
void setup() {
size(700,500);
@interstar
interstar / mb_accelerometer.py
Last active July 12, 2021 03:42
Grab MicroBit Accelerometer to Serial
# See https://www.youtube.com/watch?v=DcgRHOqSFm8
from microbit import *
uart.init(baudrate=115200)
while True:
display.clear()
x,y,z=accelerometer.get_values()
display.set_pixel(2,2,4)
@interstar
interstar / trap3.rb
Last active August 3, 2021 21:32
Trap beat for sonic pi
use_bpm 145
# Our chord sequence
p1 = [chord(:E3,"minor7"),
chord(:G3,"major7"),
chord(:A3,"minor7"),
chord(:G3,"m9"),
chord(:E3,"m9"),
chord(:C3,"minor7"),
@interstar
interstar / rectext.py
Last active August 27, 2021 14:31
recursively include text files
import sys, re
# Run like this :
# python3 rectext.py toplevel.txt
#
# include statement looks like this
# @include fname.txt
def slurp(fName) :
@interstar
interstar / squarewavesynth.lua
Created September 24, 2021 18:48
A noisy square-wave drone synth
--[[
name: square demo
description: > generate a squarewave with pulse width control
author: synaesmedia
See https://www.youtube.com/watch?v=8kXs8XIyq1U
--]]
require "include/protoplug"
@interstar
interstar / squarewavesynth2.lua
Created September 30, 2021 14:49
Square Wave Synth in Lua Protoplug (part 2)
--[[
name: square demo
description: > Square wave synth with pulse width control & ADSR envelopes
author: synaesmedia
see : https://www.youtube.com/watch?v=eBLbpXHaYIE
Protoplug : https://github.com/pac-dev/protoplug
--]]
require "include/protoplug"