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
| sub score ($dt, $event) { | |
| my ($ev, $chan, $note, $vel) = $event->@*; | |
| if ($ev eq 'control_change' && $note == 26 && $vel == 127) { # record | |
| $recording = 1; | |
| log_it(recording => 'on'); | |
| } | |
| elsif ($ev eq 'control_change' && $note == 25 && $vel == 127) { # play | |
| log_it(playing => 'on'); | |
| if (!$playing && @$events) { | |
| warn __PACKAGE__,' L',__LINE__,' ',,"HELLO?\n"; |
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:~/sandbox/Music master> PERL_FUTURE_DEBUG=1 perl rtmidi-callback.pl | |
| Future::IO::_DefaultImpl::F=HASH(0x14db18dd8) was constructed at rtmidi-callback.pl line 349 and was lost near /Users/gene/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/IO/Async/Internals/TimeQueue.pm line 157 before it was ready. |
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
| # ... | |
| sub score_send ($score) { | |
| $loop->add( | |
| IO::Async::Timer::Countdown->new( | |
| delay => 0, | |
| on_expire => sub { $score->play } | |
| )->start | |
| ); | |
| } |
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
| Tick 0 | |
| Tick 1 | |
| Can't use an undefined value as a subroutine reference at /Users/gene/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/IO/Async/Channel.pm line 533. | |
| (in cleanup) Can't call method "ok" on an undefined value at /Users/gene/perl5/perlbrew/perls/perl-5.38.0/lib/site_perl/5.38.0/MIDI/RtMidi/FFI/Device.pm line 203 during global destruction. | |
| shell returned 255 |
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.7047 on perl 5.038000 built for darwin-2level | |
| Work directory is /Users/gene/.cpanm/work/1740077374.80202 | |
| You have make /usr/bin/make | |
| You have LWP 6.72 | |
| You have /usr/bin/tar: bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8 | |
| You have /usr/bin/unzip | |
| Searching Future::IO () on cpanmetadb ... | |
| --> Working on Future::IO | |
| Fetching http://www.cpan.org/authors/id/P/PE/PEVANS/Future-IO-0.16.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
| #!/usr/bin/env perl | |
| use v5.36; | |
| use Data::Dumper::Compact qw(ddc); | |
| use IO::Async::Timer::Periodic; | |
| use IO::Async::Routine; | |
| use IO::Async::Channel; | |
| use IO::Async::Loop; | |
| use Future::AsyncAwait; |
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
| > perl -MTime::Hires=usleep -E'say "Hello"; usleep(1000); say "there."' | |
| Hello | |
| Undefined subroutine &main::usleep called at -e line 1. |
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 strict; | |
| use warnings; | |
| use Data::Dumper::Compact qw(ddc); | |
| use MIDI::RtMidi::FFI::Device (); | |
| my $midi_in = RtMidiIn->new; | |
| $midi_in->open_port_by_name(qr/tempopad/i); |
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.7047 on perl 5.040000 built for x86_64-linux | |
| Work directory is /home/gene/.cpanm/work/1737741557.397385 | |
| You have make /usr/bin/make | |
| You have LWP 6.77 | |
| You have /usr/bin/tar: tar (GNU tar) 1.35 | |
| Copyright (C) 2023 Free Software Foundation, Inc. | |
| License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. | |
| This is free software: you are free to change and redistribute it. | |
| There is NO WARRANTY, to the extent permitted by law. |
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
| # $d->metronome44($d->bars, $d->ride2, $d->quarter, 67) | |
| sub metronome44 { | |
| my $self = shift; | |
| my $bars = shift || $self->bars; | |
| my $cymbal = shift || $self->ride1; | |
| my $tempo = shift || $self->quarter; | |
| my $swing = shift || 50; # percent | |
| my $x = dura_size($tempo) * TICKS; | |
| my $y = sprintf '%0.f', ($swing / 100) * $x; | |
| my $z = $x - $y; |