Jump to content
mksmith

TIATracker module for batari Basic and 7800basic

Recommended Posts

Welcome to the TIATracker module for batari Basic and 7800basic allowing you to play TIATracker music in your Atari console game.

What is TIATracker
TIATracker is a tool created by Kylearan for making Atari VCS music on the PC and a new sound routine for the VCS. It features ADSR envelopes, up to 7 melodic and 15 percussion instruments, customizable pitch guides for optimizing the number of in-tune notes, a size-optimized and configurable replayer routine and much more.

More information is available here

Example
For a full example of incorporating your TIATracker music into your source check the following depending on your platform:

  • batari Basic - TIATrackerPlayer.bas
  • 7800basic - TIATrackerPlayer.78b


Known issues
Currently only one track per game can be added.

Titlescreen Kernal
Has been tested and works with the Titlescreen module

Releases

20190926 - 20190926.TIATrackerPlayer.zip

Previous Releases

20190125 - TIATrackerPlayer.v1.1.20190125.zip

20190123 - TIATrackerPlayer.20190123.zip

Instructions
The following outlines how to add the TIATracker module to your source and incorporate your music. If you are having issues refer to the example for assistance.

1. Copy the tiatracker folder into the root of your source folder

2. Copy the content of file tiatracker/tiatracker_variables.bas into your variable definitions of your source.

3. Add the following to your source (either at the bottom of your file or bank depending on your requirements):

 rem include the tiatracker source
 asm
 include "tiatracker/tiatracker.asm"
end

4. In the initalisation of your screen add the following to initialise the tracker:

 rem initialise tiatracker
 gosub tiatrackerinit

5. In your screen loop, after the drawscreen call add the following:

 rem play track
 gosub tiatrackerplay



TIATracker
1. Create your music or get someone to do the hard work!

2. Select File > Export track data to dasm... from the menu. On the Save As dialog locate your tiatracker/track folder in your batari Basic game folder, enter a filename of 'track' and click the Save button to export your music.

3. In file tiatracker/track/track_variables.asm remove the Permanent and Temporary variables from the file (otherwise you will receive a compilation error). Note: This will need to be done each time you export your data.

  • Like 6

Share this post


Link to post
Share on other sites

I've tried the standalone example code, that works great with my tia tracker file once the proper changes are made for the variables etc.

 

As a quick test, I tried to integrate the code into an existing program. I usually use bank 2 for title screens, so I've stripped out the title screen code in Bank 2

 

I added the variables required in to bB - compiles, no issues.

 

When I add the code to initialise and call the tracker it refuses to compile with an unresolved symbol list, oddly pointing at the title setup label.

rem *****************************************************
 bank 2
 rem ***************************************************** 
title_setup

 rem initialise tiatracker
 gosub tiatrackerinit
title_loop

 drawscreen
 gosub tiatrackerplay

 goto title_loop

 asm
 include "tiatracker/tiatracker.asm"
end

This is the compiler output

--- Unresolved Symbol List
27.title_setup           0000 ????         (R )
28.title_setup           0000 ????         (R )

 free ram: 0
 DPC free RAM= 603
   35 bytes of ROM space left in bank 1
 Music player size:  $e9
 Track size:  $4bd
   851 bytes of ROM space left in bank 2
   302 bytes of ROM space left in bank 3
   585 bytes of ROM space left in bank 4
   1909 bytes of ROM space left in bank 5
   35 bytes of ROM space left in bank 6
   1310 bytes of ROM space left in graphics bank

If I move the code to the end of bank 2, then every other label gets flagged as unresolved.

 

Probably something I'm doing wrong, need to play with it some more.

 

[edit] forgot to add, I have other code also sharing bank2 but there is enough space as you can see from the compile output.

Edited by Muddyfunster

Share this post


Link to post
Share on other sites

glad to hear it's working with titlescreen kernel, I was thinking I'd have to write a separate titlescreen as a trade off.

 

did you keep everything in the same bank? must be a tight squeeze

Share this post


Link to post
Share on other sites

@Muddyfunster - glad you got it working!

 

I hadn't tried putting the code in another bank - maybe I should give that a try.

Share this post


Link to post
Share on other sites

@Muddyfunster

It doesn't appear to like having anything after the include - that appears to be the reason for the errors you encountered. I tried putting the code in bank 3 and call from bank 6 but received this same problem. Might be an interesting issue to fix...

 

I'll add that to the known issues.

Edited by mksmith

Share this post


Link to post
Share on other sites

Yep, it's kind of limited to bank 6 I think, from the ground up, when starting a project, that's totally fine. Right now, I'm playing code tetris to get things to fit :D

 

to be honest, its a good excuse for me to optimise my code at the same time so it's a good problem for me to work through.

Share this post


Link to post
Share on other sites

Ok, here is a title tune integrated with title screen kernel, TIA Tracker player and Tyre Trax.

 

Great job on the notes by RushJet1

 

@mksmith, again, nice job on figuring this out :)

 

  • Like 2

