Skip to content

Instantly share code, notes, and snippets.

View caseyanderson's full-sized avatar

Casey Anderson caseyanderson

View GitHub Profile
/*
midi controls gui
written for midifighter twister
HT Scott Cazan for line 55
*/
s.boot;
MIDIIn.connectAll;
// Filter MIDI Messages by srcID
// (example)
s.boot;
MIDIIn.connectAll;
~organPort = MIDIIn.findPort("QuNexus", "Port 1");
~buttonPort = MIDIIn.findPort("Midi Fighter 3D", "Midi Fighter 3D");
~twisterPort = MIDIIn.findPort("Midi Fighter Twister", "Midi Fighter Twister");
@caseyanderson
caseyanderson / micropython_win_setup.markdown
Last active December 11, 2025 10:18
describes the installation procedure for MicroPython development under Windows 10
@caseyanderson
caseyanderson / subsonic_cleanup.py
Last active November 10, 2019 02:32
cleanup filenames of .wav files for subsonic
"""
subsonic_cleanup
example input: "the body - No One Deserves Happiness - 01 Wanderings.wav"
example output: "01 Wanderings.wav"
usage: python3 subsonic_cleanup.py --path "the body - No One Deserves Happiness/" --ext "wav"
TODO:
* check to see if album or artist has digit, need alternate procedure for such a case
@caseyanderson
caseyanderson / micropython_mac_setup.markdown
Last active January 19, 2020 22:17
describes the installation procedure for MicroPython development under MacOS
@caseyanderson
caseyanderson / NLP_NLTK.md
Last active September 20, 2024 17:33
Natural Language Processing w/ NLTK (Python3)

Natural Language Processing w/ NLTK (Python3)

Pre-flight

(assumes a working Anaconda installation)

  1. Create an Anaconda environment for this workshop: conda create -n scraping python=3.8
  2. Activate the scraping environment: conda activate scraping
  3. Install nltk to our environment: pip install nltk
  4. Instal matplotlib to our environment: pip install matplotlib
  5. Run jupyter notebook in our environment: jupyter notebook
'''
button_mode.py
'''
from machine import Pin
from time import sleep
button = Pin(12, Pin.IN, Pin.PULL_UP)
mode = 0

The Command Line

Materials

MacOS

  • Laptop
  • Terminal

Windows 10

  • Laptop
  • Anaconda Powershell

Materials

  • laptop
  • internet access
  • Raspberry Pi
  • USB cable
  • microSD card
  • SD card reader

Write OS .img to SD card

Introduction to Python

Python is a general-purpose, interpreted, high-level programming language. The syntax of the language has been optimized to emphasize code readability, as well as brevity.

Note: though there are multiple versions of python we will exclusively use Python3

Variables & Strings

A variable is a container for data