Skip to content

Instantly share code, notes, and snippets.

// ===============================================================
// MIDI to 24 PPQN Clock + Run (USB MIDI) - Teensy LC Firmware
// "Cowboy" Ben Alman, 2022
// https://gist.github.com/cowboy/1af3a69d4b6cae6a099fcf76431bda02
// ===============================================================
int PPQN = 24;
int RUN_PIN = 26;
int RUN_LED_PIN = 20;
@cowboy
cowboy / run-in-console.js
Last active September 8, 2023 09:45
Amits Launch Pad Pro Light Show Editor - Unofficial Launchpad Mini Mk3 support
// Run this in the console at https://midi.amitszone.com/LPP_LIGHTSHOW_BUILDER/
// to get it to work with the Launchpad Mini Mk3. It may work with other new
// Launchpads, I'm not sure (If it does, comment below, thanks!)
(() => {
// Create mapping of Launchpad Pro -> Mini Mk3 notes
// (This is only the mapping for the 8x8 grid area)
const noteMap = {}
for (let i = 1; i <= 8; i++) {
for (let j = 1; j <= 8; j++) {
@cowboy
cowboy / handtrack-detection.html
Last active October 18, 2021 01:34
Hand tracking detection in OBS Studio
<!DOCTYPE html>
<html lang="en">
<head>
<script>
// ===========================================================================
// Hand detection in OBS Studio
// by "Cowboy" Ben Alman - 2021
// https://gist.github.com/cowboy/275360358a2c25fbeafa770ad0efcd25
// ===========================================================================
//
@cowboy
cowboy / bit-string-encoding.js
Last active January 1, 2024 17:41
bit-string-encoding.js
// https://codesandbox.io/s/bit-string-compression-zydb3?file=/src/App.js
const name = 'test_example'
const width = 48
const height = 48
const arr = [
0xffffff000000,
0x8000017ffffe,
0xbffffd400002,
0xa00005400002,
@cowboy
cowboy / cowboy-akai-force-rec-pedal-matrix.ino
Last active September 20, 2023 05:43
Akai Force Rec Pedal w/ 8x8 Matrix Display (USB MIDI) - for Teensy LC
// ===============================================================
// Akai Force Rec Pedal w/ 8x8 Matrix Display (USB MIDI) - for Teensy LC
// "Cowboy" Ben Alman, 2021
// https://gist.github.com/cowboy/6c2230d54aea58577c5b7953ea86aebe
// ===============================================================
// Why does this exist?
//
// I designed this to circumvent an issue with the Akai Force where receiving
// an MMC Rec message signals that the loop should end at the end of the
@cowboy
cowboy / cowboy-akai-force-rec-pedal.ino
Last active September 28, 2021 04:57
Akai Force Rec Pedal (USB MIDI) - for Teensy LC
// ===============================================================
// Akai Force Rec Pedal (USB MIDI) - for Teensy LC
// "Cowboy" Ben Alman, 2021
// https://gist.github.com/cowboy/5ad43d0d369c79b6d6538f076698e17a
// ===============================================================
// Why does this exist?
//
// I designed this to circumvent an issue with the Akai Force where receiving
// an MMC Rec message signals that the loop should end at the end of the
@cowboy
cowboy / delayed-mmc-rec.ino
Last active September 15, 2021 18:46
USB MIDI Delayed MMC Rec (Teensy LC)
// =======================================================
// USB MIDI Delayed MMC Rec - for Teensy LC
// "Cowboy" Ben Alman, 2021
// =======================================================
// What does it do?
//
// This USB MIDI device toggles recording via MMC Rec message, but instead of
// sending the MMC Rec message immediately, it sends the message at the end of
// the current measure.
@cowboy
cowboy / border-filter.hlsl
Last active September 7, 2021 01:30
Draw a border around a source - For use as a filter with StreamFX in OBS Studio
// ===============================================================
// Draw a border around a source
// For use as a filter with StreamFX in OBS Studio
// ===============================================================
// "Cowboy" Ben Alman - 2021
// https://gist.github.com/cowboy/9b33aed126b78f60ca8c126567625fc9
// ===============================================================
// See https://github.com/Xaymar/obs-StreamFX/wiki/Source-Filter-Transition-Shader
uniform float4x4 ViewProj<
@cowboy
cowboy / starship.toml
Created May 19, 2021 13:54
My current starship config
[time]
disabled = false
[status]
disabled = false
map_symbol = true
symbol = "✖ "
not_executable_symbol = " "
not_found_symbol = " "
sigint_symbol = " "
@cowboy
cowboy / midi-merge.c
Created October 20, 2020 21:48
MIDI Merge for ATmega4809 (Curiosity Nano)
/*
* MIDI Merge for ATmega4809
* Copyright (c) 2020 Benjamin Alman
* MIT License
*/
#include <MIDI.h>
MIDI_CREATE_INSTANCE(HardwareSerial, Serial, midi_1);
MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, midi_2);