Skip to content

Instantly share code, notes, and snippets.

@poetaster
poetaster / ToF_ThereminDiscrete.rb
Created November 13, 2024 08:08 — forked from rbnpi/ToF_ThereminDiscrete.rb
Laser ToF sensor theremin (updated Aug 2020)for Sonic Pi Full article at https://rbnrpi.wordpress.com/new-sonic-pi-theremin-using-time-of-flight-laser-sensor/ and video at https://youtu.be/MPgnz9gjeEc (osctheremin.py script now updated)
#Sonic Pi theremin using time of flight sensor VL531X
#Discrete note version (c: major {changeable})
#by Robin Newman, August 2018 updated August 2020
with_fx :reverb,room: 0.8,mix: 0.7 do
use_synth :tri
#start long note at zero volume: will be controlled later by k
k = play octs(0,2),sustain: 10000,amp: 0
set :k,k #store k in time-state reference :k
live_loop :theremin do
use_real_time
@poetaster
poetaster / code.py
Created November 9, 2024 16:42 — forked from sandyjmacdonald/code.py
CircuitPython USB MIDI to serial MIDI converter for Raspberry Pi Pico (RP2040)
# CircuitPython USB MIDI to serial MIDI converter for Raspberry Pi Pico (RP2040).
# IMPORTANT! Should *only be used for MIDI in*, i.e. from USB devices to hardware
# MIDI synths, and *not* in the opposite direction. Doing so could risk damage to
# the microcontroller, your computer, or both.
# Wire a 10Ω resistor from the Tx pin on the Raspberry Pi Pico or other
# RP2040 board to the 3.5mm stereo jack tip, a 33Ω resistor from the 3v3 pin on
# the Raspberry Pi Pico to the 3.5mm stereo jack ring, and the ground pin on the
# Raspberry Pi Pico to the 3.5mm stereo jack sleeve.
@poetaster
poetaster / trinkey_theremin_pitch_code.py
Created November 8, 2024 16:20 — forked from todbot/trinkey_theremin_pitch_code.py
Trinkey MIDI Theremin with Pitch! (will also work on any other CircuitPython devices with `touchio`)
# trinkey_theremin_pitch_code.py -- Trinkey MIDI Theremin! with pitch control!
# 2021 @todbot
# left antenna: pitch (by multiple MIDI notes, put your synth in legato mode)
# right antenna: filter cutoff
# video demo in comment below
#
import time
import board
import neopixel
import touchio