Some questions about X16 in general.

Chat about anything CX16 related that doesn't fit elsewhere
picosecond
Posts: 70
Joined: Thu Jul 02, 2020 2:47 am

Some questions about X16 in general.

Post by picosecond »



On 1/28/2021 at 11:19 PM, Perifractic said:




Just for the record there are no plans to remove the YM sound chip and we are trying to lock down the final prototype which still has it at this stage.



It sounds like steady progress has resumed.  That is good to hear.

I hope someone studies the YM2151 datasheet timing diagrams before the next build.  There are several requirements that may not be easy to meet.

rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

Some questions about X16 in general.

Post by rje »


Just from watching 8 Bit Guy's videos over the past few years, I think he specifically prefers a synthesizer-grade sound chip in there.  

Therefore, the X16's YM has a great deal of moral support.

That's not a deal maker or deal breaker, but it is a deal.  Just sayin'.

 

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

Some questions about X16 in general.

Post by m00dawg »



45 minutes ago, rje said:




Just from watching 8 Bit Guy's videos over the past few years, I think he specifically prefers a synthesizer-grade sound chip in there.  



Therefore, the X16's YM has a great deal of moral support.



That's not a deal maker or deal breaker, but it is a deal.  Just sayin'.



It is quite the notable sound chip as well. I think combined with the Vera PSG (though I still wish it had a few more nice things with it like buzz noise and some hardware envelope support), it will be quite a monster without being over the top - but maybe almost over the top. I'm finding just a single pattern of 64 rows and 25 channels (16 PSG, 8 FM, 1 PCM) for my tracker eats up nearly 8k. That's as a bit byte array with no trickery involved, so I can be considerably smaller if opting to use some sort of sparse format (but then there's a lot more overhead to edit patterns and things). So I think we're good!

I think even 8 PSGs would be plenty, particularly if it means we can get a little bit more features as noted above since I am worried trying to push 16 PSGs with software envelopes to vary the sound might not leave much for a gaming engine and this would still offer 17 channels total (8 PSG, 8 FM, 1 PCM). Without envelopes, even something as simple as note-on/note-off requires keeping track of things and across 16 channels it can really add up. I would still expect some effects require some software support but even just a simple envelope buffer (ala how Famitracker presents NES envelopes) or something like the SAA1099 would be nice. Full ADSR would be even nicer or at least more conventional (and more like the FM solution so easier to think about when making music for both).

Granted, if what we have in VeraSound is what we're gonna have, I'm still happy! Not trying to complain, just pointing out there may be some tradeoffs involved in order to make some nice sounds across many channels.

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
xanthrou
Posts: 165
Joined: Mon Jan 25, 2021 11:57 am

Some questions about X16 in general.

Post by xanthrou »



10 hours ago, m00dawg said:




It is quite the notable sound chip as well. I think combined with the Vera PSG (though I still wish it had a few more nice things with it like buzz noise and some hardware envelope support), it will be quite a monster without being over the top - but maybe almost over the top. I'm finding just a single pattern of 64 rows and 25 channels (16 PSG, 8 FM, 1 PCM) for my tracker eats up nearly 8k. That's as a bit byte array with no trickery involved, so I can be considerably smaller if opting to use some sort of sparse format (but then there's a lot more overhead to edit patterns and things). So I think we're good!



I think even 8 PSGs would be plenty, particularly if it means we can get a little bit more features as noted above since I am worried trying to push 16 PSGs with software envelopes to vary the sound might not leave much for a gaming engine and this would still offer 17 channels total (8 PSG, 8 FM, 1 PCM). Without envelopes, even something as simple as note-on/note-off requires keeping track of things and across 16 channels it can really add up. I would still expect some effects require some software support but even just a simple envelope buffer (ala how Famitracker presents NES envelopes) or something like the SAA1099 would be nice. Full ADSR would be even nicer or at least more conventional (and more like the FM solution so easier to think about when making music for both).



Granted, if what we have in VeraSound is what we're gonna have, I'm still happy! Not trying to complain, just pointing out there may be some tradeoffs involved in order to make some nice sounds across many channels.



Even with some trickery in sound, there's still memory banking, in addition of 39 kilobytes of RAM. Plus, we know that VERA has its own 128kB of VRAM. So there's still space for other things.

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

Some questions about X16 in general.

Post by m00dawg »



10 hours ago, xanthrou said:




Even with some trickery in sound, there's still memory banking, in addition of 39 kilobytes of RAM. Plus, we know that VERA has its own 128kB of VRAM. So there's still space for other things.



The memory isn't the main issue and is an easy solve in the tracker - each pattern is one 8k block "uncompressed". A sparse format for playback and storage would make this much MUCH smaller in the majority of cases so embedding a song within a game shouldn't be a problem. Curious how the C256 trackers might solve this as an aside though because that thing has sooo many channels (I think too many really).

The main challenge is, as I was trying to articulate and perhaps didn't do a good job, the processing power required to manage 16 channels worth of envelopes and effects for the PSG. The lack of hardware envelopes means we have to use CPU power to process that. The only means available to control a PSG voice is waveform, 2-bits of panning (LR,Both), 6-bits of volume, and 6-bits of PWM. The means we have to control it is via the data ports (so in this case the VRAM isn't particularly relevant). It's absolutely possible to produce some nice sounds with (see Concerto) but it comes at the cost of CPU. Which I think may be just fine but it also means most songs won't be using all 16 channels most of the time is my guess if we start to become CPU starved. Concerto uses a VERY clever solution here (it doesn't sync using vsync or line sync but sync's via the DPCM butter) which allows for controlling envelope precision (and thus CPU usage) as well as approaching things in a multi-timbral way.

Even so, modulating 16 channels means up to 64 accesses to the VERA per "tick", at whatever granularity is defined. For smooth sounds, it has to be pretty fast (that's why Concerto uses the DPCM buffer for timing). All told, producing even simple NES sounds will require some envelopes and automation since some of these had hardware support we do not have with the VERA. We do have a nice range of PWM though which is quite fun! (nothing though that will require software automation so the precision of modulating it will be related to how much CPU is available and how much voices someone wants to use).

Again, while I would definitely like hardware envelopes (and buzz noise, ala NES and GB's special noise flag), if we don't have it, that'll be just fine! Just pointing out there will probably be trade-offs to the point 16 channels of PSG is probably more than most music might use. I might rather use 8 or even 4 PSG voices (in tandem with FM of course) if it means I can get higher resolution envelopes.

I didn't even mention DPCM here. This can be expensive as well buuut I am curious by how much if using 'chiptune style' samples (very short samples which can be retriggered to make sounds ala the GameBoy's WAV channel or the TG16). I know folks many folks are thinking about digital audio here but "drawable chips" is the main draw for the DPCM for me. As far as I'm aware VERA doesn't have an auto-loop feature for DPCM so it may still require a lot of CPU, but I'll have to play with that. Using chiptune waveforms results in tiny amounts of data compared to actual DPCM audio.

Author of Dreamtracker (https://www.dreamtracker.org/)
Check Out My Band: https://music.victimcache.com/
xanthrou
Posts: 165
Joined: Mon Jan 25, 2021 11:57 am

Some questions about X16 in general.

Post by xanthrou »


http://www.the8bitguy.com/2576/what-is-my-dream-computer/

"I’m pretty flexible with this.  I’d be okay with using some off-the-shelf Yamaha FM chips.  But I’d also be okay with having a socket for a SID chip or one of the off-the-shelf replacements such as the SwinSID.  Ideally some sort of DAC would be nice, some of the Yamaha chips have that built in."

Welp, I think rje's right.

 

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

Some questions about X16 in general.

Post by BruceMcF »



On 2/1/2021 at 1:16 AM, m00dawg said:




Even so, modulating 16 channels means up to 64 accesses to the VERA per "tick", at whatever granularity is defined. For smooth sounds, it has to be pretty fast (that's why Concerto uses the DPCM buffer for timing). All told, producing even simple NES sounds will require some envelopes and automation since some of these had hardware support we do not have with the VERA. We do have a nice range of PWM though which is quite fun! (nothing though that will require software automation so the precision of modulating it will be related to how much CPU is available and how much voices someone wants to use)



If you allocate one of the data ports to audio, that reduces the overhead of having writing to the audio registers in an ISR, since the ISR doesn't have to save and restore the state of the VERA data channel registers.

If it is running at a frequency to make volume controlled ADSR envelopes, you don't want to spend a lot of cycles in each invocation of a the ISR, but one approach is to alternate between ADSR and voice setup, with all voices in a set of four or eight pushed through their ADSR envelope in the ADSR phase and one voice set up in each invocation of the voice setup phase. In the ADSR phase, you point to the first volume control of the first in the set and set auto increment to four, in the voice setup phase you point to the next voice setup task in the voice setup chain, and set the auto increment to one.

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

Some questions about X16 in general.

Post by m00dawg »


Yep I'm using the second data port for all the audio stuff, which definitely makes things easier and faster.

It's still a lot of potential sending of data to VERA though since it's not just ADSR for volume. There might be envelopes for modulating pitch (vibrato, note slides, etc.), PWM (SID style squarewavey leads), arpeggiation, etc.

Making use of stride though definitely helps. My super basic and hardcoded just to have something to test against synth "engine" does that now, albeit without the ADSR and voice split (I'll have to think on that as I think I might not be getting the full concept there). Having multi-timbral instruments may help here I think since some envelopes can be shared. That won't help with writes out to VERA but would help with tracking envelope states on the CPU side. But then there would be times you want each "oscillator" in the multi-timbral instrument to have its own modulation so that might end up consuming CPU.

I managed to cause a stall in my tracker yesterday as I had a "bug" which was re-reading an entire full 25 channel pattern to draw on the screen (rather than just the 6 channels that can be seen). Once I fixed that, I no longer had a perceivable stall, though I have no pondered now having a nice scrolling pattern during playback of the song as a result since those cycles could be used for updating voice states and just how much overhead I'll ultimately have.

 

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