"D Min7 4" );
# Add section to song.
$song->add_section($section);
# Export as json.
print $song->json, "\n";
=head1 DESCRIPTION
Chordbot is a songwriting tool / electronic backup band fo
ordBot can import and export songs in JSON format. Music::ChordBot
provides a set of modules that can be used to programmatically
build songs and produce the JSON data suitable for import into
ChordBo
sub preset {
return $presets{$_[1]} if %presets;
use JSON ();
my $json = JSON->new;
while ( <DATA> ) {
my $data = $json->decode($_);
my $preset = __PACKAGE__->new;
$preset->chorus
$song->name("Perl Song");
$song->tempo(120);
$song->add_section(...);
print $song->json, "\n";
=head1 METHODS
=head2 new [ args ]
Creates a new Music::ChordBot::Opus object.
Initial
y || "opus" ] );
}
=head2 json [ pretty ]
Produces a string representing the song, in JSON format, suitable
for import into the ChordBot app.
If argument is true, the JSON is pretty-printed for rea
.
=cut
sub json {
my ( $self, $pretty ) = @_;
$self->_wrapup;
use JSON ();
my $json = JSON->new;
$json->canonical(1);
$json = $json->pretty if $pretty;
$json->encode($sel
construct a CordBot song. Upon program termination, the song is
written out to standard output in JSON format, suitable for import into
the ChordBot app.
=cut
our $VERSION = 0.01;
use Music::ChordB
he program.
sub END {
_export() if $song;
}
sub json { $song->json }
sub _export {
binmode( STDOUT, ':utf8');
print STDOUT $song->json, "\n";
}
=head1 QUICK ACCESS CHORDS
For convenien