A scratchpad of quick and dirty CLI calls to noodle against various #Fediverse-related APIs.
import ulab.numpy as np | |
import random | |
import synthio | |
SAMPLE_SIZE = 200 | |
sinwave1 = np.array(np.sin(np.linspace(0, 2*np.pi, SAMPLE_SIZE, endpoint=False)) * 32767, dtype=np.int16) | |
sinwave2 = np.array(np.sin(np.linspace(np.pi/2, 2.5*np.pi, SAMPLE_SIZE, endpoint=False)) * 32767, dtype=np.int16) | |
downwave = np.linspace(32767, -32767, num=3, dtype=np.int16) | |
noisewave = np.array([random.randint(-32767, 32767) for i in range(SAMPLE_SIZE)], dtype=np.int16) |
# 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 code creates a UART TX on 8 sequential pins of the Raspberry Pi Pico. The main use case being MIDI splitter devices
The second 16 port implementation should work for any number of pins, but just acts as a pure copy to those pins instead of having individual control over every pin of every byte. Hence while less flexible, the controlling software is simpler (just send a uart byte and it's copied to every pin).
Only tested in the simulator so far. https://wokwi.com/projects/344345628967436882
Used https://wokwi.com/tools/pioasm to go from uart_tx.pio.h to uart_tx.h
import network | |
import socket | |
import time | |
import struct | |
from machine import Pin | |
NTP_DELTA = 2208988800 | |
host = "pool.ntp.org" |
# mlx90640_pygamer learn guide: | |
# * https://learn.adafruit.com/adafruit-mlx90640-ir-thermal-camera/circuitpython-thermal-camera# | |
# | |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries | |
# SPDX-License-Identifier: MIT | |
# | |
# Adapted by David Glaude for 240x240 screen. | |
# | |
# 1) RedRobotics Pico to Zero Adaptor v0.2: | |
# * https://www.tindie.com/products/redrobotics/pico-2-pi-adapter-board/ |
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on July 7 2020 | |
@author: Pete Midi | |
""" | |
import mido | |
import numpy as np |
Important I'd recommend you use at least a 16GB sd card. I tried it with an 8GB card and it baaaaarely fits. I had to uninstall a lot of packages and regularly clean up.
Go to https://www.raspberrypi.org/downloads/raspbian/ and download the Raspbian Stretch image (either one).
Use Etcher (from https://etcher.io/) to "burn" the image onto the SD card.
# ----------------------------------------------------------------- | |
# .gitignore for WordPress | |
# Bare Minimum Git | |
# http://ironco.de/bare-minimum-git/ | |
# ver 20150227 | |
# | |
# This file is tailored for a WordPress project | |
# using the default directory structure | |
# | |
# This file specifies intentionally untracked files to ignore |
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |