This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: Copyright (c) 2023 Tod Kurt | |
# | |
# SPDX-License-Identifier: MIT | |
""" | |
`sleepy_keys` | |
============= | |
HID System Control Powerdown / Sleep / Wake device helper library | |
* Author(s): Tod Kurt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple MIDI input using MIDI Library on Pico | |
// 2 Mar 2023 - @todbot / Tod Kurt | |
#include <MIDI.h> | |
// Serial MIDI, could be "Serial1" or "Serial2" depending on pins on Pico | |
// See: https://arduino-pico.readthedocs.io/en/latest/serial.html | |
// and https://pico.pinout.xyz/ | |
MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDIserial); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# generated by PrusaSlicer 2.2.0+ on 2020-04-02 at 04:02:32 UTC | |
[print:0.175mm - Monoprice Mini Select v2] | |
avoid_crossing_perimeters = 0 | |
bottom_fill_pattern = rectilinear | |
bottom_solid_layers = 3 | |
bottom_solid_min_thickness = 0 | |
bridge_acceleration = 0 | |
bridge_angle = 0 | |
bridge_flow_ratio = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# wire a rotary encoder to GP2,GP3, and encoder switch to GP4, with commons going to Gnd | |
import board | |
import rotaryio | |
import keypad | |
import usb_hid | |
from adafruit_hid.keyboard import Keyboard | |
from adafruit_hid.keycode import Keycode | |
CLK_PIN = board.GP4 | |
DT_PIN = board.GP3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# synthio_midi_synth.py - pretty usable MIDI-controlled synth using synthio in CircuitPython | |
# 11 May 2023 - @todbot / Tod Kurt | |
# Uses cheapie PCM5102 DAC on QTPY RP2040 | |
# Video demo: https://www.youtube.com/watch?v=N-PbbWWDE6k | |
# Features: | |
# - midi velocity controls attack rate (gentle press = slow, hard press = fast) | |
# - notes have small random detune on all oscillators to reduce phase stacking | |
# - adjustable number of detuned oscillators per note 1-5 (midi controller 83) | |
# - five selectable waveforms: saw, squ, sin, noisy sin, noise (midi controller 82) | |
# - vibrato depth on mod wheel (midi controller 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
tinyusb_hid_ctrl_mousesscroll.ino | |
2021 @todbot | |
Modified example from | |
https://github.com/adafruit/Adafruit_TinyUSB_Arduino/blob/master/examples/HID/hid_composite/hid_composite.ino | |
This sketch demonstrates multiple report USB HID. | |
Press button pin will move | |
- press 'Ctrl' key | |
- mouse scroll up using scrollwheel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Modified 12 Jun 2024 - @todbot -- added USB MIDI forwarding | |
* originally from: https://github.com/rppicomidi/EZ_USB_MIDI_HOST/blob/main/examples/arduino/EZ_USB_MIDI_HOST_PIO_example/EZ_USB_MIDI_HOST_PIO_example.ino | |
* Be sure to set "Tools / CPU Speed" to 120 MHz or 240 MHz and | |
* be sure to set "Tools / USB Stack" to "Adafruit TinyUSB" | |
*/ | |
/* | |
* The MIT License (MIT) | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
beatfader_demo.py -- fade between different drum loops | |
10 Jun 2024 - @todbot / Tod Kurt | |
originally from | |
https://github.com/todbot/circuitpython-tricks/blob/main/larger-tricks/beatfader.py | |
Demonstrate how to play WAVs via PWM audio | |
Functions, designed for QTPy RP2040 or Xiao RP2040: |
NewerOlder