refactor: remove deprecated pearl scripts

This commit is contained in:
2025-11-18 08:24:28 +01:00
parent 0d9b2d35b6
commit d2b2558fc2
2 changed files with 0 additions and 146 deletions

View File

@@ -1,62 +0,0 @@
#!/bin/perl -w
use DBI;
use Data::Dumper;
use warnings;
use strict;
# In order to run this script you need to install:
# - cpan install DBI
# - cpan install DBD::SQLite
my $dbfile = shift || die("No File");
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","","");
my $sth = $dbh->prepare("select t.ID, t.address, p.PhaseName, p.PhaseBegin, p.PhaseEnd
from Transactions t, Phases p
where t.ID = p.Transact
and (PhaseName='REQ' or PhaseName='RESP');");
$sth->execute();
my @score;
my @timelog;
my $counter = 0;
my $start = 0;
print "address, delay\n";
while(my @row = $sth->fetchrow_array)
{
my $id = $row[0];
my $phase = $row[2];
my $addr = $row[1];
if($phase eq "REQ")
{
$start = $row[4];
$timelog[$counter] = $start;
}
elsif($phase eq "RESP")
{
my $end = $row[3];
my $delay = $end - $start;
#if($counter > 1)
#{
#print relative time:
#print ($timelog[$counter] - $timelog[$counter-1]);
#print ", ";
#print address
print $addr;
print ", ";
#print delay
print $delay;
print "\n";
#}
#$counter++;
}
}

View File

@@ -1,84 +0,0 @@
#!/bin/perl -w
use MIDI; # ...which "use"s MIDI::Track et al
use DBI;
use Data::Dumper;
use warnings;
use strict;
my $dbfile = shift || die("No File");
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","","");
# Get time:
my $sth = $dbh->prepare("SELECT clk FROM GeneralInfo");
$sth->execute();
my $result = $sth->fetch;
my $timebase = $result->[0];
$sth = $dbh->prepare("SELECT p.PhaseName, p.PhaseBegin, p.PhaseEnd, t.TBank
FROM Phases p, Transactions t
WHERE (p.PhaseName = 'WR' OR p.PhaseName = 'RD')
AND p.Transact = t.ID
ORDER BY PhaseBegin");
$sth->execute();
my @score;
push(\@score, ['text_event', 0, 'Sonification']);
push(\@score, ['patch_change', 0, 1, 8]);
push(\@score, ['instrument_name', 0, 81]);
while(my @row = $sth->fetchrow_array)
{
#print $row[0]."\t".$row[1]."\t".$row[2]."\t".$row[3]."\n";
# ('note', starttime, duration, channel, note, velocity)
my $note;
if($row[3] == 0)
{
$note = 72; #C
}
elsif($row[3] == 1)
{
$note = 75; #Eb
}
elsif($row[3] == 2)
{
$note = 76; #E
}
elsif($row[3] == 3)
{
$note = 77; #F
}
elsif($row[3] == 4)
{
$note = 78; #Gb
}
elsif($row[3] == 5)
{
$note = 79; #G
}
elsif($row[3] == 6)
{
$note = 82; #Bb
}
elsif($row[3] == 7)
{
$note = 84; #C
}
push(\@score, ['note', $row[1]/$timebase, 1, 1, $note, 96]);
}
#print Dumper(\@score);
#MIDI::Score::dump_score( \@score );
my $track = MIDI::Track->new;
my @events = @{MIDI::Score::score_r_to_events_r( \@score )};
$track->events(@events);
#$track->dump();
my $opus = MIDI::Opus->new({ 'format' => 0, 'ticks' => 240, 'tracks' => [ $track ] });
$opus->write_to_file('cowbell.mid');