Jump to content
IGNORED

Developing some Batari Music & Sound Tools


Sprybug

Recommended Posts

Just wanted to let you know, I'm developing a new music engine for Zed, which I'll make available to anyone who wants to include it in their game.

 

It allows use of Patterns (Up to 16), so you can easily repeat sections of music (Save ROM Space!)

Each pattern can hold approximately 5 measures of music (4/4 Time)

Data for the measures is only inputted when there is something to spit out, which saves even more on ROM Space.

Ability to jump to other music patterns out of sequence.

Ability to loop a song.

A databank that sorts the Atari's musical scale to make it easier to input the data.

A special bank for drums and percussion

Ability to hold a note, a natural sustain decay, a slowed sustain decay, or cut a note.

 

And all this I was able to do using only 2 bytes of RAM and one extra bit!

It takes even less RAM (by 7 bits) than the standard way of doing music in your game via Batari!

 

A sequence pointer that is one byte, a pattern pointer that is one nibble, a volume control nibble, and a toggle bit for slow decay.

It does use some of the temp variables, and a few of my own variables I use as temp variables (I need them to last for the whole routine), so be sure to have a few extra bytes handy for those.

 

When I release it, I will also release a sheet that shows the values of the notes on a keyboard, along with the sequence values for note holds for 20,30, and 60 FPS games.  The notes will also include the best key signatures to use for your games, because of Atari's limited musical scale.

 

After this, I am going to start work on an actual Atari 2600 program where you can play around with the TIA to experiment on making new sound effects.

It will show you the values you are using in the interface, so you can write them down and be able to put them in your sound effect data sequences.

 

 

Now of course specs can change because I might have originally overlooked something, which knowing myself, is highly likely.  Like for example, right now, I'm wondering if I have to add even more bytes because of the simultaneous channels doing their own thing or not.  I just finished the program and yet have to take it for a spin, so I'll keep you posted.

 

 

Edited by Sprybug
  • Like 8
  • Thanks 3
Link to comment
Share on other sites

Yep, just as I expected!  I needed to have the decay set up for both channels, so have to add another nibble and byte for that, but still in total that's 2 bits less than the standard method!  Plus it's more compact and takes less ROM space for your music data, while implementing some nifty features.  Let's see if I can get this working.

  • Like 1
Link to comment
Share on other sites

On 7/16/2019 at 10:24 AM, MemberAtarian said:

Soundz like a cool stuff. You begann working with ASM?

Actually, nope!  Still doing Batari.  Just figured out the whole nibble thing by reading the tutorials and trying it out.  I always try to squeeze the most bits I can out of this thing.  This means that other people who use Batari will be able to use this code and format in their own games to make it easier to add a soundtrack.  Now, of course it's not going to write the music for you, but if you know a little musical theory, this can go a long way.

The Sound effect maker, I'll be writing in DPC+ to take advantage of the higher resolution and multiple sprites.  You'll just have to write down the values it gives you on paper or something and then put them in a data statement for your sound effects.  I could release how I handle that too.  It's really simple actually.

  • Like 2
Link to comment
Share on other sites

9 hours ago, Sprybug said:

Actually, nope!  Still doing Batari.  Just figured out the whole nibble thing by reading the tutorials and trying it out.  I always try to squeeze the most bits I can out of this thing.  This means that other people who use Batari will be able to use this code and format in their own games to make it easier to add a soundtrack.  Now, of course it's not going to write the music for you, but if you know a little musical theory, this can go a long way.

The Sound effect maker, I'll be writing in DPC+ to take advantage of the higher resolution and multiple sprites.  You'll just have to write down the values it gives you on paper or something and then put them in a data statement for your sound effects.  I could release how I handle that too.  It's really simple actually.

I may continue my PyTari2600 project later, creating a new language, but it takes too much time. :D And on the other hand, I should create a working graphics kernel on my own, that's the only I thing I cannot do in ASM. :D

  • Like 2
Link to comment
Share on other sites

Currently developing the engine.  I decide to do some more tweaking, so I could have more control over the volume decay, which of course added a whole other byte (2 Nibs) because of the two channels.  Sure, it's now taking a touch more memory than the standard, but the features, ROM space saving space, and the easing of implementing music makes it worth it.  I will release a stand alone engine and a tutorial for it in the near future.

  • Like 2
Link to comment
Share on other sites

On 7/23/2019 at 7:14 AM, Gemintronic said:

