+karri Posted February 4, 2019 Share Posted February 4, 2019 I had some requests for fixing bugs in the ABCmusic package so there is now a fairly decent version in https://bitbucket,org/atarilynxunder lynx/contrib/cc65version What is new is that you get feedback when the music ends on a channel. extern void abcstop (); extern void abcplay (unsigned char channel, char *tune); extern unsigned char abcactive[4]; abcstop(); // Initialize engine abcplay (0, "X7 I0 V100 T20 R0 H8 K4 O2 CEG"); // Play C E G notes while (abcactive[0]) ; // Wait until done You also have some new direct calls for setting the sound on the hardware. // abcoctave legal values 0..6 extern void __fastcall__ abcoctave(unsigned char chan, unsigned char val); // abcpitch legal values 0..255 extern void __fastcall__ abcpitch(unsigned char chan, unsigned char val); // abctaps legal values 0..511 extern void __fastcall__ abctaps(unsigned char chan, unsigned int val); // abcintegrate legal values 0..1 extern void __fastcall__ abcintegrate(unsigned char chan, unsigned char val); // abcvolume legal values 0..127 extern void __fastcall__ abcvolume(unsigned char chan, unsigned char val); There is also a demo file main.c and a compiled demo test.lnx in the zip file. abcmusic.zip 1 Quote Link to comment Share on other sites More sharing options...
42bs Posted February 4, 2019 Share Posted February 4, 2019 (edited) I had some requests for fixing bugs in the ABCmusic package so there is now a fairly decent version in https://bitbucket,org/atarilynxunder lynx/contrib/cc65version What is new is that you get feedback when the music ends on a channel. extern void abcstop (); extern void abcplay (unsigned char channel, char *tune); extern unsigned char abcactive[4]; abcstop(); // Initialize engine abcplay (0, "X7 I0 V100 T20 R0 H8 K4 O2 CEG"); // Play C E G notes while (abcactive[0]) ; // Wait until done I haven't used ABC yet, but some thoughts: * How about a call-back instead of a memory cell to poll? * abcstop() to initialize seems weird BTW, why not ASL? clc rol clc rol clc rol Edited February 4, 2019 by 42bs Quote Link to comment Share on other sites More sharing options...
+karri Posted February 4, 2019 Author Share Posted February 4, 2019 (edited) I just wanted to fix the problems of why the code used to be out of tune. My 65sc02 asm skills are really rusty. Did not even know that asl existed. About the callback. I am not quite sure how a callback from an interrupt would interact with a callback procedure declared in C. Besides, the abcmusic is no replacement for a real music engine like Chipper or HandyMusic. It is just a small, fast approach. abcstop() is required to initialize the score pointers to point to a byte 0. As the pointers are in zp ram I need to do something at startup. Perhaps I could trick the system to run init at the first interrupt? Edited February 4, 2019 by karri 1 Quote Link to comment Share on other sites More sharing options...
Igor Posted February 6, 2019 Share Posted February 6, 2019 Thanks for listening to my complaints Karri ! I really like the simplicity of the cc65 version, just one asm file and it just works, it was the easiest way to get started with music on the Lynx for me. 1 Quote Link to comment Share on other sites More sharing options...
Igor Posted February 7, 2019 Share Posted February 7, 2019 Tried it out, works like a charm. I like the tutorial code you put together too. 1 Quote Link to comment Share on other sites More sharing options...
8bit-Dude Posted June 28, 2020 Share Posted June 28, 2020 Hi Karri! Just a note to say thanks, I am using this in 8bit-Unity to generate sound effects. ? 2 Quote Link to comment Share on other sites More sharing options...
SlidellMan Posted July 1, 2020 Share Posted July 1, 2020 Have you considered adding USB/MIDI support? Quote Link to comment Share on other sites More sharing options...
Igor Posted January 21, 2021 Share Posted January 21, 2021 (edited) @karri I've added the ABC plugin to the lynx dev wiki just for you - https://www.dokuwiki.org/plugin:abc Edited January 21, 2021 by Igor Quote Link to comment Share on other sites More sharing options...
+karri Posted January 21, 2021 Author Share Posted January 21, 2021 3 hours ago, Igor said: @karri I've added the ABC plugin to the lynx dev wiki just for you - https://www.dokuwiki.org/plugin:abc Thanks! I have actually created a Lynx related plugin also abc2lynx that is written in Python3. Currently I am wondering if it would make sense to create a dedicated plugin to Musescore so that it could export music in Lynx abcmusic format directly. I am not skilled enough to create catchy retro music like @miker, but I am able to use one finger to play a melody on my piano, import it to musescore, output it in abcmusic notation to a Lynx. By repeating the process 4 times there is as much notes as the Lynx hardware can handle. Quote Link to comment Share on other sites More sharing options...
Igor Posted January 23, 2021 Share Posted January 23, 2021 Do you feel like writing a page up on this for the wiki? Will be a valuable resource for anyone else wanting to make music... Quote Link to comment Share on other sites More sharing options...
miker Posted January 23, 2021 Share Posted January 23, 2021 On 1/21/2021 at 3:42 PM, karri said: I am not skilled enough to create catchy retro music like @miker, but I am able to use one finger to play a melody on my piano, import it to musescore, output it in abcmusic notation to a Lynx. By repeating the process 4 times there is as much notes as the Lynx hardware can handle. Ahahaha, thanks a lot. I can't play on any real instrument, to be honest. And I'm not a fan to "code" the music (I did 2 or 3 pieces this way, though, on A8). Quote Link to comment Share on other sites More sharing options...
+karri Posted January 23, 2021 Author Share Posted January 23, 2021 19 minutes ago, Igor said: Do you feel like writing a page up on this for the wiki? Will be a valuable resource for anyone else wanting to make music... Sure. But as I did play in a band in my youth I am pretty far from the guys that create sounds for games. What I can do is to show workflows for transferring music from an ordinary electric piano to ABCmusic on the Lynx. You need an USB cable to connect a modern piano to your laptop. And a copy of Musescore (it is free to download on almost any OS). I am using a Nord Grand piano that is a really top class instrument costing a small fortune. But you can as well activate the software piano keyboard in Musescore. This alternative is free. Some basic skills in reading notes is required. Another thing is that many music styles have - a repetitive percussion rhythm - a repetitive bass pattern - a recognizable structure. The same melody may repeat at certain intervals Luckily for us we don't need to dig into chord progressions as we cannot play chords on a Lynx anyway. In ABCmusic these patterns are often repeating several times. This also saves lots of space in RAM. Perhaps I could use the "Chicken dance" from "Flappy birds" as an example. It uses only 3 channels and makes lots of use of repeats. It also changes the instruments for the A part and the B part. 1 Quote Link to comment Share on other sites More sharing options...
+karri Posted January 23, 2021 Author Share Posted January 23, 2021 I started to work on Chicken Dance. But this brings me down to very significant revelation of what music is all about. The easy way starts from downloading some sheet music, mapping the instruments to the notes, playing the music on a Lynx. This is the way I did it on Flappy Bird testing cart. BUT... This is not the good way to make music. This lacks the "live music" component and the passion. If you take a look at this bass player improvising to the band I am sure you get the idea. So the "best" workflow would be to record the music using midi and try to capture the soul of the performance. But perhaps this would be overkill for the Lynx. Quote Link to comment Share on other sites More sharing options...
+karri Posted January 24, 2021 Author Share Posted January 24, 2021 On 1/21/2021 at 1:24 PM, Igor said: @karri I've added the ABC plugin to the lynx dev wiki just for you - https://www.dokuwiki.org/plugin:abc Do you know how to render the abc notation to notes in the WiKi? Or to MIDI? It appears as abc notation text for me. Quote Link to comment Share on other sites More sharing options...
Igor Posted January 24, 2021 Share Posted January 24, 2021 13 hours ago, karri said: Do you know how to render the abc notation to notes in the WiKi? Or to MIDI? It appears as abc notation text for me. The plugin I had installed required some server-side programs being installed, which is why it didn't render. I've installed an updated version of the plugin that uses JS to render, it seems to work... Quote Link to comment Share on other sites More sharing options...
+karri Posted January 25, 2021 Author Share Posted January 25, 2021 7 hours ago, Igor said: The plugin I had installed required some server-side programs being installed, which is why it didn't render. I've installed an updated version of the plugin that uses JS to render, it seems to work... Thanks! I am currently writing documentation with abc-plugin examples on the Wiki. ABCmusic is really great for people who prefer using a pen and paper for coding their music instead of learning all kind of electronic music composers. 1 Quote Link to comment Share on other sites More sharing options...
Igor Posted January 25, 2021 Share Posted January 25, 2021 Thanks! I had a look at your earlier versions of the Chicken Dance examples, that's a nice way to show how tunes can be composed for the Lynx. What I think would be good is an explanation of what all of the different ABCmusic parameters mean like X, O, I, V, etc. Also as @Nop90 you have to translate to 2x speed for the Lynx I think it was vs what you'd do on standard sheet music? Quote Link to comment Share on other sites More sharing options...
+karri Posted January 25, 2021 Author Share Posted January 25, 2021 10 minutes ago, Igor said: Thanks! I had a look at your earlier versions of the Chicken Dance examples, that's a nice way to show how tunes can be composed for the Lynx. What I think would be good is an explanation of what all of the different ABCmusic parameters mean like X, O, I, V, etc. Also as @Nop90 you have to translate to 2x speed for the Lynx I think it was vs what you'd do on standard sheet music? Thanks. It will take a while before I can write about choosing instruments and attack/hold/decay parameters of ABCmusic. The length of a note is in the abc syntax. L=1/8 means that the unit length is 1/8. So a quarter note is C2 L=1/16 would mean a quarter note to be C4 In the Lynx I am also using T: for tempo meaning how many VBL interrupts means an unit length in real time. The best way is to look at the shortest note you want to play and set that length to 1. Then all other notes are multiple to this. In some tunes I use trioles. So I usually set a quarter note to 12. Then I can split the note into 3,3,3,3 or 4,4,4. MAGIC! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.