Command Tracker Dev Log

All aspects of programming on the Commander X16.
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »


I thought I would start a new thread as the old one was about sparse files, which I decided not to use currently. I think it can be a goal for a nice on disk format but I'm finding using hiram is working pretty well. Yes it's pretty wasteful but saves on CPU cycles and will make editing patterns, when I do start working on the UI, perhaps bearable.

Here's the latest version! With support for 6 channels, though no effects other than volume and note-off. And also no concept of instruments. Each channel is configured to play a static instrument for now:





Next steps, there are many ?  klieptasch and I have been sharing some ideas on how to integrate the Concerto synth engine with the tracker. This opens the door for some really interesting things, and means I can focus on the UI. In this way it also keeps the synth engine separate from the tracker engine so folks could more easily use the various parts of both programs if they wanted to do something else (though given both apps are open source it would also be nice for folks to contribute to either!)

The UI will be a big deal and I'm not actually show how complicated it will be yet haha. I have ideas on how I might do some things but that will all be new to me. But then again so was 6502 and I'm pretty happy with the tracker thus far!

I'm not sure what I will work on next - trying to interface with Concerto or start the UI. I have ideas fresh in my head for Concerto but also editing patterns by hand is quite the pain so I'll have to ponder that more.

Anyways the source code is here:

https://gitlab.com/m00dawg/command-tracker/-/tree/master

I don't have a demo up on the forums yet because I already have some file I/O interactions (pulling in Petdraw screens but this is also the basis to handle song files). But since there is no functional UI, apart from hand coding patterns in hex, not too much to do yet ?

 

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »


