Jump to content
IGNORED

ABCMusic & sound effects


Ninjabba

Recommended Posts

I've been following the topics on here for better sound effects on the Lynx, and I gotta admit, some great sounds can be generated using those tools! However, I haven't been able to integrate any of it in my project.. as a matter of fact, I haven't been able to create any kind of sound out of the machine. Its been on low priority for a long while.

 

So I've been using the sketch template. With it comes abcmusic, which uses a simple notation for generating some tunes.

 

I can't seem to get it to work though... I got something as follows

 

int intro(void)
{
 tgi_install(&lynxtgi);
 tgi_init();
 CLI();

 silence();
 abcmusic(1,":A2GEcde>dcABGAGE/F/GA2GEcde>dcABGA3z::eae>deae>dcdefgf/g/ageae>deae>dcABGA3z:"); // channel and tune


 while(1) {
/* some other stuff here*/
  abc_update();
 }
}

 

Apart from me not being able to make it work, I assume I cannot get those crazy cool sound effects that I heard from other tools with abcmusic?

Edited by Ninjabba
Link to comment
Share on other sites

in you string you must first set the instrument, volume etc

 

for example here the sound that make clicking dices in my game lynxopoly

 

 

_dicemusic0

dc.b "O3X4I1V100T7R100H2K20"

dc.b "zzddzzczzd"

dc.b 0

the first line is the instrument setting

 

sampo did a great job in space dance (Yastuna2)

i asked him about the abcmusic and i got this help

 

 

Noterna är CDEFGABcdefgab

high note =

low note ~

Pause z

Lenght 2 3 4

Tempo T (0..255)

Volym V (0..255)

Start block |:

Repetera :

 

Basically you create an ASCII description of what you want to play.

 

Like:

tune = "CDEFG";

channel = 0;

abcmusic(channel, tune);

 

You can also mix in instrument commands like

On = octave n=0..6

Xn = XOR taps n=0..511

In = integrate n=0..1

Vn = volume n=0..127

Tn = time n=0..255

Rn = ramp up (attack) n=0..127

Hn = hold n=0..255

Kn = kill sound (decay) n=0..127

 

To find good values for instruments use abccreator.o

 

You can then write your own tune like:

 

tune = "O1 X7 I0 V40 T22 R40 H2 K1 |:CCCE DDDG FFDD C4:"

 

The sounds you can use are:

CDEFGABcdefgab

~ - lower

= - higher

 

Length of a note can be extended by 2,3,4

 

|: = start of a chorus

: = repeat chorus

' ' = spaces are ignored. They are not required anywhere. I added them for readability.

 

The tune should end in character 0.

 

You can run tunes on multiple sound channels simultaneously by calling abcmusic several times:

 

silence();

abcmusic(0, tune0);

abcmusic(1, tune1);

abcmusic(2, tune2);

abcmusic(3, tune3);

Link to comment
Share on other sites

Hi matashen, thanks for the reply! Gives me a better understanding of the notation of the music.

 

I've tried quite some things here using your description of setting up the instrument, volume, etc. but still I don't get any noise..

 

I read in another topic I need to set up some interruptors, but I thought these are setup by initializing lynxtgi (even though its a graphic driver)

Link to comment
Share on other sites

I've managed to generate some noise when calling the abc_update function in the VBL routine. However, after initializing VBL other things like the joystick aren't working anymore...

 

I use install_irq(2, (int)&vbl) to setup the VBL counter which calls abc_update, but I'm also using tgi_install(&lynxtgi) and joy_install(&lynxjoy) to setup the screen and joypad. I read that lynxtgi sets up VBL and other interrupt handlers automatically, but I can't seem to have this working for a regular call to abc_update. Could it be that VBL is interfering other interrupters?

 

void start_irqs(void)
{
   init_irq();
   install_irq(2, (int)&vbl);
   enable_irq(2);
   tgi_install(&lynxtgi); // This will activate the Lynx screen
   joy_install(&lynxjoy); // This will activate the Lynx joypad
   tgi_init();
   CLI();
   tgi_clear();
   tgi_setpalette(pal);
}

Link to comment
Share on other sites

  • 2 weeks later...

It seems to be a problem with the abcmusic version I'm using. Its written in assembly so I have no idea how to work around this. Karri replied to me he might have a C version that could work in my project, but looks like he's a bit busy lately since I haven't heard from him since then.

 

 

When its figured out I'll post a small working project with music integrated. Hopefully soon, because I think I have something interesting to show the people on here once I have some sounds integrated :)

 

In the main time I can only ask: does someone have some sound library that would work with the latest cc65 compiler?

 

Thanks!

Link to comment
Share on other sites

In the main time I can only ask: does someone have some sound library that would work with the latest cc65 compiler?

 

Only a resource hungry modplayer.

And a simple effect player.

For sound player you have to stick to assembler.

 

I guess thats worth checking out. Could you maybe link me to them? My assembly skills are really poor, thats why I try to get around it..

 

Thanks!

Link to comment
Share on other sites

I guess thats worth checking out. Could you maybe link me to them? My assembly skills are really poor, thats why I try to get around it..

 

well i can give you a workign example, but as soon as you want to change things, you may need at least the ability to change the adresses in the assmbler code...

 

well were you find it... just have a guess...

Link to comment
Share on other sites

  • 3 weeks later...

Ninjabba are you using the old newcc65 or the newer newcc65? The abc-notes sent to Matashen are my old notes for the older abc-music in the older newcc65. Here's my notes for abc-music in Karri's MegaPak template for the newer compiler.

 

