Skip Menu |

This queue is for tickets about the MIDI-Perl CPAN distribution.

Report information
The Basics
Id: 60658
Status: resolved
Priority: 0/
Queue: MIDI-Perl

People
Owner: CONKLIN [...] cpan.org
Requestors: gene [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.82
Fixed in: (no value)



Subject: Typo in $Lengths{dden}
Here is the simple fix: 129c129 < 'en' => .5, 'den' => .75, 'dden' => .875, 'ten' => (1/3), --- Show quoted text
> 'en' => .5, 'den' => .75, 'dden' => .75, 'ten' => (1/3),
Gene Boggs, Software Engineer-at-large
Here is a superior way to populate %Lengths. It also adds thirty-second (tn) and sixty-fourth (fn) notes: 119,135c119,142 < # This list should be rather uncontroversial. < # The numbers here are multiples of a quarter note's length < # The abbreviations are: < # qn for "quarter note", < # dqn for "dotted quarter note", < # ddqn for "double-dotten quarter note", < # tqn for "triplet quarter note" < %Length = (); < my $last = 'w'; < for(qw(w h q e s t f)) { < my $n = $_ . 'n'; < $MIDI::Simple::Length{$n} = $_ eq $last ? 4 : $MIDI::Simple::Length{$last . 'n'} / 2; < $MIDI::Simple::Length{'d'.$n} = $MIDI::Simple::Length{$n} + $MIDI::Simple::Length{$n} / 2; < $MIDI::Simple::Length{'dd'.$n} = $MIDI::Simple::Length{'d'.$n} + $MIDI::Simple::Length{$n} / 4; < $MIDI::Simple::Length{'t'.$n} = $MIDI::Simple::Length{$n} / 3 * 2; < $last = $_; < } --- Show quoted text
> %Length = ( # this list should be rather uncontroversial. > # The numbers here are multiples of a quarter note's length > # The abbreviations are: > # qn for "quarter note", > # dqn for "dotted quarter note", > # ddqn for "double-dotten quarter note", > # tqn for "triplet quarter note" > 'wn' => 4, 'dwn' => 6, 'ddwn' => 7, 'twn' => (8/3), > 'hn' => 2, 'dhn' => 3, 'ddhn' => 3.5, 'thn' => (4/3), > 'qn' => 1, 'dqn' => 1.5, 'ddqn' => 1.75, 'tqn' => (2/3), > 'en' => .5, 'den' => .75, 'dden' => .75, 'ten' => (1/3), > 'sn' => .25, 'dsn' => .375, 'ddsn' => .4375, 'tsn' => (1/6), > # Yes, these fractions could lead to round-off errors, I suppose. > # But note that 96 * all of these == a WHOLE NUMBER!!!!! > > # Dangit, tsn for "thirty-second note" clashes with pre-existing tsn for > # "triplet sixteenth note" > #For 32nd notes, tha values'd be: > # .125 .1875 .21875 (1/12) > #But hell, just access 'em as: > # d12 d18 d21 d8 > #(assuming Tempo = 96) > > );
I have included my tester program that I used to work this out, with the diff loop in isolation. I have tested this patch successfully but see that there are no dist tests for this. Thanks again, Gene Boggs, Software Engineer-at-large
Subject: durations
Download durations
application/octet-stream 682b

Message body not shown because it is not plain text.

Whoops. My diff was backwards and I forgot to remove the "MIDI::Simple::" bits from the loop.
Resolved with 0.83. Thanks! Gene