This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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)], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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..."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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; |
NewerOlder