From d2b2558fc2e041931264cd3a625b55e11b556d0d Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Tue, 18 Nov 2025 08:24:28 +0100 Subject: [PATCH] refactor: remove deprecated pearl scripts --- .../traceAnalyzer/scripts/dataExtractForNN.pl | 62 -------------- .../traceAnalyzer/scripts/sonification.pl | 84 ------------------- 2 files changed, 146 deletions(-) delete mode 100644 extensions/apps/traceAnalyzer/scripts/dataExtractForNN.pl delete mode 100644 extensions/apps/traceAnalyzer/scripts/sonification.pl diff --git a/extensions/apps/traceAnalyzer/scripts/dataExtractForNN.pl b/extensions/apps/traceAnalyzer/scripts/dataExtractForNN.pl deleted file mode 100644 index 585ab601..00000000 --- a/extensions/apps/traceAnalyzer/scripts/dataExtractForNN.pl +++ /dev/null @@ -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++; - } -} - - - diff --git a/extensions/apps/traceAnalyzer/scripts/sonification.pl b/extensions/apps/traceAnalyzer/scripts/sonification.pl deleted file mode 100644 index 75f5d615..00000000 --- a/extensions/apps/traceAnalyzer/scripts/sonification.pl +++ /dev/null @@ -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'); - -