Branch Coverage

blib/lib/MIDI/Tweaks.pm
Criterion Covered Total %
branch 116 168 69.0


line true false branch
134 4383 145 if $e->[0] eq 'note_on'
147 2320 17 unless $e->[0] eq 'note_off'
205 23 0 $_[0] ? :
207 23 0 unless defined $require_sanity
212 23 0 if $require_sanity
260 23 1 if ($args->{'strict'})
271 1341 4293 unless MIDI::Tweaks::is_channel_event($_)
272 4260 33 if (defined $chan) { }
273 2 4258 if ($_->[2] != $chan)
283 1 32 if ($channel_seen[$chan])
293 2095 2198 if (MIDI::Tweaks::is_note_on($_)) { }
2095 103 elsif (MIDI::Tweaks::is_note_off($_)) { }
294 1 2094 if (defined $$noteon[$_->[3]]) { }
304 2093 2 if (defined $$noteon[$_->[3]]) { }
314 2448 1 unless defined $noteon->[$i]
321 2 22 if ($fail)
322 0 2 if $strict eq 'warn'
386 0 8 if $track->channel == 10
418 23 0 ref $_[1] eq 'HASH' ? :
420 0 23 if ($options_r->{'flat'})
441 23 0 if ($options_r->{'dump_tracks'}) { }
446 56 0 if (ref $track) { }
481 0 0 if $e->[0] eq 'track_name'
499 16 4 unless is_channel_event($e)
519 0 51 if ($self->{'_tweaky_abstime'})
520 0 0 unless $force
548 0 65 unless ($self->{'_tweaky_abstime'})
549 0 0 unless $force
555 0 7128 if $e->[1] < $time
581 1 698 if $e->[1] < $time
615 16 0 if ref $_[0] eq 'HASH'
618 0 16 unless ref $mapper eq 'CODE'
621 1 15 if delete $opts->{'copy'}
647 0 8 unless ref $args eq 'HASH'
656 8 0 if ($args->{'int'})
660 72 64 if (is_note_event($_[0]))
662 0 72 unless $_[0][3] >= 0 and $_[0][3] <= 127
666 4 60 if ($_[0][0] eq 'key_signature')
671 0 4 if $f >= 6
672 0 4 if $f < -6
683 0 8 unless $mapper_func
713 0 3 unless ref $args eq 'HASH'
719 2 1 if ($args->{'value'}) { }
1 0 elsif ($args->{'ratio'}) { }
721 0 2 unless $value >= 0 and $value <= 127
725 40 18 unless is_note_on($_[0])
732 20 9 unless is_note_on($_[0])
734 0 9 if $_[0][4] > 127
738 0 3 unless $mapper_func
763 0 4 unless ref $args eq 'HASH'
769 2 2 if ($args->{'value'}) { }
2 0 elsif ($args->{'ratio'}) { }
773 33 3 unless $_[0][0] eq 'set_tempo'
780 33 3 unless $_[0][0] eq 'set_tempo'
785 0 4 unless $mapper_func
808 0 1 unless ref $args eq 'HASH'
814 0 1 if ($args->{'value'}) { }
1 0 elsif ($args->{'ratio'}) { }
816 0 0 unless $value >= 0 and $value <= 127
821 0 0 unless $_[0][0] eq 'control_change' and $_[0][3] == 7
830 29 1 unless $_[0][0] eq 'control_change' and $_[0][3] == 7
833 0 1 if $_[0][4] > 127
837 0 1 unless $mapper_func
868 0 1 unless ref $args eq 'HASH'
874 1 0 if ($args->{'pitch'})
876 0 1 unless $split >= 0 and $split <= 127
880 0 1 if %$args
884 0 1 unless $track->{'_tweaky_abstime'}
890 11 18 unless (is_note_event($_))
897 12 6 if ($_->[3] >= $split) { }
945 0 3 unless $track->{'_tweaky_abstime'}
957 24 70 if $this_event->[0] =~ /^lyric$/
960 0 70 unless (@hi == @lo)
965 18 34 unless (is_note_event($this_event) and @events and &$eqtimes($this_event, $next_event))
973 20 14 if (is_note_on($this_event) and is_note_on($next_event) or is_note_off($this_event) and is_note_off($next_event)) { }
982 12 8 if ($this_event->[3] > $next_event->[3]) { }
1045 0 3 unless $track->{'_tweaky_abstime'}
1058 27 77 if $this_event->[0] =~ /^lyric$/
1060 0 77 unless (@hi == @md and @md == @lo)
1068 60 17 if (is_note_event($this_event)) { }
1070 11 49 if (is_note_on($this_event) and @events and is_note_on($next_event) and &$eqtimes($this_event, $next_event)) { }
11 38 elsif (is_note_off($this_event) and @events and is_note_off($next_event) and &$eqtimes($this_event, $next_event)) { }
1073 3 8 if (is_note_on($events[1]) and &$eqtimes($this_event, $events[1])) { }
1103 3 8 if (is_note_off($events[1]) and &$eqtimes($this_event, $events[1])) { }