Jump to content
Random Terrain

Music Starter using sdata

Recommended Posts

Update:

 

Instead of using the code below, try the Music and Sound Editor that comes with Visual batari Basic. Create music and sound effects using data or sdtata. You can play around with the data and test it as many times as you want with your favorite emulator. The Music and Sound Editor makes the whole process faster and easier.

 

 

 

Music Starter using sdata is my adapted version of code posted in the Ballblazer thread:

 

http://www.atariage....80#entry1615280

 

The 256-byte limitation is removed when using sdata. You can fill a whole 4k bank with music if you want. The volume/control/frequency data is in the same order as what you see in Tone Toy 2008 to make it easier for me since I use Tone Toy 2008 to hunt for sounds.

 

 

Format:

v,c,f (voice 0)

v,c,f (voice 1)

d

 

 

Explanation:

v - volume (0 to 15)

c - control [a.k.a. tone, voice, and distortion] (0 to 15)

f - frequency (0 to 31)

d - duration

 

 

I added a bunch of default data in case you're like me and like to have a guide:

 

  0,0,0
 0,0,0
 1
 0,0,0
 0,0,0
 1
 0,0,0
 0,0,0
 1

 

 

Here's the .bas file:

music_starter_2008y_11m_19d_0632t.bas

 

 

I haven't had time to make any tunes with it yet, but I'll post a few in the future. Feel free to post your own tunes. I'm thinking about trying things like the Doctor Who theme from the Tom Baker years and Darth Vader's theme from Star Wars.

Share this post


Link to post
Share on other sites
Music Starter using sdata is my adapted version of code posted in the Ballblazer thread:

 

http://www.atariage.com/forums/index.php?s...t&p=1615280

 

The 256-byte limitation is removed when using sdata. You can fill a whole 4k bank with music if you want. The volume/control/frequency data is in the same order as what you see in Tone Toy 2008 to make it easier for me since I use Tone Toy 2008 to hunt for sounds.

 

 

Format:

v,c,f (voice 0)

v,c,f (voice 1)

d

 

 

Explanation:

v - volume (0 to 15)

c - control [a.k.a. tone, voice, and distortion] (0 to 15)

f - frequency (0 to 31)

d - duration

 

 

I added a bunch of default data in case you're like me and like to have a guide:

 

  0,0,0
 0,0,0
 1
 0,0,0
 0,0,0
 1
 0,0,0
 0,0,0
 1

 

 

Here's the .bas file:

music_starter_2008y_11m_19d_0632t.bas

 

 

I haven't had time to make any tunes with it yet, but I'll post a few in the future. Feel free to post your own tunes. I'm thinking about trying things like the Doctor Who theme from the Tom Baker years and Darth Vader's theme from Star Wars.

 

Hey this is pretty cool! Thanks!

Share this post


Link to post
Share on other sites

Hello. This tool is great, but I cannot for the life of me figure out how to get 2 channels to play simultaneously. Would you please offer a 2 channel .bas sample?

 

 

 

 

 

 

I am just starting to learn to add sounds. I have 0 coding or music background.. but it's really simple to copy the raw data and paste it over existing data in the .bas file. This seems to only loop one channel continuously.. is that the only way to loop music while also having sound effects? I'd prefer to loop 2 overlapping music channels, one melody, one a beat, and have the player sound affects use the channel for the beat while the melody loops.
 

Share this post


Link to post
Share on other sites
On 3/24/2020 at 11:40 PM, Random Terrain said:

Thanks RT, but what I meant was: 2 channels that simultaneously play a looping rythm.

 

 

CH0 is Melody      (on a loop) volume 1

CH1 is Percussion (on a loop) volume 1

 

 

 

Then, when an action is performed by the playerchar, CH1 is interrupted with a different sound briefly at volume 8, while CH0 Melody continues to loop uninterrupted.

 

When playerchar finishes performing its action, CH1 resumes its Percussion loop at volume 1.

 

Is it possible to have both CH0 and CH1 loop simultaneously?
 


 

Share this post


Link to post
Share on other sites

 I think 7800basic does something like that, but I’m not completely sure. I’m talking this into my phone because I’m not at my computer right now.

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Thank you anyway, I appreciate your links and responses. Would you mind, without all the movement and graphics code, just making a simple 2 channel loop that makes a separate sound when Firepressed? .bas? That would really help me. No other code, no dims, no datasets. I could do what I need with that much, I could probably figure out how to edit the simple Firepressed sound into a separate simple drum beat.

 

Edited by freshbrood

Share this post


Link to post
Share on other sites
Posted (edited)

Fair enough. Thank you!



 



 

The way my mind works, dims just confuse me. Because I reuse and recycle variables so often that if I use dims I often forget what letter is actually behind that dim.. or the dim statement is no longer representative of what the variable does in the new bank. I can appreciate dims for variables that have a single purpose in smaller codes, but when the letter "a" represents score in one bank, then later "a" represents damage, dimming it as "__score" when it's now representing damage would utterly throw me off..

 



 

I just make a notation with a key explaining what letters do what depending on the bank they are in. 



 

Edited by freshbrood

Share this post


Link to post
Share on other sites

In case you didn't know, you can dim the same variable as many times as you want, and use whichever name is most appropriate to the section of code you are working on.

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, freshbrood said:

The way my mind works, dims just confuse me. Because I reuse and recycle variables so often that if I use dims I often forget what letter is actually behind that dim.. or the dim statement is no longer representative of what the variable does in the new bank. I can appreciate dims for variables that have a single purpose in smaller codes, but when the letter "a" represents score in one bank, then later "a" represents damage, dimming it as "__score" when it's now representing damage would utterly throw me off..

 

As Karl G said, the bB page says this:

 

"Note that more than one alias may be mapped to the same variable. This is useful for when you will inevitably need to reuse variables in multiple places."

 

Speaking of variable aliases, if you're using my style, variable aliases start with one underscore and labels start with two.

 

Putting the DIMs (variable aliases) near the beginning of a program in alphabetical order can help others who may have to work on your code. If they are using Visual batari Basic, they can right click on your code, select "Audit Variables" and get a list of all of the variables that you are using.

 

 

  • Like 1

Share this post


Link to post
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.

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