New(er) Lynx abc notation for the new newcc65 compiler:

 

Octaves:

' one octave higher

, one octave lower

 

thus the range of the notes are:

"A,A,A,A, AAAA aaaa a'a'a'a'"

 

tones: CDEFGABcdefgab

 

^ sharp note

_ flat note

 

tone lengths (I'm not 100% sure if I remember this correctly).

1 = double length

2= x4

4= x8

 

z and x paus

 

I put the music (abc notation) in the music folder.

 

Channels and "play" in abcparser.c However I failed turning on the fourth channel when i made the music for "C-Gull", so that's why there's no drums in that one.

 

The instrument sounds can be altered in abcdriver.c

taps

backup

octave

intergrate

volume

attack

hold

decay

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 years later...

Hej guys,

 

Sorry to bump this pretty old subject. I have abcmusic working in my little game project, but I'm wondering now how to get it to play real songs (instead of random beeps). I found some "midi to abc" music converter, and even song already converted to abc, but it looks slightly different from what abcmusic is capable to read.

 

I'm not a musician, so I'm a bit lost now.

 

@Ninjabba, how did you get your music up and playing for instance?

 

Thanks!

Link to comment
Share on other sites

Thanks. I'm trying abcmusic based on 2004 posts (yeah that's old) on a french dev. forum but it always end to 2 problems:

1) Figuring out the "code" for an instrument

2) Adjusting/tweaking song in "real" abc format to the lynx one.

 

I have read about chipper but I haven't tried it yet, and I think I have read somewhere that it doesn't work with the old newcc65, whioch I still use...

Link to comment
Share on other sites

The problem with abcmusic is that it is terribly much out of tune. There is three versions of it. An BLL version for asm. A newcc65 version and a cc65 version.

 

I can upload all versions to the atarilynx repository in bitbucket.

 

There is also an archive called abcMIDI which converts from midi to Lynx abcmusic format.

 

One thing I would love to do would be to write an abcmusic front end to chipper. Chipper is not out of tune.

 

PS. I pushed my versions into http://bitbucket.org/atarilynx/lynx/src

check contrib/abcmusic

Edited by karri
Link to comment
Share on other sites

Hej guys,

 

Sorry to bump this pretty old subject. I have abcmusic working in my little game project, but I'm wondering now how to get it to play real songs (instead of random beeps). I found some "midi to abc" music converter, and even song already converted to abc, but it looks slightly different from what abcmusic is capable to read.

 

I'm not a musician, so I'm a bit lost now.

 

@Ninjabba, how did you get your music up and playing for instance?

 

Thanks!

 

I've experimented quite a lot with abcmusic and chipper in those days, but chipper is by far superior. Indeed I had DerLuchs creating chiptunes for me, and I converted some chiptunes at some point for smaller projects like Peg Solitaire.

 

I shared the full source which plays a pretty cool tune using chipper, but it will only work with the cc65 toolchain:

 

http://atariage.com/forums/topic/193442-peg-solitaire-source/

Link to comment
Share on other sites

Thanks Ninjabba. The whole chipper thing is definitely too complex for me and my need right now! :-o

 

I'll try to experiment a bit with abcmusic, if not for music, at least for basic sound effects.

 

-> Karri, can you confirm me that there is no support for sharp/flat notes and ching octave in the newcc65 version? (I can deal with the later by changing the instrument in the note sequence though). Thx!

Edited by LordKraken
Link to comment
Share on other sites

There is support for sharps and flats in abcmusic. I even have a pure C version that is easier to understand and modify.

 

I havw the midi to abcmusic sources at home. Right now I am on our summer cottge on an island going to sauna and a swim in the lake. Back to electricity & civilisation on Monday.

Link to comment
Share on other sites

I've thought about this many times but never wrote it here: quite many official Lynx titles have music that sound slightly out of tune too, almost to the point that it could be thought of as a trademark thing of the Lynx haha.

 

@Karri, In that sense I think you're a bit harsh on your own creation (abc music), at least I always liked it ^^ it's a nifty little tool if you're just gonna do some small songs'n'stuff.

 

@LordKraken There is a tool (a Lynx program) made by Karri where you can check for abc sounds, but I'm not sure if it's freeware, I don't remember if it was a part of the MegaPak game cartridge from Songbird.

 

However now when we have chipper I would say that one is much faster and easier to use, at least if you're like me and only want to create some fairly simple songs. You just have to look past all the windows and menus and diagrams and focus on the really simple stuff:

 

1. Eye through some tracker basics: http://wiki.openmpt.org/Manual:_Basics

2. In every row of every column there's three cells where you can put in:

- CELL1: the number of the simple instrument you're going to use for that note. (This is really smart 'cause you can get a lot of stuff done with only four channels).

- CELL2: the note or nothing (a pause)

- CELL3: the part of the song in the playlist

3. The simple instrument is for creating sounds but there's already some good sounds in the insts folder

4. There's some really great songs in the demosongs folder to look at too.

 

*Note you put in the notes with the keyboard (I was clicking aroung with the mouse for much longer than I care to admit) :P

 

I checked and you can download chipper v.1.7.6 from sages homepage (link in his profile)

 

I attached a pdf manual I found on the interwebz (sorry I can't remember where) where some instrument tweaking is explained.

LynxChipper-0.1-ENG.pdf

Edited by Turbo Laser Lynx
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...