ChordBot.pm untested

filter: Statementstmt 0.0% 0 / 7 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 9 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #! perl
2  
3 package Music::ChordBot;
4  
5 use warnings;
6 use strict;
7  
8 our $VERSION = '0.91';
9  
10 =head1 NAME
11  
12 Music::ChordBot - Programmatically build songs for ChordBot
13  
14 =head1 SYNOPSIS
15  
16 Song API (simple):
17  
18 use Music::ChordBot::Song;
19  
20 # Define a song
21 song "Funky Perl";
22 tempo 120;
23  
24 # Define a section (song part)
25 section "Funky Section";
26 style "Kubiac";
27  
28 # Add chords.
29 Dm7 4; Am7; Dm7; Dm7;
30  
31 Song API (explicit chords):
32  
33 # Add chords.
34 chord "D Min7 4";
35 chord "A Min7 4";
36 chord "D Min7 4";
37 chord "D Min7 4";
38  
39 Opus API (powerful):
40  
41 use Music::ChordBot::Opus;
42 use Music::ChordBot::Opus::Section;
43  
44 # The song.
45 my $song = Music::ChordBot::Opus->new(
46 name => "Funky Perl", tempo => 120 );
47  
48 # One section.
49 my $section = Music::ChordBot::Opus::Section->new(
50 name => "Funky Section" );
51  
52 $section->set_style( "Kubiac" );
53 $section->add_chord( "D Min7 4" );
54 $section->add_chord( "A Min7 4" );
55 $section->add_chord( "D Min7 4" );
56 $section->add_chord( "D Min7 4" );
57  
58 # Add section to song.
59 $song->add_section($section);
60  
61 # Export as json.
62 print $song->json, "\n";
63  
64 =head1 DESCRIPTION
65  
66 Chordbot is a songwriting tool / electronic backup band for
67 iPhone/iPad and Android that lets you experiment with advanced chord
68 progressions and arrangements quickly and easily. You can use Chordbot
69 for songwriting experiments, as accompaniment when learning new songs
70 or for making backing tracks for your guitar / saxophone / theremin
71 solos.
72  
73 ChordBot can import and export songs in JSON format. Music::ChordBot
74 provides a set of modules that can be used to programmatically
75 build songs and produce the JSON data suitable for import into
76 ChordBot.
77  
78 ChordBot web site: L<http://www.chordbot.com>.
79  
80 Note that Music::ChordBot requires the full version of ChordBot since
81 the Lite version does not have import capabilities.
82  
83 Currently there are two distinct API's as can be seen from the
84 SYNOPSYS. See L<Music::ChordBot::Song> and L<Music::ChordBot::Opus>
85 for details.
86  
87 =head1 AUTHOR
88  
89 Johan Vromans, C<< <jv at cpan.org> >>
90  
91 =head1 BUGS
92  
93 Please report any bugs or feature requests to C<bug-music-chordbot at rt.cpan.org>, or through
94 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Music-ChordBot>. I will be notified, and then you'll
95 automatically be notified of progress on your bug as I make changes.
96  
97 =head1 SUPPORT
98  
99 You can find documentation for this module with the perldoc command.
100  
101 perldoc Music::ChordBot
102 perldoc Music::ChordBot::Song
103 perldoc Music::ChordBot::Opus
104  
105 =head1 ACKNOWLEDGEMENTS
106  
107 Lars Careliusson, for writing ChordBot and being helpful by providing
108 implementation details so I didn't have to reverse engineer
109 everything.
110  
111 =head1 COPYRIGHT & LICENSE
112  
113 Copyright 2013 Johan Vromans, all rights reserved.
114  
115 This program is free software; you can redistribute it and/or modify it
116 under the same terms as Perl itself.
117  
118 =cut
119  
120 1;