Skip to content

Instantly share code, notes, and snippets.

View jarmitage's full-sized avatar

Jack Armitage jarmitage

View GitHub Profile
@lvm
lvm / ageis.scd
Created April 30, 2019 22:57
ageispolis midi.scd
z = SimpleMIDIFile.read("/home/mauro/Downloads/General MIDIMan - Ageispolis.mid")
(
x = { |smf, channel, track|
var pending = IdentitySet.new, buf = MIDIRecBuf(\seq).absoluteOnsets_(true),
events = smf.noteEvents(channel, track).sort { |a, b|
if(a[1] == b[1]) {
a[2] > b[2] // equal time, put noteOn first
} {
a[1] < b[1] // earlier time first
}
@echophon
echophon / orca_x_hydra.js
Last active September 28, 2022 21:05
orca_x_hydra.js
// Example of OSC control of Hydra video synth w/Orca programming language
// by Yancy Way (echophon)
//
// https://github.com/hundredrabbits/Orca
// https://github.com/ojack/hydra
// https://github.com/ojack/hydra-examples
// https://atom.io/packages/atom-hydra
//
// Prerequisites: Orca, Atom, Atom-hydra extension
//
@munificent
munificent / generate.c
Last active January 27, 2025 18:14
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@wmurphyrd
wmurphyrd / Climate Hawks Vote 2015 Scores.csv
Last active July 22, 2019 03:56
2020 Candidate Climate Leadership Scores
Name Party State Public Engagement Press Releases Bills Sponsored Bills Cosponsored Caucuses Website Total Senator 2020 Hopeful
Whitehouse, Sheldon D RI 30 7 7 7 10 10 71 Whitehouse, Sheldon (D-RI) No
Schatz, Brian D HI 24 5 14 8 4 10 65 Schatz, Brian (D-HI) No
Markey, Ed D MA 20 8 11 6 10 10 65 Markey, Ed (D-MA) No
Sanders, Bernie I VT 17 7 15 4 10 10 63 Sanders, Bernie (I-VT) Yes
Boxer, Barbara D CA 22 4 6 4 10 10 56 Boxer, Barbara (D-CA) No
Cardin, Ben D MD 20 6 0 1 10 10 47 Cardin, Ben (D-MD) No
King, Angus I ME 25 6 0 1 10 5 47 King, Angus (I-ME) No
Cantwell, Maria D WA 19 5 0 3 10 10 47 Cantwell, Maria (D-WA) No
Menendez, Robert D NJ 17 4 0 5 10 10 46 Menendez, Robert (D-NJ) No
@dlublin
dlublin / FFmpeg_HAP_Image_Sequence.txt
Last active November 1, 2024 23:21
Image sequence to HAP movie via ffmpeg
This is based on the tips from,
http://hamelot.io/visualization/using-ffmpeg-to-convert-a-set-of-images-into-a-video/
and adapted it to this line to export to HAP directly from a tif sequence,
"ffmpeg -r 30 -f image2 -s 1920x1080 -i test%02d.tif -vcodec hap -pix_fmt rgba test.mov"
(without quotes of course)
- i is where you set the pattern for the image sequence naming,
(where the %02d means that zeros will be padded until the length of the string is 2 i.e 01…20…30… and so on. If no padding is needed use something similar to pic%d.png or %d.png)
-r is the framerate (fps)
-s is the resolution
@subtleGradient
subtleGradient / youtube-get-the-transcript-text.bookmarklet.js
Last active February 16, 2022 20:17
JS Bookmarklet to Get the text content of any YouTube video that has a transcript!
javascript: void (()=>{
let text = null;
try {
text = document
.querySelector("ytd-transcript-renderer")
.__data
.data
.body
.transcriptBodyRenderer
.cueGroups
@carltesta
carltesta / FourteenBitCC.sc
Last active January 23, 2023 17:15
14-bit MIDI Handler for SuperCollider
FourteenBitCC {
/*
//Use Case:
MIDIIn.connectAll;
~x = FourteenBitCC.new("x", 72, 104);
~x.func = {|val| ("x: "++val).postln};
//MPE Example with Sensel Morph
MIDIIn.connectAll
@ddevault
ddevault / Makefile
Last active February 20, 2024 14:17
Tiny Wayland compositor
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
@endolith
endolith / DFT_ANN.py
Last active April 30, 2025 19:25
Training neural network to implement discrete Fourier transform (DFT/FFT)
"""
Train a neural network to implement the discrete Fourier transform
"""
import matplotlib.pyplot as plt
import numpy as np
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Sequential
N = 32
batch = 10000
@kindohm
kindohm / TidalProc.hs
Created February 6, 2018 22:44
TidalProc.hs
module TidalProc where
import Sound.Tidal.Stream
import Sound.Tidal.Pattern
import Sound.Tidal.Parse
import Sound.Tidal.OscStream
port = 5000
procShape = Shape {