PC Engine waveform channel updates

Discussion of development of software for any "obsolete" computer or video game system.
Post Reply
User avatar
za909
Posts: 193
Joined: Fri Jan 24, 2014 9:05 am
Location: Hungary

PC Engine waveform channel updates

Post by za909 » Wed Mar 28, 2018 4:22 am

I have recently taken interest in programming for the PC Engine/TG16. I've been meaning to do something interesting with the audio, so I tried regularly changing the waveforms to get more realistic instruments. https://www.youtube.com/watch?v=BI6so4w9mu8

Now based on what I read in the documentation, the waveform data can only be updated when the channel is disabled. But there is no mention whether the channel phase gets reset when you do that. If that actually does happen then the song in the video is actually impossible to do in an actual program. Could anyone confirm any of this to me? Thank you!

User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2032
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: PC Engine waveform channel updates

Post by FrankenGraphics » Wed Mar 28, 2018 7:19 am

Cannot answer the question but this rearrangement wanted me to walk about town with this in my headphones. Great work!
http://www.frankengraphics.com - personal NES blog

ccovell
Posts: 1007
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: PC Engine waveform channel updates

Post by ccovell » Wed Mar 28, 2018 7:39 am

Feel free to sign up to the PCEngine FX forums http://www.pcenginefx.com/forums/
and use the forum's search function for "waveform". There's been a fair amount of research into changing waveforms while channels are "active" and trying to avoid the popping and artifacts that go with it.

TOUKO
Posts: 289
Joined: Mon Mar 30, 2015 10:14 am

Re: PC Engine waveform channel updates

Post by TOUKO » Thu Mar 29, 2018 1:05 am

the waveform data can only be updated when the channel is disabled.
You must use timer interrupt for that,and it's definitively not trivial as it rely on the sound frequency .
The channel is off only when you are updating the new waveform, and switched ON after that,but you're limited on the frequency because it takes time to update the entire 32 bytes buffer, 209 cycles with TIN instruction, plus the others for interrupt and channel setting .

But it's doable in a game, it seems All the Fire Pro Wrestling games did it :
https://www.youtube.com/watch?v=V845pHyaePk

I did it for samples playback, and it works well only on the A rev. of the Hu6280.

User avatar
za909
Posts: 193
Joined: Fri Jan 24, 2014 9:05 am
Location: Hungary

Re: PC Engine waveform channel updates

Post by za909 » Thu Mar 29, 2018 3:40 am

Ah, I only intend to update the waveform once per field at the fastest (up to 1254 cycles if all 6 channels had to be updated), so to me the biggest concern is whether the waveform step is reset to 0 when I update the waveform.

TOUKO
Posts: 289
Joined: Mon Mar 30, 2015 10:14 am

Re: PC Engine waveform channel updates

Post by TOUKO » Thu Mar 29, 2018 5:29 am

You reset the waveform pointer like that :

Code: Select all

// First you must select the voice number
lda     #%010_00000
sta     $0804		
stz     $0804
When bit 6 goes from 1 to 0 the pointer is reseted and when you feed the buffer with the new waveform it start at 0 up to 31 and not at the current waveform pointer position .

User avatar
za909
Posts: 193
Joined: Fri Jan 24, 2014 9:05 am
Location: Hungary

Re: PC Engine waveform channel updates

Post by za909 » Sat Feb 02, 2019 5:16 am

I have since tried to do the same on the FDS, a system where I know that the channel has to be halted and reset to change the waveform, and the results are oddly clear with very little artifacts added. This is a promising next step.
Attachments
FDS Sunsoft bass.nsf
(7.76 KiB) Downloaded 303 times

TOUKO
Posts: 289
Joined: Mon Mar 30, 2015 10:14 am

Re: PC Engine waveform channel updates

Post by TOUKO » Sun Feb 03, 2019 2:23 am

BTW your PCE version of Journey to Silius is incredible :D

turboxray
Posts: 49
Joined: Thu Oct 31, 2019 12:56 am

Re: PC Engine waveform channel updates

Post by turboxray » Thu Oct 31, 2019 3:44 am

You can disable the channel without resetting the waveform pointer. Also you don't have to turn off the channel to write updates to it. You can write updates to it while it's playing and the current pointer position will get over written. A few games do this to get a steal-y sounding timbre change.

Also, what you're doing in that song... is what bloody wolf does. It softens the triangle waveform (the trumpet sound) to give a filter like effect. That sound effect "yeeaahhhh" in bloody wolf is also doing the same thing (once per frame waveform update).

Post Reply