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 »



22 minutes ago, Yazwho said:




Ah ok, that would make sense, so you can make changes to the wave for periods lower than the vsync provides?



 



Yep! Concerto's ISR sort of outlines how this works:

https://github.com/biermanncarl/cx16-concerto/blob/master/concerto_synth/my_isr.asm

The take-away is that, currently, Concerto runs at about 7ms if I'm reading and remembering this right. Whereas vsync would be 16ms. Concerto's timing is tunable by adjusting how the audio buffer is filled. It's a very neat approach! I think once the emulator has timers there may be other options as well.

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
User avatar
Yazwho
Posts: 172
Joined: Fri Feb 19, 2021 2:59 pm
Contact:

Command Tracker Dev Log

Post by Yazwho »


Nice trick!

I don't know much about audio and the composition of it, but how bad would it sound by using the vsync? The reason I ask is that having an interrupt fire at 'random' time during the could break code that highly relies on line based interrupts.

 

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

Command Tracker Dev Log

Post by m00dawg »



10 minutes ago, Yazwho said:




Nice trick!



I don't know much about audio and the composition of it, but how bad would it sound by using the vsync? The reason I ask is that having an interrupt fire at 'random' time during the could break code that highly relies on line based interrupts.



Currently CommandTracker is using vsync with Concerto handling it's own timing. It's not bad, but yes that is something to worthy of note and something I was thinking of trying to see how much coarser it makes the envelope evaluation (since it will be about 50% slower). In the "final form" version of the tracker, I'd like to have this be controllable wherein you can select sync sources for both Concerto and CommandTracker and have these settings embedded in with the song file. So if you want very rich smooth envelopes, you can use tight timings with Concerto or using vsync; and/or if you want the tracker to run at, say, a MIDI clock pulse, you could.

MIDI clock or some sort of sync pulse (e.g. by way of the user or controller port) is a big desire of mine so I can sync Command Tracker to external MIDI and have proper timings. But I think due to the CPU issues, having these knobs to turn would be valuable in general.

For instance, right now the tracker is set to a fixed 25 channels, but Concerto has a concept of voices as well where an instrument could use more than 1 PSG voice. That means the number of channels in the tracker could, maybe eventually, be flexible and should reflect the needs. If you're using very rich instruments in Concerto, you might only want/need 4 tracker channels as an example. Or if you're game uses a lot of CPU, you might want to use coarse envelope timings in Concerto and may also want to limit channels in the tracker due to both song size and CPU consumed.

Those are all features that are pretty far down the list from where things are today but are definitely things I've thought about.

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 »


Small update, relative to progress anyway, but Command Tracker has now been updated to work with the latest emulator/rom (r39) which includes the changes to how banks are handled and such. There were two bugs where I was doing an unsafe lda ("lda 0") which worked previously since the value at $00 happened to be 0 but could now have data in it (namely the current page of himem).

I'm still having some visual artifacts I didn't see before, specifically with the active pattern scrolling stuff. But since that may get removed (perhaps only temporarily) I wasn't going to worry about that too much.

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 »


Shortish update:


  • Disabled pattern scrolling when playing entire song (no more stalls) and added ugly placeholder for better graphics (like channel trigger indicators)


  • Added play pattern which DOES scroll since we don't have to reload the pattern (key F6 in edit pattern module)


  • Added start song playing at row (key F6 in edit pattern module)


    • This is buggy because doing things like pulling up the order list while playing crashes everything.




Very rough around the edges. Took a while to sort of slide back into the codebase since it's been a bit of a hiatus. The above is good enough to be able to start working on better integration with Concerto so that's what I will start working on next.

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 showing off the PHAT sound that one can make with the Concerto engine! Also showing off the play-pattern feature:

 





I didn't update the whole song because I really need to add in a few additional GUI elements. Namely tracking the current instrument so that I can add notes without having to constantly change the instrument number. And there's still some UI bugs where it sometimes doesn't update the instrument number and I have to end up doing that multiple times (that's a weird bug). But geeeeez that phat sound!

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

Command Tracker Dev Log

Post by BruceMcF »



On 3/12/2021 at 1:42 AM, m00dawg said:




For instance, right now the tracker is set to a fixed 25 channels, but Concerto has a concept of voices as well where an instrument could use more than 1 PSG voice.



