Skip to content

Instantly share code, notes, and snippets.

@robmckinnon
robmckinnon / diatonic_scales.orca
Created Jan 11, 2021
Diatonic scales patch for Orca
View diatonic_scales.orca
0VC6VftV2#:tone#......#M#.#D#.#P#.#L#.#M#.#M#.#L#......................................
1Vc7VGsV1#:semitone#..#a#.#o#.#h#.#y#.#i#.#i#.#y#......................................
2VD8Vg................#j#.#r#.#r#.#d#.#x#.#n#.#c#......................................
3Vd9VAkV0#:key.index#.#o#.#i#.#y#.#i#.#o#.#o#.#r#......................................
4VEaVa................#r#.#a#.#g#.#a#.#l#.#r#.#i#......................................
5VFbVB.................................................................................
......7Xt.#To.change#.#t#.#t#.#s#.#t#.#t#.#s#.#t#......................................
.....57Xt.#mode.copy#.#t#.#s#.#t#.#t#.#t#.#t#.#t#......................................
.....a7Xs.#sequence.#.#s#.#t#.#t#.#t#.#s#.#t#.#s#......................................
.....f7Xt.#from.the.#.#t#.#t#.#t#.#s#.#t#.#s#.#t#......................................
View gist:e568fc393e252325231ffd08b3bbb640
import time
import rtmidi
from gpiozero import DistanceSensor # Import the GPIO Zero Library
# Define GPIO pins to use on the Pi
pinTrigger = 17
pinEcho = 18
midiout = rtmidi.MidiOut()
available_ports = midiout.get_ports()
@robmckinnon
robmckinnon / memory_profiler.rb
Created Feb 27, 2020
memory_profiler.rb in single file
View memory_profiler.rb
# frozen_string_literal: true
# Single file copy of https://github.com/SamSaffron/memory_profiler for loading in Sonic Pi.
# Licence: https://github.com/SamSaffron/memory_profiler/blob/master/LICENSE.txt
# Copyright (c) 2013 Sam Saffron
# MIT License
module MemoryProfiler
VERSION = "0.9.14"
end
@robmckinnon
robmckinnon / raspberry-pi-setup.sh
Last active Oct 3, 2019
raspberry pi buster setup
View raspberry-pi-setup.sh
cp wpa_supplicant.conf /Volumes/boot/
touch ssh
cp ssh /Volumes/boot
ssh pi@raspberrypi.local
# raspberry
passwd
# new p/w
exit
ssh pi@raspberrypi.local
sudo raspi-config
View store
{
"@id": "https://gist.github.com/robmckinnon/f6a2dcc02e98a66c74a50d7bc44e9c72/raw/store",
"@type": "Store",
"name": "Links Bike Shop",
"description": "The most \"linked\" bike store on earth!",
"product": [
{
"@id": "https://gist.githubusercontent.com/robmckinnon/f6f85a7708f24c3736de3ae4a93bd6ce/raw/links-swift-chain",
"@type": "Product",
"name": "Links Swift Chain",
@robmckinnon
robmckinnon / links-swift-chain
Last active Oct 24, 2018
links-swift-chain
View links-swift-chain
View store.jsonld
{
"@id": "http://store.example.com/",
"@type": "Store",
"name": "Links Bike Shop",
"description": "The most \"linked\" bike store on earth!",
"product": [
{
"@id": "p:links-swift-chain",
"@type": "Product",
"name": "Links Swift Chain",
@robmckinnon
robmckinnon / application.ex
Created Apr 10, 2018
Add GenServer implementation to supervision tree in application.ex
View application.ex
defmodule NodeProcess.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
# List all child processes to be supervised
children = [
@robmckinnon
robmckinnon / wrapper.sh
Created Apr 10, 2018
Elixir 1.6 Port documentation recommends the use of a process wrapper script to prevent zombie processes.
View wrapper.sh
#!/bin/sh
"$@" &
pid=$!
while read line ; do
echo line
done
kill -KILL $pid
@robmckinnon
robmckinnon / server.ex
Last active Apr 10, 2018
A GenServer implementation that starts a Node.js server process using Elixir ports.
View server.ex
defmodule NodeProcess.Server do
@moduledoc """
A GenServer implementation that starts a Node.js server process using Elixir ports.
"""
# Elixir automatically defines callbacks not overriden
use GenServer
@doc """
Called when application started via application.ex.