Share this post


Link to post
Share on other sites

Pleasure mate - sounds great! Rushjet1 wipped that up very quick! Any secrets?

Share this post


Link to post
Share on other sites

Yep, it's kind of limited to bank 6 I think, from the ground up, when starting a project, that's totally fine. Right now, I'm playing code tetris to get things to fit :D

 

to be honest, its a good excuse for me to optimise my code at the same time so it's a good problem for me to work through.

 

I didn't get a chance to take a look today (hopefully in the next few days) - I think it might be the asm labels but not sure... Hopefully I can work it out!

Share this post


Link to post
Share on other sites

Awesome job getting it to play in bB at all!! Really looking forward to the missing link being found!!!

 

This was my best scenario I think, tried to put it in bank 2, only place it would fit

 

--- Unresolved Symbol List
0.__setup 0000 ???? (R )
0._baws2 0000 ???? (R )
_Shooting_Direction2_length ffffa395 ????
_boss_Shooting_Direction_length ffffa38d ????
wall_lumashift_length ffff84ad ????
rail_lumashift_length ffff84a3 ????
_My_Data2_length ffff847c ????
_Random_Y_Pos2_length ffff632e ????
rail_lumashift3_length ffff632a ????
_My_Data_3_length ffff6326 ????
_My_Data_4_length ffff631d ????
_My_Data_2_length ffff6314 ????
_My_Data_length ffff630b ????
musicData_length ffff6240 ????
_rail_lumashift2_length ffff448b ????
bawscolor_length ffff2e00 ????
mysprite0_length ffff2d00 ????
mysprite1_length ffff2c00 ????
mysprite2_length ffff2b00 ????
mytext111_length ffff2a00 ????
mytext222_length ffff2900 ????
mycolor_length ffff2800 ????
mycolor0_length ffff2700 ????
blinky_length ffff26df ????
GA_length ffff26af ????
ER_length ffff269b ????
error_length ffff2687 ????
error2_length ffff267b ????
playcolors_length ffff266f ????
0._wave 0000 ???? (R )
0.__Bank_6 0000 ???? (R )
0.__Bank_3 0000 ???? (R )
31._reset 0000 ???? (R )
0.skipL04916 0000 ???? (R )
0.skipL04917 0000 ???? (R )
0.skipL04904 0000 ???? (R )
0.skipL04905 0000 ???? (R )
0.skipL04912 0000 ???? (R )
0.skipL04918 0000 ???? (R )
0.skipL05059 0000 ???? (R )
31.title_vblank 0000 ???? (R )
0._vblank 0000 ???? (R )
0.skipL05614 0000 ???? (R )
0.skipL05768 0000 ???? (R )
0.skipL05769 0000 ???? (R )
0.skipL05616 0000 ???? (R )
0.skipL05635 0000 ???? (R )
0.skipL05637 0000 ???? (R )
0.skipL05630 0000 ???? (R )
0.skipL05770 0000 ???? (R )
0.skipL05765 0000 ???? (R )
0.skipL05771 0000 ???? (R )
0.skipL05632 0000 ???? (R )
0.skipL05772 0000 ???? (R )
0.skipL05767 0000 ???? (R )
0.skipL05773 0000 ???? (R )
0.skipL05412 0000 ???? (R )
0.skipL03306 0000 ???? (R )
0.skipL03238 0000 ???? (R )
0.skipL02485 0000 ???? (R )
0.skipL02486 0000 ???? (R )
0.skipL03237 0000 ???? (R )
31.__Main_Loop 0000 ???? (R )

 

 

 

 

I love those drums, sounds just like the minimal 80's music I usually listen to :thumbsup:

  • Like 1

Share this post


Link to post
Share on other sites

@Lillapojkenpåön

Yeah - thats the issue @Muddyfunster found above. The include currently needs to be at the end of either your code or last bank. Trying to find a solution :thumbsup:

Share this post


Link to post
Share on other sites

Hi everyone,

 

I believe I have solved the issue of inserting the tiatracker include into anywhere within your code. An erroneous unused label was causing the problem (tt_Player SUBROUTINE). Let me know if you have any further issues.

  • Like 1

Share this post


Link to post
Share on other sites

It compiles now but I still have to keep the includes at the bottom of the bank or else I get a black screen (3F 32K)

 

That's not a problem tho! This is sounding awesome!! Insane that the entire player and HUGE track is only 600 bytes bigger then my previous little bB jingle.

Share this post


Link to post
Share on other sites

It compiles now but I still have to keep the includes at the bottom of the bank or else I get a black screen (3F 32K)

 

That's not a problem tho! This is sounding awesome!! Insane that the entire player and HUGE track is only 600 bytes bigger then my previous little bB jingle.

Glad it's now working!

Share this post


Link to post
Share on other sites

I've noticed what could be a problem / nuance with the bB playback.

 

If the TIA tracker track has speed set per pattern rather than globally, the playback speeds get a bit screwed up and it plays too fast compared to a regular compiled BIN of the TIA music.

 

