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 »


A video this time! If a short (and silent) one, but a video nonetheless!





Here I'm showing off pattern navigation whee! It's nearly complete - there's still some note save bugs, but I squashed many of them. What isn't shown is scrolling left - right now you can only scroll right and otherwise have to reload the editor to get back ? I'll fix that, I just ran out of time this evening. Likewise, I'd like to have tab work for scrolling faster through the channels.

As you can see, 25 channels is a lot! I'm not sure if the final version will have 25 or if I'll cut down the number of PSGs and do some sort of dual voice solution. Purists won't like that I"m sure (wanting to have the option to fully exploit all channels) but it does add some benefits like making it easy to do "supersaws" as instruments. As I plan on trying to use the Concerto synth engine still, this may not be that big a deal to worry about (with the trade-off being decoupling of channel vs voices). I'm also not sure if DPCM will remain as I'm worried it might be too CPU intensive to really be viable in the way it would be used in the tracker. I'm not sure on that one yet. I'd love to have it for some NES style DPCM drums and things.

Fortunately, that's not something I have to think about in depth today and more on that at a later date I'm sure.

I will fully admit the code is starting to get a little, erhm, artisanal? I'm going to need to clean things up some and add comments, organize variables, etc. so I might opt to consider that before I jump into the save/load functions but those are definitely next on the list once the UI is at a minimum viable state.

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Command Tracker Dev Log

Post by JimmyDansbo »


It is great to read about your progress and I am looking forward to be able to really play around with the tracker.


1 hour ago, m00dawg said:




I'm going to need to clean things up some and add comments, organize variables, etc.



When my projects get to a certain size, I usually go back to the beginning and try to read my code with new/fresh eyes. This usually results in more comments in the code as I need to explain to my self what certain pieces of code does.

I also try to look at macros and functions and see if I can "lock it down", meaning that I am fairly certain that the code is correct and does not need fixing or tweaking. When I do find those, I usually move it out of the way or "encapsulate" it in "****" lines letting my self know that I don't need to look at this again unless there is a problem.

Next time I decide to read from the beginning, is is usually a lot easier because some macros and functions have already been locked away and the rest should have better comments.

It seems like a lot of work, but in my experience, it has helped me weed out bugs before they appeared and it usually also helps me see where I have inefficient code.

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »


Thanks Jimmy that's great advice and yep well worth the exercise I think! The pattern editor got a little sprawling, and there's place where macros (and functions) could be used, most certainly. I use macros for some things, but didn't think about using them as a means to make things a little easier to follow. That makes a ton of sense but I hadn't though about it that way until now ?

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 »


Finally! The pattern editor is (mostly) bug free! I have a few input bugs but they don't seem to affect pattern saving adversely (which was not previously the case). This means it's actually usable as a very basic demo. Only the first 3 channels are setup - the others might make noise depending on whatever default state the VERA is in, but since I don't have instruments or a real synth/voice engine, things are hard-coded. Really just a means to do and test basic pattern and order editing and show off some of the design concepts I decided to do:





Not the quickest demo but hopefully folks can see a bit more about what I'm thinking instead of the previous quick and voice-free demos.

At this point, the pattern editor is good enough to leave for now I think (even with the minor artifact bugs) and start work on saving and loading. At least that is my plan next as that will make it nearly almost usable. After that there's a few next steps I might do. I might make a very basic sound engine so folks can configure sounds in the pattern data to make real music (albeit without instruments) while I work on a proper sound engine. My hope is to be able to interface with Concerto as I have mentioned previously. I've put thoughts into how I might present the engine via the tracker interface, from presenting all 16 channels and letting Concerto manage the voices (noting that if you use multi-timbral instruments, you cannot effectively use all 16 channels); to reducing the channels down to 8 and making instruments dual voice or maybe even tri voice. I'm not quite sure. Actually for folks that are familiar with trackers, or for those that just might have an opinion, curious as to people's thoughts! I got back and forth on the best way to manage all that.

As I keep saying though, one thing at a time - so yep next is figuring out how to load and save files (including loading data into various parts of memory)!

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Command Tracker Dev Log

Post by JimmyDansbo »


Thank you very much for the video. Nice to hear you talk about your progress as well as the speedbumps. As a bonus I now have an idea on how to actually use your tracker ? 

I find it a lot easier to get the basics by watching a video like this than to have to read through documentation that often describes a lot of theory that I don't really understand anyway. When I get a better grasp of how to use this tracker, I will most definitely need real documentation to help me get to the next level.

- Keep up the good work

Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
m00dawg
Posts: 346
Joined: Wed Jul 08, 2020 12:41 am
Contact:

Command Tracker Dev Log

Post by m00dawg »



10 hours ago, JimmyDansbo said:




Thank you very much for the video. Nice to hear you talk about your progress as well as the speedbumps. As a bonus I now have an idea on how to actually use your tracker ? 



I find it a lot easier to get the basics by watching a video like this than to have to read through documentation that often describes a lot of theory that I don't really understand anyway. When I get a better grasp of how to use this tracker, I will most definitely need real documentation to help me get to the next level.



