Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lynx:abcmusic [2021/01/25 07:57] Karri Kaksonenlynx:abcmusic [2023/01/26 06:06] (current) – external edit 127.0.0.1
Line 16: Line 16:
  G2 G G A A E E !segno!| "C" G2 G G A A E E | G2 G G A A c c |  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 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 | + "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 +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 
- F2 F F G G D D | F2 F F G G B B | + "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: this and a lit-tle bit of that then a lit-tle jig-gle +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 
- "C" A2 A2 G2 F2 | E2 G G A A E E | + "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 peck for +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 
- G2 G G A A E E | G2 G G A A c c | + "C" c2 A2 G2 E2 !dacoda! | C2 G2 _G2 F2 |: E6 G2 | e6 d2 | 
-w: you and a lit-tle peck for me then a lit-tle gig-gle +w: do the bir-die dance. Then we all make a star and 
- "G7" B2 B2 A2 G2 | F2 F F G G D D | + d2 c2 c4 | z2 G2 _G2 F2 | E6 G2 | d6 c2 
-w: too and then a glance. With a lit-tle bit of +w: circ-le left. And sing as we go round the 
- F2 F F G G D D | F2 F F G G B B | + "G7" B8 | z2 A2 G2 _G2 | F6 G2 | d6 c2 | 
-w: this and a lit-tle bit of that it's a lot of fun to +w: floor. Then we change hands and circ-le 
- "C" c2 A2 G2 E2 | C2 G2 _G2 F2 +c2 B2 B4 | z2 d2 d2 c2 | c2 B2 B4 |1 z2 A2 G2 F2 
-w: do the bir-die dance. Then we all +w: to the right. We're ha-ving fun to-night. Let's dance some 
-  |: E6 G2 | e6 d2 | +"C" E4 z4 | z2 G2 _G2 F2 :|2 z2 B2 c2 d2 | "C" c8 | z2 G G A A E !D.S.! || 
-w: make a star and +w: more. Then we all Let's dance some more. With a lit-tle bit of
- d c c2 | z2 G2 _G2 F2 | +
-w: circ-le left. And sing as +
- E6 G2 | d6 c2 | +
-w: we go round the +
- B8 | 2z A2 G2 _G2 | +
-w: floor. Then we change +
-F6 G2 | d6 c2 | +
-w: hands and circ-le +
-c2 B2 B4 | z2 d2 d2 c2 | +
-w: to the right. We're ha-ving +
-c2 B2 B4 |1 z2 A2 G2 F2 | +
-w: fun to-night. Let's dance some +
-E4 z4 | z2 G2 _G2 F2 :|2 z2 B2 c2 d2 | +
-w: more. Then we all Let's dance some +
-c8 | z2 G G A A E !D.S.! || +
-w: more. With a lit-tle bit of+
  !coda!C4 z4|]  !coda!C4 z4|]
-w: more.+w: dance.
 </abc> </abc>
-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.+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. This implementation does not parse segments and coda properly so the realtime playback is different from what I wrote. Sorry about it.
 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. 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.
 <abc> <abc>
Line 77: Line 61:
 When we combine these three sounds we get an irritating background tune that will annoy you just as much as the Flappy Bird game. 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 Atari Lynx we use proprietary ABC codes to set the hardware for the tune. You can use these codes for changing an instrument on the fly also. Perhaps the first phrase is played by a flute and the 2nd by piano. I try to describe the recognized operators here.
 +''
 +T10 - Tempo - number of VBL interrupts that makes up a single time slot. The smaller you set this number, the faster the music plays.
 +X7 - waveform. This describes how the feedback links are connected to the polyphonic sound generator. - I don't get it either.
 +I0 - a letter I plus zero means a square wave, a one means a triangle wave. Triange has a smoother sound.
 +V100 - volume. Max is 127, min is 0
 +O2 - octave from 0 to 5. 5 is very low and 0 very high.
 +R0 - envelope ramp up
 +H0 - envelope hold note
 +K3 - envelope ramp down
 +These envelope parameters apply to the volume of a note.
 +''
 +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 = "X7I1V127T10R6H10K1O2 G2 z2 g2 z2 | G2 z2 g2 z2 | G2 g2 G2 g2...";
 +char *bass = "X7O2I1V100T10R0H0K3 D,4 G,4 | D,4 G,4 | D,4 G,4 | D,4 G,4...";
 +char *percussion = "X7O4I1V40T10R0H0K6 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);
 +''
 +The abcmusic drivers are available in different flavours:
 +  * bll
 +  * cc65
 +  * newcc65
 +  * in C-code
 +[[https://bitbucket.org/atarilynx/lynx/src/master/contrib/abcmusic|abcmusic]]
 {{ :lynx:chickendance.mp3 |}} {{ :lynx:chickendance.mp3 |}}