I spent part of the weekend better organizing the code into scopes and completely redoing how UI elements are drawn. Using the PetDraw save files was just a bit too much as they are over 9k (since it's the full screen buffer). So I experimented around with programmatically drawing the UI. Might be better ways to do that but it saves a significant amount of space (noting I want to use as much of hi RAM as possible for the banked patterns). I also added the ability to stop and start the song - using the F5 and F8 keys ala Impulse Tracker (F7, as I recall, plays current pattern or plays from current row position). The is the start of actual user interactions.





 

And while I don't have it working yet, I did start to work on an order list section. I decided to do this first because it requires figuring out a lot of things I'll need to do in order to edit patterns, but at a much smaller scope. So right now one can put in hex numbers into the list along with use the arrow keys to navigate around. This doesn't currently account for the editable section of the pane yet, nor does it yet scroll once you get further down the order list.

This is where things currently get a bit odd. Having to convert to/from screen-codes is something I need to improve as I'll probably need to do that quite a bit. My thought was to edit largely in VRAM and to then pull and translate the data at various points (this is where there is that "Press enter to save orders" message). For the tracker, it may have to be more fluid than that, but for the orders list, to start, it may work as a start. I think to do this easily I'll need to use the lower layer like I do with the pattern data. That requires decoupling playback from the pattern display a bit more than I currently have it setup.

But once I do that, I think such a solution could work ok. In pressing enter, it will read the patterns values in the order list in VRAM, since they are characters, it'll then have to convert back to hex numbers (noting the screencodes thing), then simply write out the order list until it sees '--' and write that out to the actual order list array.

I'll also need a way to goto patterns (as I recall in Impulse Tracker, you did that by pressing G on the current pattern the cursor was at) but I think that part would be easy compared to the above but flows right into then needing to figure out how to edit patterns. That's going to be quite a bit more complicated as I can't fit the entire width of a pattern into VRAM and, likewise, editing patterns is much more fluid than the above order list ideas. I'll need to keep track of a lot more state of where the cursor is relative to the real pattern and have a means to scroll/draw to be able to view all 25 channels.

A bit of a ramble so I guess I'll stop here. Small steps, but steps nonetheless!

 

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »


Well no new video yet. I'm having a bit of trouble reliably reading from VRAM that I haven't figured out, but then also ran into a an issue with storing the entire order array in VRAM and using hscroll/vscroll to navigate around. The trouble there is I thought I was using a resolution of 128x256 on the second layer, but it's only 128x128 and I seemed to be clobbering some important video memory by just increasing it.

Thing is, I don't need the drawing routing for the orders list to be fast - I was using the scroll stuff just to, in theory, make it easier to navigate around since I just move the display and I wouldn't have to track as many things (such as the current order # the cursor is at). I think given this, plus having to juggle the pattern data also using the same layer, I will have to scrap these plans.

On the pro, I did write a routine to convert from characters on screen back to a number, something I will need to do regardless among a few other things.

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »


Whew it's taken me several days to finally get to the point where I can seemingly edit orders and they're saved to the order list. I don't have this yet integrated into the player yet so I don't have much to show. And in fact the next thing is to rework how all that actually works, though I'm going to try to at least get editing orders sort of working before I tackle that.

I ran into a weird case where user inputted letters (but not numbers) was giving me back the hi value screencodes. So instead of 'A' being $01 it was $81. That really threw me off and I'm not sure why it's doing that. Other than, perhaps, technically I typed a lower-case 'a' though in VERA it's properly rendered as uppercase. I'm sure there's an explanation there but I couldn't figure that out after significant digging (and definitely a place I hope the X16 dev docs cover).

It's taken me much longer to work on the order list but it's all been good work. I feel like I have a decent handle on how to keep track of things like the cursor. Admittedly I don't have yet scrolling working in the orders list. Pondering that a bit since I currently am allowing up to xFF orders. It looks like I can just squueze the full list on the display but that would be pretty cluttered. I like scrolling better and, either way, I'll have to solve that when editing pattern data.

So no new demo yet, but hopefully soon!

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »


Orders are finally working!





As is a (very basic) UI implementation. I'm sure there's a better way to handle it, but it works for now and lets you play the song sort of int he background while moving between panes. You can even update the orders list while it runs, although I'll probably want to highlight which order is playing. Also need to setup scrolling on the orders list so you can go all the way through all xFF orders.

Some minor UI issues - like the horizontal bar looks pretty ugly while playing (it doesn't connect to the rest of the UI) and there are dangling connectors on the panes but that feels like a minor issue.

Next is actually being able to edit patterns...

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »


Pretty quick update. I just wanted to share the start of pattern editing! Not much yet - there's no key to note translation yet (that's why there's just 3 of the same letter) but navigation works mostly how I want. No scrolling yet either but it's getting there! Obviously adding note translation is the next thing along with keeping track of which octave you're on.







The compiled code size is currently around 4.2k so far so I think I'm doing ok. Gives me hope I shouldn't have any issues with low RAM to add in the remaining features. I started thinking about this because the keyboard-to-note routine might have a lot of branching in it. At least for the first go 'round I wasn't going to worry about optimizing that too much. There's also some other room for optimizations I'm sure.

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »


Pattern editing works!





It's buggy....(and perhaps messy) like if I edit volume after adding a note, something doesn't seem to go quite right. Likewise while I can delete a channel/row (with SHIFT-BACKSPACE), my code to move the cursor to the right spot doesn't work right. So if I'm editing say effects and shift-backspace, it does funky things.

It works by using VRAM and converting during the save process. This means I have to track less data but means I have to do more work when I save (hence the bugs).

Oh and scrolling doesn't work. I'm tracking the "screen" pattern/channel positions separately from the global pattern/channel in hopes it won't be too bad to implement. Of course I need to get that working (on the pattern list and order list) and, you know, not have crazy bugs, for it to be useful.

Then after that actually loading and saving songs where I can also add all the planned channels. That will perhaps be the first barely usable version - barely as there isn't any effects yet, no real synth engine to generate the sounds, no instrument editing as of yet. Hopefully that's when I can look at interfacing with Concerto to help fill in some of these gaps.

Concerto doesn't yet support FM so I'll have to look at adding that. The real goal is being able to use both FM and PSGs (e.g. you can't do this in Deflemask as it doesn't have an X16 mode - at least not yet).

But I'm getting ahead of myself! One step at a time...

 

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »


I didn't make a video this time but I managed to fix the bugs with the pattern editor. It's now working reliably! Though I haven't yet implemented scrolling through the pattern while editing so that will be next. Part of the reason I didn't break out a video was because very quickly I can see the need to have some nice to haves (like copy paste, insert note/delete note which shifts the row, etc.) but those will likely wait until I have the basic functionality done. I can't even save songs yet which is the next thing I'll be working on once the initial work on the pattern editor is done.

Currently, the program (including buffers) is 4934 bytes (on disk). I found that pretty crazy myself! I'm not suggesting my code if compact (it likely isn't) - moreso that it's amazing how much you can do in assembly on an 8-bit computer, particularly when comparing it to the huge sizes programs are on modern machines.

 

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
User avatar
desertfish
Posts: 1123
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Command Tracker Dev Log

Post by desertfish »


i love seeing your progress on this. Great stuff

m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »


Thanks! It's been quite the learning experience! But I'm super excited with the prospects of making tracker style music on this thing given the hybrid PSG and FM approach and I couldn't see any real alternatives (at least if/until Deflemask gets an X16 mode). The ultimate goal is for it to be a capable tool to make music that's also compact and suitable for integration into apps. That will require the sparse format (or exporting into a sort of VGM style format). That's a ways off but is an important goal. One step at a time though!

If I can make music on the X16 I'll be happy, but am hoping others may find this useful, both to use directly, but also for seeing what sort of trackers can be made on the X16. I have to think someone with more assembly experience than me can probably make a better one ? Or since Command Tracker is modeled loosely after ScreamTracker and ImpulseTracker, I could see someone working on a FastTracker style tracker since that UI style seems to be more dominant in some of the modern popular PC trackers (Famitracker, Deflemask, Renoise, for instance).

 

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
Post Reply