Skip to content

Instantly share code, notes, and snippets.

View sporkl's full-sized avatar
🚰

Dmitri Volkov sporkl

🚰
View GitHub Profile
@sporkl
sporkl / async-effects.rkt
Created September 29, 2024 16:47
Toy asynchronous runtime in Racket, inspired by the new OCaml 5 effect system, as an example of where continuations can be useful.
#lang racket
(require racket/trace)
; the core idea
; list of effects
; effect handler has continuation at top
; effects append to list of effects then jump to effect handler
; effect handler handles an effect then jumps to itself (using continuation)
@sporkl
sporkl / noteinverter.py
Created March 2, 2023 15:07
simple python script to flip notes around a pivot note. sort of like negative harmony, but not confined to a single octave
# noteinverter.py
note_names = ["C", "C#/Db", "D", "D#/Eb", "E", "F", "F#/Gb", "G", "G#/Ab", "A", "A#/Bb", "B"]
inverse_note_names = {
"c": 0,
"c#": 1,
"c#/db": 1,
"db": 1,
@sporkl
sporkl / logic-scripter-susrender.js
Last active September 30, 2022 20:03
Renders out sustained notes, so instead of using sustain CC messages, whatever comes after this in the chain will just receive note on and off messages.
/*
With Scripter, you can use JavaScript to create your own custom MIDI processing
effects, including slider controls for real-time interaction.
For detailed information about using Scripter, including code samples,
see the MIDI plug-ins chapter of the Logic Pro X Effects or
MainStage 3 Effects manual.
*/
// example: simple pass through and MIDI monitor
@sporkl
sporkl / logic-scripter-midi-channel-round-robin.js
Last active September 1, 2022 20:30
Logic Scripter MIDI Channel Round-Robin, works well with macOS virtual midi bus to have one MIDI input going to multiple Logic synths.
/*
With Scripter, you can use JavaScript to create your own custom MIDI processing
effects, including slider controls for real-time interaction.
For detailed information about using Scripter, including code samples,
see the MIDI plug-ins chapter of the Logic Pro X Effects or
MainStage 3 Effects manual.
*/
// round robin on midi channels 1 to num channels
Verifying my Blockstack ID is secured with the address 157sjtEPzgELwkQKhtiNxmsBaBqmCYxUp7 https://explorer.blockstack.org/address/157sjtEPzgELwkQKhtiNxmsBaBqmCYxUp7
05AB1E : https://github.com/Adriandmen/05AB1E
2sable : https://github.com/Adriandmen/2sable
APL : https://www.dyalog.com/
Branchylog : https://github.com/JCumin/Brachylog
Bubblegum : https://esolangs.org/wiki/Bubblegum
CJam : https://sourceforge.net/projects/cjam/?source=navbar
Golfscript : http://www.golfscript.com/golfscript/
J : http://jsoftware.com/
Japt : https://github.com/ETHproductions/japt
Jelly : https://github.com/DennisMitchell/jelly
@sporkl
sporkl / CP-1252_chars.txt
Last active September 30, 2022 19:49
A list of all the single-byte characters in the CP-1252 encoding.
!
"
#
$
%
&
'
(
)
*