Jump to content
IGNORED

ABCmusic re-surrected


karri

Recommended Posts

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

  • Like 1
Link to comment
Share on other sites

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 by 42bs
Link to comment
Share on other sites

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 by karri
  • Like 1
Link to comment
Share on other sites

  • 1 year later...
  • 6 months later...
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.

Link to comment
Share on other sites

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. :P And I'm not a fan to "code" the music (I did 2 or 3 pieces this way, though, on A8).

Link to comment
Share on other sites

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.

 

  • Thanks 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

 

1249725921_ScreenShot2021-01-25at09_11_21.thumb.png.5d3ddfb85cdeb59450edfe3839979b98.png

 

Link to comment
Share on other sites

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...

 

1249725921_ScreenShot2021-01-25at09_11_21.thumb.png.5d3ddfb85cdeb59450edfe3839979b98.png

 

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.

  • Like 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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!

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...