Skip to content

Instantly share code, notes, and snippets.

View nattog's full-sized avatar

Guy Purssell nattog

  • Ableton
  • London
View GitHub Profile
@nattog
nattog / tap-tempo.js
Last active April 27, 2024 21:05
Tap tempo bookmarklet
javascript: (function() {
let counter;
let tapTimes = [];
function initialize() {
const tapTempoElement = document.getElementById("tap-tempo-counter");
if (tapTempoElement) {
counter = tapTempoElement
} else {
counter = document.createElement("div");
@nattog
nattog / input-recorder.ts
Last active October 22, 2022 13:31
Classes to handle recording audio in browser with microphone and recording output of web audio API
import { Recorder } from "./recorder.ts";
type Nullable <T> = T | null;
export class InputRecorder {
private callback: (url: string) => void;
private _launchButton: Nullable<HTMLButtonElement>;
private _recordButton: Nullable<HTMLButtonElement>;
private _stopButton: Nullable<HTMLButtonElement>;
private _errorLabel: Nullable<HTMLDivElement>;
@nattog
nattog / drummer.lua
Last active May 4, 2022 16:22
Drummer :: sequencer for Monome Crow + Druid
-- drummer
-- 4 track pattern sequencer
-- pattern notation looks like this 'x---x---x---x---'
-- update sequence track with set(track, pattern)
--
-- queue a new sequence
-- progress(seq table, period - by default 16)
--
-- control transport
-- start() stop() reset()
@nattog
nattog / audio tools and compositions
Last active March 3, 2021 10:40
audio cli tools and compositions
-- ffmpeg batch convert mp3 to 128k mp3
for i in *.mp3; do ffmpeg -i "$i" -codec:a libmp3lame -b:a 128k "${i%.*}128.mp3"; done
-- ffmpeg batch convert audio files from flac to wav
for i in *.flac; do ffmpeg -i "$i" "${i%.*}.wav"; done
-- batch convert aiff to wav with sox
find -E . -maxdepth 1 -iregex '.*\.(aif|aiff)' -exec bash -c '$0 "$1" "${1%.*}.wav"' sox {} \;
-- ffmpeg john cage 4'33