This can be interesting for the FM channels as well. One reason the DX21 was preferred over the DX27 for bass ... despite both being based on the YM2151 and both sharing the well reputed #01 analog bass patch ... is that it is bi-timbral, so you can have two related but distinct bass patches tuned a couple of cents from each other played as a single instrument and get a bass with a lot of complex harmonics to fill up the bottom of the soundscape. Four FM channels organized as two pairs of instruments for a bi-phonic, bi-timbrel bass patch could be really interesting.

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

Command Tracker Dev Log

Post by m00dawg »


Oh wow I hadn't thought of that, but yes that would be really neat! It's not a competition but it would be cool to do something that isn't as easily done in Deflemask ?

Eventually having some sort of flexible solution would be nice. Actually Concerto largely "just works" when multi-voice instruments in my brief testing meaning one can mix and match today and it'll work. But there's no clues into if you're out of voices right now and for songs that would be using multi-voice instruments, it would be nice to hide unused channels or something.

One hidden change I didn't mention was I am now using a single ISR. Previously I was using mine plus Concerto's and I think I may have been doing something funky there. This means Concerto lost some precision (10ms vs 16.67ms) but it really cleaned up some timing issues I was running into and hasn't affected the sound quality much that I could tell. When I played my test tune my jaw dropped at that crazy bass haha it's great!

That said though, I really need to sort out some UI issues before I move on to editing instruments and things. That will take some thinking I think as I want named instruments and Concerto doesn't have that concept, and uses multiple indexed arrays (I forget the proper term there). Nothing wrong with that, it's quite efficient, but I'll have to figure out how that will work. Then there's the FM instruments (I'm ignoring those for now but the expectation is, of course, to use both the PSG and FM at the same time).

Before that, I need to track current instrument (should be easy enough) and to figure out cut-paste (not quite as easy). Plus those dern input bugs.

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. I really wanted to get the demotune working so spent some time working on that after I sorted out keeping track of the last instrument used and squishing a few bugs. It now uses 5 channels! (albeit only for a short bit). The first part is just showing the pattern changes, since you can no longer see those while the song is playing.





 

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 »


It's been a BUSY few weeks to find time to write code as of late, but hope to start working CT again soon. I was having trouble sleeping last night and was trying to work out the next big push I'd like to do - copy/paste. Having that, plus maybe some channel shift options (delete and shift up, shift entire channel up/down rows, etc.) would REALLY help the usability of the tracker. I was trying to figure out a decent approach for copy/paste and here what I've come up with. Could perhaps use some feedback from folks if there might be a better way:


  • I will use similar keyboard shortcuts as with Impulse Tracker


    • CTRL-A once, selects entire channel, CTRL-A twice selects entire pattern


    • CTRL-B marks start of copy


    • CTRL-E marks end of copy


    • When we press CTRL-E, we evaluate the start/end points, redraw pattern view to show the highlight of what we selected


    • I'm going to assume, for now, the start point will be the top-left point and the end the bottom right (Impulse Tracker lets you do this backwards but for now I was going to avoid worrying about that).




  • Use 2 pages in memory (yes that means the max song length decreases by 2)


    • Use a page of memory to store copied pattern. When user presses CTRL-C, copy entire current pattern to copy buffer


    • Use another page to store the current pattern buffer, such that on a CTRL-V, we copy the entire current pattern to that buffer (this is so we can CTRL-Z if we pasted the wrong thing)




  • The copy block will be stored as ranges in main memory, something like


    • Start Channel #


    • Start Row #


    • End Channel #


    • End Row #




  • So, on a paste, we have to start at the current cursor of the pattern being pasted into (channel/row) and then roll through the copy buffer for the block desired.


    • So if I originally copied say channels 2-3 from row x10 to x20, and I'm on channels 4 at row x00, the result will be channels 4-5 from rows x00 to x10 ends up with what we copied.


    • This happens on the actual pattern so once we've done this, we redraw the pattern into VRAM




  • If we don't like what we pasted, we undo it by pressing CTRL-Z, which simply copies the backup pattern into our current pattern, then we redraw the pattern


These operations would be computationally more expensive than they could be, but the idea is to try and make the code simpler and more flexible. It's not a speed critical part of the tracker so trading speed for simplicity might be worth it here.

Curious if anyone has ideas on how to make this simpler/better? I think once this exists, the tracker will become a ton more useful and I can start then thinking about things like the pattern effects and such.

 

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