#!/usr/bin/perl use v5.14; use warnings; my @notes = qw/C C# D D# E F F# G G# A A# B C2 C2#/; my %notes = map {; $notes[$_] => 12 + $_ * 5 } 0 .. $#notes; my @ex = split "\n", <<'EOF'; ----|-\-----------------------------------------------------------------------------+ | } | ----|-/-----------------------------------------------------|----|------------------| |/ 4 | | | | (@) #(@) | ---/|-----------------------------------|----|----|----|----|----|--(@)--|----|-----| / | 4 | | | | | (@) #(@) | | | | -{--|-\------------------|----|----|----|----|--(@)-#(@)------------|----|----|-----| \_|_/ | | | | | (@) #(@) | | ----|\---------|----|----|----|--(@)------------------------------------------------+ |_} | | (@) #(@) (@) #(@) EOF <>; my @song = map { chomp; $notes{$_} } <>; for my $l (0 .. 10) { print substr $ex[$l], 0, 12; print substr $ex[$l], $_, 5 for @song; print substr $ex[$l], 82, 3; say ''; }