- Keep up the good work



Thanks! And yep that was the idea. The documentation is thin on how to use it. I haven't added much in terms of help info to the tracker software itself. I probably will but may save that for last (I might burn a page of hi-RAM to store that for example). And if not or in addition I'll have, at the very least, a text manual but if there's enough interest to justify it, may setup a website for the project and put contextual help or a wiki there. Until then I expect I'll keep showing off features via videos so folks can learn by example as it were.

Once I start to get to effects, documentation will be a must. I already have an effect list of what I was planning, but it may get re-arranged. I have thought about allowing A-Z for the effect selector column and would need the resulting effects to be ordered in the right way to make the text conversion simpler (and smaller) in the code. For instance A, which is $01 in screencode values, would be for the arpeggiator effect so internally that would be effect 01, S which I'll probably use for global song speed, would be internally be effect $13 as that is the screencode for 'S'. stuff like that. For Macros I'll likely use M# - unless I think I need to support more than 16 macros. Or I'll say to hell with all that and just use raw hexedecimal values for effects ? In both cases, having documentation for what does what is quite necessary.

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 »


Nice video!

idea: Can we use the mouse to position the cursor anywhere in the editor? That could save a lot of scrolling I think? 

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

Command Tracker Dev Log

Post by m00dawg »


Sure that seems like a reasonable feature request! I've logged that here. Tab, Shift-Tab, Pg-Up, and Pg-Down help A TON so hopefully we see at least support for Page Up/Down on the X16 (given the keys exist on both keyboards, I have to imagine that is indeed planned). Likewise copy/paste is a pretty huge feature. You may have noticed in the video I wanted to grab copies of things so I could more easily add variations. Also being able to insert/delete pattern rows (where the rest of the pattern moves up and down) is nice to have.

The bigger issue I see is how to navigate around say from channel $00 (PSG) to say channel $12 (YM). If composing a song that uses a healthy mix of both, that's a lot of scrolling through patterns. I can alleviate some of that by remembering where the cursor was when leaving and returning to the pattern edit screen but I think I'll also need some sort of hotkey to jump between PSG, VERA, and (if supported), PCM. Likewise being able to wrap the patter would be pretty neat (so moving left from Channel $00 wraps over to PCM and then back through the YM channels). Much like I have it working for the order list and moving up and down in the pattern.

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 »


Quick update, I live in Texas and while we are thankful we didn't have any pipes burst, we had rolling blackouts and are still boiling water. Power is now stabilized so I can start working on Command Tracker again soon. The last thing I added was a save routine, which appears to do the job but is super slow since I was grabbing every single pattern in banked memory, regardless of whether it is actually being used. It took over a minute in the emulator ? So that won't do.

Instead, I'm going to have to write a sorting algorithm (which also removes duplicates) so I only have to grab the patterns that are actually being used (namely those which are defined in the order list). Having a sorting routine is something I'd love to see in ROM but for now I'm just going back to my college days and remembering about all the sorting algos (given I don't need speed but want compact code, I'll likely just do a bubble sort).

This should make saving much faster for most songs. The main speed loss is likely just the size of the patterns and the speed of calling CHROUT TONS of times. My initial goal is getting a usable tracker (one that can, you know, be used to make, save, and load music ? ) so I just need it to be good enough for now. The sort should considerably help but a post 1.0 feature is to implement the sparse format, at least on disk. That same format wouldn't be too far off of an in-memory format for playing music outside of the tracker (e.g. in a game just using the tracker engine).

Anyways saving and loading are ultimately pretty straightforward in how it will all work, but you might not see as regular an update as in the past while I work on it, since these aren't as flashy as the GUI and sound elements. Having saving and loading will be real useful while I start to work on the synth engine (likely using Concerto) and integrating things like instruments and effects.

If anyone else is in Texas, I hope you're all doing well! I know 8-Bit Guy has been having some issues given his latest video and I know quite a few folks that have had burst pipes and things as well ?

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 »


Another quick update. Tried to throw a video together but eh, there isn't that much to see ? The save routine is now built into the UI and was able to make saving a bit faster using ROM bank 0. I still need to do a load routine and then probably redesign the load/save section since it's pretty messy. Then I may want/need to look at jump tables for the global keys (basically the F-keys) as I'm starting to duplicate more code than is ideal I think.

The save routine does indeed use a simple bubble sort so instead of saving all patterns (essentially most of hiram and regardless of if they're used or not), it only grabs the patterns actually in the order list. As a result it's much faster! Still slower than a proper sparse format, but as noted, that's going to be a ways yet. Loading and saving will allow me to much more easily test bugs and things so that's the real reason I'm doing it now.

And after the above work is done, then I'm hoping to finally start to see how I might integrate the Concerto engine as well as if I might want to consider multi-voice instruments and reduce the raw channel count in the pattern data. Jury is still out on that one.

Sorry for no fancy video! I didn't get to spend quite as much time working on it this week as I wanted, so the progress has been important, but small.

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