NAME
Music::Harmonica::TabsCreator - Convert tunes into harmonica tabs
SYNOPSIS
use Music::Harmonica::TabsCreator qw(sheet_to_tab_rendered);
say sheet_to_tab_rendered('C D E F G A B C');
DESCRIPTION
tune_to_tab
my %tabs = tune_to_tab($tune)
Convert a sheet music into harmonica tablatures. Sheets can be specified using a flexible syntax like: C D E F
, C# Db
, Do ré mi
, C4 C5
, A B > C D E F G A B > C D D C < B A
(that last example shows how you can switch the current octave if you don’t specify octave numbers with each note).
For more details on the tune format, see the GitHub README.
The function returns a hash (not a hash-ref) where the keys are the identifier of a given harmonica (you can learn more about that harmonica using the get_harmonica_details()
function), and the values are hash-refs where the keys are the key of the harmonica to use to play the tune. The values associated to these keys are arrays of tablatures. Each tablature is itself an array of strings, one for each note making up the tablature.
tune_to_tab_rendered
say tune_to_tab_rendered('Kb B C D E F G A B C');
This is the same thing as tune_to_tab
but the output is returned in a string ready to be displayed to a user. Also this function will not die
(instead a user friendly error will be returned directly in the string).
get_harmonica_details
my %details = get_harmonica_details($harmonica_id);
Given an ID that is one of the key of the hash returned by tune_to_tab()
function this returns a hash containing two keys: name
and tags
where the first has a human readable name for the harmonica and the second a list of tags relevant to the harmonica.
AUTHOR
Mathias Kende <mathias@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2025 Mathias Kende
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.