Skip to content

Instantly share code, notes, and snippets.

View albedozero's full-sized avatar

Bill Peterson albedozero

View GitHub Profile
@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 / chisqprob_demo.py
Last active November 24, 2021 17:29
Chi-square probability using scipy
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import chi2
# load the data
data = np.loadtxt('chisqprob_demo.py', delimiter=',', skiprows=30, max_rows=3200)
vmeas = data[:,0]
vmodel = data[:,1]
sd_volts = 0.06 # voltage measurement uncertainty (estimated)
@albedozero
albedozero / lesson1.yaml
Last active November 29, 2021 02:43
The example fluidpatcher bank file constructed in video lesson 1: https://youtu.be/k6_rTFHzgo0
# basic bank file
patches:
Electric Piano:
1: FM Piano.sf2:000:000
Synth:
1: VintageDreamsWaves-v2.sf2:000:042
Jazz Combo:
1: FluidR3_GM.sf2:000:004
10: FluidR3_GM.sf2:128:000
2: FluidR3_GM.sf2:000:033
@albedozero
albedozero / lesson2.yaml
Last active December 6, 2021 08:41
The example fluidpatcher bank file constructed in video lesson 2: https://youtu.be/wF9XhXp0ONs
# fluidsettings and bank vs. patch level
patches:
Piano:
1: FluidR3_GM.sf2:000:000
Rhodes EP:
1: FluidR3_GM.sf2:000:004
fluidsettings:
synth.reverb.room-size: 0.1
Legend EP:
1: FluidR3_GM.sf2:000:005
@albedozero
albedozero / squishbox-install.bash
Last active June 7, 2021 16:52
Install script for SquishBox and/or headless Raspberry Pi synth
#!/bin/bash
installdir=""
UPDATED=false
UPGRADE=false
PYTHON_PKG=""
ASK_TO_REBOOT=false
promptorno() {
read -r -p "$1 (y/[n]) " response < /dev/tty
@albedozero
albedozero / lesson3.yaml
Last active December 9, 2021 19:16
The example bank file constructed in fluidpatcher lesson 3: https://youtu.be/53OFZnKhPa8
# router rules
patches:
Layered Piano/Strings:
1: FluidR3_GM.sf2:000:000
2: FluidR3_GM.sf2:000:042
router_rules:
- {type: note, chan: 1=2}
Split EP and Bass:
3: FluidR3_GM.sf2:000:004
2: FluidR3_GM.sf2:000:033
@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 / 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 / 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 / lesson4.yaml
Last active February 6, 2022 01:30
The example FluidPatcher (https://github.com/albedozero/fluidpatcher) bank file constructed in lesson 4 (https://youtu.be/K_TKv0kQubU)
# messages keyword and init block
init:
fluidsettings:
synth.reverb.level: 1.0
synth.reverb.room-size: 0.8
synth.reverb.damp: 0.8
synth.reverb.width: 5.0
messages: [cc:1:74:0, cc:1:91:60]
messages: