This is an old revision of the document!


ABCmusic

ABCmusic is a tool for creating music by just using a pencil and a paper. You do not need any software for composing music in the ABC notation. ABCmusic uses characters for writing the music. If you look at a piano keyboard the white keys are named CDEFGAB for one octave. The black keys require two characters like ^C ^D ^F ^G ^A to represent them. The duration of the note is set by adding a number after the note. Here I write a small tune “Chicked dance”. Hopefully it helps to understand the concept of ABCmusic.

X:1 Q:1/4=160 T:Chicken dance M:4/4 L:1/8 K:C "G7" G2 z2 g2 z2 | G2 z2 g2 z2 | G2 g2 G2 g2 | w: G g G g G g G g | G g G g G g G g | w: G2 G G A A E E !segno!| "C" G2 G G A A E E | G2 G G A A c c | w: - With a lit-tle bit of this and a lit-tle bit of that then a lit-tle wig-gle "G7" B2 B2 A2 G2 | F2 F F G G D D | F2 F F G G D D | F2 F F G G B B | w: down and up a-gain. With a lit-tle bit of this and a lit-tle bit of that then a lit-tle jig-gle "C" A2 A2 G2 F2 | E2 G G A A E E | G2 G G A A E E | G2 G G A A c c | w: down and up a-gain. With a lit-tle peck for you and a lit-tle peck for me then a lit-tle gig-gle "G7" B2 B2 A2 G2 | F2 F F G G D D | F2 F F G G D D | F2 F F G G B B | w: too and then a glance. With a lit-tle bit of this and a lit-tle bit of that it's a lot of fun to "C" c2 A2 G2 E2 !dacoda! | C2 G2 _G2 F2 |: E6 G2 | e6 d2 | w: do the bir-die dance. Then we all make a star and d2 c2 c4 | z2 G2 _G2 F2 | E6 G2 | d6 c2 | w: circ-le left. And sing as we go round the "G7" B8 | z2 A2 G2 _G2 | F6 G2 | d6 c2 | w: floor. Then we change hands and circ-le c2 B2 B4 | z2 d2 d2 c2 | c2 B2 B4 |1 z2 A2 G2 F2 | w: to the right. We're ha-ving fun to-night. Let's dance some "C" E4 z4 | z2 G2 _G2 F2 :|2 z2 B2 c2 d2 | "C" c8 | z2 G G A A E E !D.S.! || !coda!C4 z4|] w: more. Then we all Let's dance some more. With a lit-tle bit of more.

Once we have the melody working we have also defined the structure of the music. We now know how many bars there is and how the music phrases will repeat. Then we could have a look at the chords. There is two different chords in this tune. The chord “C” is the major chord and the “G7” is the fifth chord. As we plan to use only one note for representing the bass guitar we could use these two patterns for the chords.

X:1 Q:1/4=160 T:Chicken dance bass chords M:4/4 L:1/8 K:C "G7" D,4 G,4 | D,4 G,4 | D,4 G,4 | D,4 G,4 | D,4 G,4 | D,4 G,4 | "C" C4 G,4 | C4 G,4|]

Finally we can add wood blocks for percussion. The percussion would not have a pitch change at all so we can repeat the same pattern throughout the song.

X:1 Q:1/4=160 T:Chicken dance percussion M:4/4 L:1/8 K:C "G7" D2 G G D2 G2 | D2 G G D2 G2 | D2 G G D2 G2 | D2 G G D2 G2 | D2 G G D2 G2 | D2 G G D2 G2 | "C" D2 G G D2 G2 | D2 G G D2 G2|]

When we combine these three sounds we get an irritating background tune that will annoy you just as much as the Flappy Bird game.

In ABCmusic we need to code every one of these 3 melodies to a string. You can omit white space and bar lines without repeats to save space.

char *melody = “G2 z2 g2 z2 | G2 z2 g2 z2 | G2 g2 G2 g2…”; char *bass = “D,4 G,4 | D,4 G,4 | D,4 G,4 | D,4 G,4…”; char *percussion = “D2 G G D2 G2 | D2 G G D2 G2 | D2 G G D2 G2…”

After this we can play the combined tune by making a call to abcplay()

abcplay(0, melody); abcplay(1, bass); abcplay(2, percussion);

This is how the note part works. But we still have to choose the instrument, the tempo and the volume of the music.

lynx/abcmusic.1611563881.txt.gz · Last modified: 2023/01/26 06:06 (external edit)
Atari is a registered trademark. This project is not endorsed by Atari.
CC Attribution-Share Alike 4.0 International Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International