I noticed the music that Rushjet1 provided for Tyre Trax was too fast compared to the compiled bin he sent. I was using the exact same tracker files but in bB it was playing too fast so I had to fiddle with with pattern speeds at the bottom of the trackdata file to slow things down a bit.

 

Ill post up a comparison later tonight

Edited by Muddyfunster
  • Like 2

Share this post


Link to post
Share on other sites

Did you change the track_variables.asm? It's exclusive to the tune, so is track_init.

 

I also think the variables it uses need to be consecutive

 

and that you have to reset all those variables correctly every time before jumping to the player, the init doesn't take care of all the variables only two in my case, so I added the rest

 

lda #0
sta tt_cur_pat_index_c0
sta tt_cur_note_index_c0
sta tt_timer
sta tt_cur_note_index_c1
sta tt_envelope_index_c0
sta tt_envelope_index_c1
sta tt_cur_ins_c0
sta tt_cur_ins_c1
sta player7x ; tt_ptr
sta player8x ; tt_ptr
lda #12
sta tt_cur_pat_index_c1
The difference you heard could also be the PAL/NTSC difference, PAL plays slower.

Share this post


Link to post
Share on other sites

 

Did you change the track_variables.asm? It's exclusive to the tune, so is track_init.

 

I also think the variables it uses need to be consecutive

 

and that you have to reset all those variables correctly every time before jumping to the player, the init doesn't take care of all the variables only two in my case, so I added the rest

 

lda #0
sta tt_cur_pat_index_c0
sta tt_cur_note_index_c0
sta tt_timer
sta tt_cur_note_index_c1
sta tt_envelope_index_c0
sta tt_envelope_index_c1
sta tt_cur_ins_c0
sta tt_cur_ins_c1
sta player7x ; tt_ptr
sta player8x ; tt_ptr
lda #12
sta tt_cur_pat_index_c1
The difference you heard could also be the PAL/NTSC difference, PAL plays slower.

 

 

 

I was comparing NTSC to NTSC so it wasn't that.

 

the init file and the variables are all correct as are the variables in the bB program. I managed to reproduce the effect with 2 different tunes (both with their own settings). The only common factor is both tunes have variable pattern speeds not a global speed. On global speed tunes its not an issue and the tunes play the same as when run outside of bB

Share this post


Link to post
Share on other sites

Did you change the track_variables.asm? It's exclusive to the tune, so is track_init.

 

I also think the variables it uses need to be consecutive

 

and that you have to reset all those variables correctly every time before jumping to the player, the init doesn't take care of all the variables only two in my case, so I added the rest

 

 

lda #0

sta tt_cur_pat_index_c0

sta tt_cur_note_index_c0

sta tt_timer

sta tt_cur_note_index_c1

 

 

sta tt_envelope_index_c0

sta tt_envelope_index_c1

sta tt_cur_ins_c0

sta tt_cur_ins_c1

 

sta player7x ; tt_ptr

sta player8x ; tt_ptr

 

lda #12

sta tt_cur_pat_index_c1

 

 

The difference you heard could also be the PAL/NTSC difference, PAL plays slower.

Lillapojkenpåön - is this something I should look to fix?

Share this post


Link to post
Share on other sites

Well track_init looks different depending on the tune, but if you clear all variables before the setup (which you allready do in your example) it will be allright.

Only way it could be more clearer is if you moved some of the variables you clear in START_RESTART to TITLE_SETUP

 

TITLE_SETUP
a = 0 : b = 0 : c = 0 : d = 0 : e = 0 : f = 0 : g = 0 : h = 0 : i = 0 : j=0 : k=0
rem initialise tiatracker
gosub tiatrackerinit
Otherwise if you did if switchreset then goto TITLE_SETUP they might not be cleared
but now the information is in this thread so I don't think you have to change anything.

Share this post


Link to post
Share on other sites

Oh, oh, oh!

THANK YOU!

I haven't checked back in a while and I saw this.

I was hoping someone would do this!

I've been using TiaTracker, but without any real way of importing the data into my Batari BASIC program, I shied away from it (also, one of the note values is incorrect and I have to fix it every time manually).

This will be fun to play around with. I've been looking for an easier way to implement music into my games. The traditional way with VBB's sound/music keyboard thing was really the only option, but was painfully slow and I had to manually keep track of what every little chunk meant, which made it hard to know what I was looking at exactly.

Share this post


Link to post
Share on other sites

@Lillapojkenpåön - great thanks. Will leave for now.

 

@Sprybug - no probs! It's a great product (for those who can create music!) and can help elevate batari Basic games to an even higher level for those of us who don't have the time to learn assembly (I can get by just enough to do this sort of stuff but not program a full game!)

Share this post


Link to post
Share on other sites

With Muddy and Rushjet1 teaming up to add some awesome title screen music for both of Muddy's games don't forget you can also easily incorporate TIATracker into your bB game!

  • Like 2

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