Skip to content

Instantly share code, notes, and snippets.

@jellea
jellea / div.lua
Last active May 4, 2019 21:38
modulo matrix sequencing
-- div
-- modulo matrix sequencing
-- with variable divisions
-- by lijnenspel
--
-- grid needed
-- x = tracks, y = division
-- add samples via param menu
--
-- enc 2
@jellea
jellea / advent2019-1.fnl
Created December 1, 2019 12:08
Advent Of Code Puzzle 1
(fn mass->fuel [mass]
(-> (tonumber mass) (/ 3) (math.floor) (- 2)))
(let [file (io.open "1.data" "r")
file-contents (file:read "*a")
mods (string.gmatch file-contents "%d+")]
(var total-fuel 0)
(each [mass mods]
(let [fuel (mass->fuel mass)]
(set total-fuel (+ total-fuel fuel))
(fn mass->fuel [mass]
(-> (tonumber mass) (/ 3) (math.floor) (- 2)))
(let [file (io.open "1.data" "r")
file-contents (file:read "*a")
mods (string.gmatch file-contents "%d+")]
(var total-fuel 0)
(each [mass mods]
(let [fuel (mass->fuel mass)]
(set total-fuel (+ total-fuel fuel))
(fn mass->fuel [mass]
(-> (tonumber mass) (/ 3) (math.floor) (- 2)))
(let [file (io.open "1.data" "r")
file-contents (file:read "*a")
mods (string.gmatch file-contents "%d+")]
(var total-fuel 0)
(each [mass mods]
(let [fuel (mass->fuel mass)]
(set total-fuel (+ total-fuel fuel))
function ssidChangedCallback()
newSSID = hs.wifi.currentNetwork()
if newSSID ~= lastSSID then
hs.alert.show("Wifi Change - Zeroing Volume", 5)
hs.audiodevice.defaultOutputDevice():setVolume(0)
end
lastSSID = newSSID
end
@jellea
jellea / SketchSystems.spec
Last active February 26, 2025 16:15
MIDI clock in running
MIDI clock in running
MIDI stop -> No clock running
stop button -> No clock running
Analog clock in
Reset
When no more incoming pulse for ref ppqn ticks -> No clock running
RUN
Run signal low -> No clock running
@jellea
jellea / SketchSystems.spec
Created March 25, 2025 11:21
MIDI clock in running
MIDI clock in running
MIDI stop -> No clock running
stop button -> No clock running
Analog clock in
Reset
When no more incoming pulse for ref ppqn ticks -> No clock running
MIDI start -> MIDI clock in running
MIDI stop -> No clock running
RUN
@jellea
jellea / SketchSystems.spec
Created March 25, 2025 11:24
MIDI clock in running
MIDI clock in running
MIDI stop -> No clock running
stop button -> No clock running
Analog clock in
Reset
When no more incoming pulse for ref ppqn ticks -> No clock running
MIDI start -> MIDI clock in running
MIDI stop -> No clock running
RUN