Skip to content

Instantly share code, notes, and snippets.

View ology's full-sized avatar
💭
🤔

Gene Boggs ology

💭
🤔
View GitHub Profile
@ology
ology / .pas
Last active June 1, 2025 16:35
Beginnings of Delphi12 SQLite DB access
unit Shopping;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, FireDAC.Stan.Intf, FireDAC.Stan.Option,
FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def,
FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.Phys.SQLite,
FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs, FireDAC.VCLUI.Wait,
@ology
ology / CC.pm
Last active May 25, 2025 08:33
Trying to clock from RtMidi
# ...
sub clock_it ($self, $device, $dt, $event) {
return 0 if $self->running;
$self->running(1);
$self->rtc->send_it(['start']);
$self->rtc->loop->add(
@ology
ology / .pas
Created May 16, 2025 18:26
Pascal's Triangle in Pascal
program PascalsTriangle;
uses crt;
var
triangle: array[1..20, 1..20] of integer;
i, j, n: integer;
begin
clrscr;
@ology
ology / .pas
Created May 15, 2025 18:41
Perl Schwartzian transform to Pascal
program SortStrings;
uses SysUtils;
var
unsorted: array of string;
sorted: array of string;
i, j: Integer;
temp: string;
@ology
ology / .txt
Created April 18, 2025 19:12
Possible Win10 + perl 5.40 list_devices issue?
C:\Users\diamo\Documents\Music-Code>perl list_devices.pl
Use of uninitialized value $path in -d at C:/Strawberry/perl/vendor/lib/FFI/CheckLib.pm line 252.
MidiInWinMM::initialize: no MIDI input devices currently available.
MidiInWinMM::initialize: no MIDI input devices currently available.
Input devices:
@ology
ology / .pl
Last active March 22, 2025 02:04
Two controller controlling...
#!/usr/bin/env perl
# fluidsynth -a coreaudio -m coremidi -g 2.0 ~/Music/FluidR3_GM.sf2
# PERL_FUTURE_DEBUG=1 perl rtmidi-dual.pl
use v5.36;
use MIDI::RtController ();
my $input_name_1 = shift || 'joystick'; # midi controller device
@ology
ology / play.pl
Last active March 11, 2025 20:35
Controller play with mostly correct timing!
elsif ($ev eq 'control_change' && $note == 25 && $vel == 127) { # play
log_it(recording => 'off');
$recording = 0;
if (!$playing && @$events) {
log_it(playing => 'on');
$playing = 1;
my $part = sub {
my (%args) = @_;
my $t = $args{bpm} / 60; # beats per second
for my $i (0 .. $args{events}->$#*) {
@ology
ology / score-filter.pl
Last active March 11, 2025 06:56
WIP: Score ... So far: Silence! :D
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";
@ology
ology / out.txt
Created March 4, 2025 08:38
Calling async ScorePlayer
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.
@ology
ology / rtmidi-callback.pl
Created March 4, 2025 06:03
Trying to make ScorePlayer not block - Grrr!
# ...
sub score_send ($score) {
$loop->add(
IO::Async::Timer::Countdown->new(
delay => 0,
on_expire => sub { $score->play }
)->start
);
}