Skip to content

Instantly share code, notes, and snippets.

View ology's full-sized avatar
💭
🤔

Gene Boggs ology

💭
🤔
View GitHub Profile
@ology
ology / .pl
Last active April 21, 2026 21:31
No fills
#!/usr/bin/env perl
use 5.012;
use strict;
use warnings;
use Music::SimpleDrumMachine;
my $groove = {
closed => [qw(1 1 0 1 1 1 1 1 1 1 1 0)],
open => [qw(0 0 1 0 0 0 0 0 0 0 0 1)],
kick => [qw(1 0 0 0 0 0 0 0 1 0 1 0)],
@ology
ology / clock-listener.py
Created April 21, 2026 15:14
Working Python Clock Listener
import mido
# print("Available Inputs:", mido.get_input_names())
port_name = 'IAC Driver Bus 1'
try:
with mido.open_input(port_name) as inport:
print(f"Listening for MIDI clock on '{port_name}'...")
for msg in inport:
if msg.type == 'clock':
@ology
ology / clock-listener.pl
Last active April 21, 2026 09:33
Not getting clock ticks with get_message_decoded()
#!/usr/bin/env perl
use v5.36;
use feature 'try';
use Data::Dumper::Compact qw(ddc);
use MIDI::RtMidi::FFI::Device ();
my $port_name = shift || 'iac'; # on a mac
$SIG{INT} = sub {
say "\nStopping...";
@ology
ology / build.log
Created April 16, 2026 23:59
Alien::RtMidi wn't install on my Windows 10. WTF?
cpanm (App::cpanminus) 1.7049 on perl 5.042002 built for MSWin32-x64-multi-thread
Work directory is C:\Users\diamo/.cpanm/work/1776383768.20420
You have make C:\Strawberry\c\bin\gmake.exe
You have LWP 6.82
Falling back to Archive::Tar 3.04
You have C:\FPC\3.2.2\bin\i386-Win32\unzip.exe
Searching Alien::RtMidi () on cpanmetadb ...
--> Working on Alien::RtMidi
Fetching http://www.cpan.org/authors/id/J/JB/JBARRETT/Alien-RtMidi-0.12.tar.gz
-> OK
@ology
ology / build.log
Created April 16, 2026 15:15
Algorithm::Combinatorics fails to install on my Windows 10 box
cpanm (App::cpanminus) 1.7049 on perl 5.042002 built for MSWin32-x64-multi-thread
Work directory is C:\Users\diamo/.cpanm/work/1776352279.10652
You have make C:\Strawberry\c\bin\gmake.exe
You have LWP 6.82
Falling back to Archive::Tar 3.04
You have C:\FPC\3.2.2\bin\i386-Win32\unzip.exe
Searching Algorithm::Combinatorics () on cpanmetadb ...
--> Working on Algorithm::Combinatorics
Fetching http://www.cpan.org/authors/id/F/FX/FXN/Algorithm-Combinatorics-0.27.tar.gz
-> OK
@ology
ology / clock.py
Created March 29, 2026 16:56
asyncio interval not firing exactly on time?
import asyncio
import mido
from mido import Message
import sys
def periodic_task(loop, interval, task_func):
task_func()
# Schedule the next call recursively
loop.call_later(interval, periodic_task, loop, interval, task_func)
@ology
ology / errors.txt
Created March 28, 2026 01:33
hugo barfs - hints? :)
gene@zappa:~/repos/perldotcom master> hugo server --buildDrafts --buildFuture
Watching for changes in /Users/gene/repos/perldotcom/content/{article,json,legacy}, /Users/gene/repos/perldotcom/data/author, /Users/gene/repos/perldotcom/layouts/{_default,about,latest_articles,partials,shortcodes,...}, /Users/gene/repos/perldotcom/package.json, /Users/gene/repos/perldotcom/static/{css,fonts,images,media,widget}
Watching for config changes in /Users/gene/repos/perldotcom/hugo.toml
Start building sites …
hugo v0.159.1+extended+withdeploy darwin/arm64 BuildDate=2026-03-26T09:54:15Z VendorInfo=Homebrew
WARN deprecated: .Site.Data was deprecated in Hugo v0.156.0 and will be removed in a future release. Use hugo.Data instead.
Built in 2238 ms
ERROR error building site: render: [en v1.0.0 guest] failed to render pages: render of "/authors/adam-kennedy" failed: "/Users/gene/repos/perldotcom/layouts/_default/rss.xml:8:50": execute of template failed: template: rss.xml:8:50: executing "rss.xml" at <.Site.Author.email>: ca
@ology
ology / clock.pl
Created March 26, 2026 17:42
How to add an independent process (like sleep(2); say "Hello";) to this code?
#!/usr/bin/env perl
# Clock an external MIDI device, like a drum machine or sequencer.
# Example: perl clock-gen-async.pl usb 90
use v5.36;
use IO::Async::Loop ();
use IO::Async::Timer::Periodic ();
use MIDI::RtMidi::FFI::Device ();
@ology
ology / .pl
Last active March 26, 2026 16:19
IO::Async::Process exit code 256? Why?
#!/usr/bin/env perl
use v5.36;
use IO::Async::Loop ();
use IO::Async::Process ();
use IO::Async::Timer::Periodic ();
my $loop = IO::Async::Loop->new;
my $timer = IO::Async::Timer::Periodic->new(
@ology
ology / start-stop.pl
Last active March 20, 2026 13:56
start/stop the sequence of a midi device
#!/usr/bin/env perl
use v5.36;
use MIDI::RtMidi::FFI::Device ();
use Time::HiRes qw(sleep);
my $name = shift || 'SE-02'; # MIDI sequencer device
my $bpm = shift || 120;
my $interval = 60 / $bpm / 24;