Skip to content

Instantly share code, notes, and snippets.

View albedozero's full-sized avatar

Bill Peterson albedozero

View GitHub Profile
@albedozero
albedozero / spherical_harmonics.py
Created March 15, 2021 07:18
Plots spherical harmonics in 3D using matplotlib
import matplotlib.pyplot as plt
from matplotlib import cm, colors
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from scipy.special import sph_harm
# resolution - increase this to get a smoother plot
# at the cost of slower processing
N = 50
@albedozero
albedozero / fluid_gmbank.yaml
Last active December 30, 2023 20:45
A bank file for fluidpatcher that creates a patch for every preset in FluidR3_GM.sf2
patches:
Yamaha Grand Piano:
1: FluidR3_GM.sf2:000:000
Bright Yamaha Grand:
1: FluidR3_GM.sf2:000:001
Electric Piano:
1: FluidR3_GM.sf2:000:002
Honky Tonk:
1: FluidR3_GM.sf2:000:003
Rhodes EP:
@albedozero
albedozero / geiger_logger.py
Last active October 9, 2023 20:56
MightyOhm geiger counter logging script
#!/usr/bin/env python
# sampling time in seconds
SAMPLE_TIME = 10
# connection settings
MIN_PORT = 1
MAX_PORT = 20
BAUDRATE = 9600
@albedozero
albedozero / nado.yaml
Created September 12, 2022 06:13
white2rnado go-to patches
# jam patches
patches:
Piano:
1: piano/Fazioli Grand.sf2:000:000
router_rules:
- {type: cc, chan: 16=1, par1: 30=64, par2: 0-127*127+0}
HohnerD6 Clav:
2: piano/Dsix Magic.sf2:000:004
router_rules:
@albedozero
albedozero / lesson5.yaml
Last active August 18, 2022 04:04
The example FluidPatcher (https://github.com/albedozero/fluidpatcher) bank file constructed in lesson 5 (https://youtu.be/GfelD8ZofyM)
patches:
BasicLoop:
1: FluidR3_GM.sf2:000:005
sequencers:
loop:
notes: [note:1:Eb4:100, note:1:F4:100, note:1:Ab4:100, note:1:Bb4:100]
router_rules:
- {type: cc, par1: 24, sequencer: loop}
MagicLoop:
1: FluidR3_GM.sf2:000:062
@albedozero
albedozero / lesson6.yaml
Last active August 18, 2022 04:03
The example FluidPatcher (https://github.com/albedozero/fluidpatcher) bank file constructed in lesson 6 (https://youtu.be/baDL0ISiQlI)
patches:
Cheesy Jazz:
1: FluidR3_GM.sf2:000:007
5: FluidR3_GM.sf2:000:032
10: FluidR3_GM.sf2:128:033
midiplayers:
jazz:
file: nonamejazz2.mid
mask: [prog]
tempo: 110
@albedozero
albedozero / midifileinfo
Last active August 13, 2022 18:34
A command-line python script that prints info about a midi file. Requires mido (https://pypi.org/project/mido/)
#!/usr/bin/env python3
from sys import argv
from mido import MidiFile
if len(argv) < 2:
exit("Usage: midifile [filename]")
mid = MidiFile(argv[1])
channels = set()
@albedozero
albedozero / headlesspisynth.md
Last active August 3, 2022 01:58
Setting up a headless Raspberry Pi synth

A complete setup with many options can be performed by running the script at git.io/squishbox with the command

curl -L git.io/squishbox | bash

To perform the minimal steps to set up, first install the required software: Connect to your Pi via ssh or plug in a keyboard and monitor and type in the following commands to install the required software:

sudo apt install git python3-pip libfluidsynth1 fluid-soundfont-gm
sudo pip3 install oyaml RPLCD RPi.GPIO
@albedozero
albedozero / breath.yaml
Last active July 9, 2022 19:41
A simple fluidpatcher (https://github.com/albedozero/fluidpatcher) bank demonstrating use of a breath controller i.e. EWI
patches:
Flute:
1: FluidR3_GM.sf2:000:073
router_rules:
- {type: cc, par1: 2=11} # route breath to expression
messages:
- cc:1:68:127 # enable legato playing
@albedozero
albedozero / glissando.yaml
Created June 1, 2022 18:34
Demonstration of playing glissandos using sequencers and arpeggiators
patches:
Glissandos:
2: FluidR3_GM.sf2:000:000
sequencers:
CMaj:
tdiv: 32
notes: [note:2:C4:100, note:2:D4:100, note:2:E4:100, note:2:F4:100,
note:2:G4:100, note:2:A4:100, note:2:B4:100, note:2:C5:100]
Dm7:
tdiv: 32