I think the visual bB music engine works.  This'll be a big step up though!  The main bottleneck has always been beginner friendly music editing tools for bB games.  Is that a part of this project?  Or, can we import MIDI tunes or something?

Would love to do that one day, and maybe after I finish Zed.  My focus is finishing Zed, although I am taking time to develop this "kit" just because it'll make it easier to make the other music for the other levels, and slim down the ROM Space it uses.  The music that plays at the "end credits" of Zed that you hear, takes about 3K of ROM Space.  With this system it'll take less space, because I can just have it repeat and jump to certain patterns with a pattern table that can hold 16 patterns, and not just have to have the data duplicated again in the standard engine method, which quickly eats up ROM space.

After Zed, I would love to make a MIDI cable device that could hook up through the Atari's Joystick port and then hook up the Midi in/out end to your keyboard.  Then have a cartridge you could plug in, to compose Music with your midi keyboard straight into the Atari.  Then you could use the 2nd joystick port to act as a serial interface with your PC'S USB so you can save the data to a file using a front end program that will run and capture  the data to save as a data file for the Atari 2600 cart, and a text file that you can copy and paste and use in the Batari BASIC music engine I am developing, but that's all a pipe dream.

  • Like 4
Link to comment
Share on other sites

5 hours ago, Sprybug said:

With this system it'll take less space, because I can just have it repeat and jump to certain patterns with a pattern table that can hold 16 patterns, and not just have to have the data duplicated again in the standard engine method, which quickly eats up ROM space.

 

I like that idea. 

  • Like 2
Link to comment
Share on other sites

  • 3 years later...

This sounds amazing. Is it finished? I was trying to use very crude methods myself to "recycle" the parts of the sound that loop instead of having to write the entire song out. Often times it's just a short repetitive drum beat interspered by a melody which can sound like a full length song, and it's a shame to waste so much code on redundant notes. 

 

That said, using the current Batari Music and Sound editor, I have a couple questions:

 

Is the x variable fixed as a dedicated variable in order to use this?

(Meaning if I'm currently using x for other things, I need to free it up and re-assign a different variable so x can be free in order to use the Music and Sound editor in my game?)

 

Also, what are the MINIMUM numbers of variables needed to use the MASE ? (any 2/ x + 1) ? Thanks. 

Link to comment
Share on other sites

12 hours ago, freshbrood said:

This sounds amazing. Is it finished? I was trying to use very crude methods myself to "recycle" the parts of the sound that loop instead of having to write the entire song out. Often times it's just a short repetitive drum beat interspered by a melody which can sound like a full length song, and it's a shame to waste so much code on redundant notes. 

 

That said, using the current Batari Music and Sound editor, I have a couple questions:

 

Is the x variable fixed as a dedicated variable in order to use this?

(Meaning if I'm currently using x for other things, I need to free it up and re-assign a different variable so x can be free in order to use the Music and Sound editor in my game?)

 

Also, what are the MINIMUM numbers of variables needed to use the MASE ? (any 2/ x + 1) ? Thanks. 

 

With topics like this it's a good idea to check the date of the last post.  The post above your reply was from 2019 so it's a safe bet that nothing has happened since then.  Not trying to be snarky.  Just trying to avoid disappointment on your part :)

 

As far as the bB music editor.. I usually feel safe re-using the variables it takes up.  Usually all the 2600 music I can stand resides in the title screen.  So, collisions with other in game variables are not a major issue.

 

 

  • Thanks 1
Link to comment
Share on other sites

The date of the post is exactly why I thought progress may have been made. I know you aren't being snarky and I appreciate your feedback- but I also want to remind you that not everyone is a prolific forum poster (myself) and simply because they (I) fail to update the community in a timely manner does not mean there have been no significant updates. Logical? 

 

As to your response, from my readings it seems implied that x is fixed as a dedicated variable in the music maker- that is the question I am trying to get answered. Can any free variables be used for music maker? Or are there certain ones that must be free for it?

 

I am a prolific recycler of variables and I'm not worried about running out of them- only assigning the wrong ones.. For example certain var46/var47's etc.. are dedicated to screen scrolling if it's being used so they make break things if being used simultaneously for subs while also scrolling the screen. 

 

Currently I use x in many places, and I am trying to figure out if I should replace x with a different variable before comitting to music so it doesn't break things.. and any other variables that may be dedicated to the music maker in bb. Thanks again.

 

 

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