Skip to content

Instantly share code, notes, and snippets.

View RobCranfill's full-sized avatar

Rob Cranfill RobCranfill

View GitHub Profile
@todbot
todbot / synthio_portamento_hack.py
Last active June 28, 2023 00:45
a hacky way to do portamento in synthio in CircuitPython
# synthio_portamento_hack.py -- a hacky way to do portamento in synthio
#
import board, time, random
import audiobusio, audiomixer, synthio
import ulab.numpy as np
lck_pin, bck_pin, dat_pin = board.MISO, board.MOSI, board.SCK
audio = audiobusio.I2SOut(bit_clock=bck_pin, word_select=lck_pin, data=dat_pin)
mixer = audiomixer.Mixer(voice_count=1, sample_rate=28000, channel_count=1,
@todbot
todbot / synthio_filter_test.py
Created June 6, 2023 00:40
trying out new synthio filter PR, knobs control frequency and resonance, in CircuitPython
# synthio_filter_test.py -- trying out new filter PR, knobs control frequency and resonance
# 5 Jun 2023 - @todbot / Tod Kurt
import time, random, board, analogio, audiopwmio, synthio
audio = audiopwmio.PWMAudioOut(board.GP10)
synth = synthio.Synthesizer(sample_rate=22050)
audio.play(synth)
knob1 = analogio.AnalogIn(board.GP26)
knob2 = analogio.AnalogIn(board.GP27)
@todbot
todbot / synthio_two_knob_drone_synth.py
Last active June 28, 2023 02:07
Got a Pico and two pots? Now you got a drone synth. In CircuitPython of course
# synthio_two_knob_drone_synth.py -- Got a Pico and two pots? Now you got a drone synth
# 5 Jun 2023 - @todbot / Tod Kurt
# video demo: https://www.youtube.com/watch?v=KsSRaKjhmHg
import time, random, board, analogio, audiopwmio, synthio
knob1 = analogio.AnalogIn(board.GP26)
knob2 = analogio.AnalogIn(board.GP27)
audio = audiopwmio.PWMAudioOut(board.GP10)
synth = synthio.Synthesizer(sample_rate=22050)
@todbot
todbot / dual_i2s_player.py
Last active July 26, 2023 09:26
Demonstrate using two I2S stereo DACs at once on RP2040 / Raspberry Pi Pico in CircuitPython
# dual_i2s_player.py -- demonstrate using two I2S stereo DACs at once on RP2040 / Raspberry Pi Pico
# 19 May 2023 - @todbot / Tod Kurt
# video of this code: https://www.youtube.com/watch?v=CgqECxhqJEo
import time, board, audiocore, audiobusio
# qtpy rp2040 pins
# in this case, board.* names just match silkscreen, don't indicate functionality
lck1_pin, bck1_pin, dat1_pin = board.MISO, board.MOSI, board.SCK
lck2_pin, bck2_pin, dat2_pin = board.SCL, board.SDA, board.TX
@dglaude
dglaude / notes.md
Created September 24, 2022 21:24
USB Host in CircuitPython
@dglaude
dglaude / adafruit_st25dv16.py
Created December 20, 2021 00:55
Writing URI into st25dv16 from CircuitPython
# SPDX-FileCopyrightText: Copyright (c) 2021 Tim Cocks for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_st25dv16`
================================================================================
CircuitPython driver for the I2C EEPROM of the Adafruit ST25DV16 Breakout
@emxsys
emxsys / raspberry_pi_script_as_service.md
Last active April 6, 2024 13:46
How to run a python script as a service in Raspberry Pi - Raspbian Jessie

How to Run a Script as a Service in Raspberry Pi - Raspbian Jessie

By: Diego Acuña

Original Article: http://www.diegoacuna.me/how-to-run-a-script-as-a-service-in-raspberry-pi-raspbian-jessie/

A pretty common task when using this device, is to run some script (for example a python script) as a service in the operating system so it can start on boot, stop and restart using systemctl and more. In this post I'm going to explain how to set a little script as a service using Raspbian Jessie in a Raspberry Pi.

Example Python Script

@SeppPenner
SeppPenner / Installing Python 3.7.4 on Raspbian.rst
Last active January 8, 2024 12:33
Installing Python 3.7.4 on Raspbian

Installing Python 3.7.4 on Raspbian =================================

As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.4. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).

@timsutton
timsutton / maudio_usb_midi_uninstall.sh
Created December 2, 2014 21:05
M-Audio USB Midi Support uninstall script
#! /bin/bash -p
IFS=
PATH=/bin:/usr/bin
# ================================================================================
# MIDI Plugin
# ================================================================================
/bin/echo "Removing MIDI plug-in /Library/Audio/MIDI Drivers/M-Audio USB Support.plugin."
/bin/rm -rf /Library/Audio/MIDI\ Drivers/M-Audio\ USB\ Support.plugin