Author Topic: Question: Wave-phasing on the PC engine, how feasible is that?  (Read 8350 times)

Michirin9801

  • Hero Member
  • *****
  • Posts: 589
Question: Wave-phasing on the PC engine, how feasible is that?
« on: December 20, 2016, 06:36:50 AM »
Hello everyone, I'm new here...
First and foremost I want to get this out of the way: I'm not a collector, I'm not looking for shelf-candy, I'm just an artist who discovered the TurboGrafx 16 through the Wii's Virtual Console a few years ago and have since fallen in love with it! It has become one of my favourite game systems and it has my favourite soundchip to make music for (But not the favourite soundchip in general, that would be the SPC-700), it's so easy to use and make awesome music with it, and it sounds so GOOD!

So a friend of mine who's an active Famitracker user has shown me some of the tricks that people like to do with the NES expansion chips, most notably the Namco N-136, which does up to 8 channels of 4 bit wavetables, (but the more channels you use the worse it sounds) which is pretty similar to the PC engine (only the PCE does 5 bit waves of course), and the trick that really stuck with me was Wave-Phasing, basically you change the wavetable a whole lot of times really fast in order to make instruments that sound just like Samples!
Yeah I know, the PCE can already play samples natively, but the advantage of doing that is that you can freely pitch up and down your instruments, yeah it doesn't sound quite as good as a proper sample, but it's really impressive none-the-less!

So I've downloaded some Famitracker modules that use the trick and copied the wavetables over to Deflemask in order to try and reproduce the effect, and here's a couple of songs I've made that use the effect:



And here's another one that's still unfinished (and I'm probably never gonna finish it):http://orig14.deviantart.net/1cf0/f/2016/257/1/c/puyo_pop_title_screen_by_michiharuruko-daholcf.mp3


Now hear me out: I know Deflemask isn't the best method of making PC engine music, I know its .hes exports are crap, you don't have to tell me that, but I can tell you that it's definitely the easiest way of making PCE music, especially for someone like me who only has experience making music on trackers, I can't use piano-roll programs, nor do I know MML, but I do plan on learning MML eventually so there's that...

The point of this post, and I'm sorry for taking so long to get to the point, is that I want to know how feasible is this trick in real hardware? Could you make a song using this trick in more than one channel and still be able to do regular samples for drums and split the BG layer for parallax scrolling? How complex of a game could you potentially make using this trick, if you could at all?

I'd love it if some kind-hearted and experienced developer gave me at least a rough idea on how well the system could handle this stuff... Thanks in advance!

Gredler

  • Guest
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #1 on: December 20, 2016, 06:57:59 AM »
Welcome to the boards! Another musician has been revealed! Hooray!

Can't wait to hear the responses to your query, good luck finding the answers you're seeking!

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #2 on: December 20, 2016, 07:39:16 AM »
What time ("clock") setting are you using on deflemask? 60hz NTSC or something custom?

 Each channel waveform buffer is 32bytes. If you did a slow update ( no Txx block transfer), that's ~14cycles a byte in an unrolled loop for transfer. Assuming you changed the waveform on every 'tick' (1\60th), it's 448cycles per channel per frame. 448/119210 = 0.38% cpu resource per frame @ one channel. Not even a full 1% of cpu resource. I mean, just the act of updating it. Fast update is 207cycles for 32bytes or 0.18% cpu resource. Just multiply that percentage by the number of channels doing it. 4 channels? 1.5% cpu slow version or 0.72% for fast version.

 In other words, it's almost non existent when it comes to cpu resource. And why Deflemask puts a storage limit of 32, is beyond me. You can do other fun stuff with updating waveforms; adding two different waveforms together and divide by two; create your own 'filtering' or whatever effects directly onto the sample as a realtime process.

 The downside of waveform updating on PCE, is obviously you can't match pointer playback position from one set of 32byte sample to another set, for a seamless transition. It makes the phasing a little bit dirty sounding. But you probably already know that.

 If you do this on the PCE, Duo, and most models - you'll also get pop'ing/clicking on the DAC output everytime you turn off/on the channel to update the waveform. It'll sound like the small miss-phase issue mentioned above, but a bit louder because it happens around the same time. SGX doesn't have this issue, and some PCE Core Grafx I models don't as well. You can either live with it, or use two sound channels on the PCE for this phase trick; one channel is always on, one channel is always off - turning on one at the same time of turning off the other, cancels out the pop on the DAC. Deflemask doesn't emulate this pop on the DAC. And I have no idea of deflemask is updating the 32byte waveform in sync with the playback pointer, to make it sound smoother as well.

 Do you have a real system you can try out the HES exports on?
« Last Edit: December 20, 2016, 07:42:04 AM by Bonknuts »

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #3 on: December 20, 2016, 08:02:02 AM »
 I'm kinda surprised Deflemask doesn't support this:
Instead of replacing the whole waveform, you have a single waveform (of any length), where you write one byte per 1/60th timing or less to one specific channel - all without turning off the channel. Basically, the PCE soundchip is always in DDA mode. When you write to DDA port (also the waveform channel port), regardless if the channel is in DDA mode or waveform mode - the sample will be output to that channel's DAC. But something interesting happens; where ever that playback pointer is of the channel's waveform, the byte in the waveform memory will be replaced with the byte written to DDA port. So you can corrupt or change the waveform over time, in very specific ways, to create timbre type effects. Typically it's used for going to a low static sound to a thin steal-y time timbre. But no one has really explored the idea to see where it can actually go. But the above video shows what this particular PCE game is doing with it.

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #4 on: December 20, 2016, 08:11:41 AM »
Hello everyone, I'm new here...

Welcome! I hope that we can persuade you to stay and hang around here.  :D


Quote
So a friend of mine who's an active Famitracker user has shown me some of the tricks that people like to do with the NES expansion chips, most notably the Namco N-136, which does up to 8 channels of 4 bit wavetables, (but the more channels you use the worse it sounds) which is pretty similar to the PC engine (only the PCE does 5 bit waves of course), and the trick that really stuck with me was Wave-Phasing, basically you change the wavetable a whole lot of times really fast in order to make instruments that sound just like Samples!
Yeah I know, the PCE can already play samples natively, but the advantage of doing that is that you can freely pitch up and down your instruments, yeah it doesn't sound quite as good as a proper sample, but it's really impressive none-the-less!

bonknuts and ccovell are our hardware experts, and I'm sure that they'll chime in later on, but in the meantime ...

<edit>

OK, so bonknuts beat me to posting!  :lol:


You can change the waveform any time that you like, and it wouldn't be much of a cost to change it during an hsync interrupt a few times during a 1/60s frame if that made things sound better.

As bonknuts said ... there's both the issue of the "click", and the playback-position to consider from the technical point-of-view.

From my "practical" POV, there's just the question of how you'd let the sound-driver know that it's supposed to enable the effect.

Nothing that can't be dealt-with, though.  :wink:

Michirin9801

  • Hero Member
  • *****
  • Posts: 589
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #5 on: December 20, 2016, 08:21:24 AM »
What time ("clock") setting are you using on deflemask? 60hz NTSC or something custom?

 Each channel waveform buffer is 32bytes. If you did a slow update ( no Txx block transfer), that's ~14cycles a byte in an unrolled loop for transfer. Assuming you changed the waveform on every 'tick' (1\60th), it's 448cycles per channel per frame. 448/119210 = 0.38% cpu resource per frame @ one channel. Not even a full 1% of cpu resource. I mean, just the act of updating it. Fast update is 207cycles for 32bytes or 0.18% cpu resource. Just multiply that percentage by the number of channels doing it. 4 channels? 1.5% cpu slow version or 0.72% for fast version.

 In other words, it's almost non existent when it comes to cpu resource. And why Deflemask puts a storage limit of 32, is beyond me. You can do other fun stuff with updating waveforms; adding two different waveforms together and divide by two; create your own 'filtering' or whatever effects directly onto the sample as a realtime process.

 The downside of waveform updating on PCE, is obviously you can't match pointer playback position from one set of 32byte sample to another set, for a seamless transition. It makes the phasing a little bit dirty sounding. But you probably already know that.

 If you do this on the PCE, Duo, and most models - you'll also get pop'ing/clicking on the DAC output everytime you turn off/on the channel to update the waveform. It'll sound like the small miss-phase issue mentioned above, but a bit louder because it happens around the same time. SGX doesn't have this issue, and some PCE Core Grafx I models don't as well. You can either live with it, or use two sound channels on the PCE for this phase trick; one channel is always on, one channel is always off - turning on one at the same time of turning off the other, cancels out the pop on the DAC. Deflemask doesn't emulate this pop on the DAC. And I have no idea of deflemask is updating the 32byte waveform in sync with the playback pointer, to make it sound smoother as well.

 Do you have a real system you can try out the HES exports on?

I use different clocks depending on the song, I usually do custom so that I can have more control over the tempo of the song, but I don't know if I should be using custom clock speeds or not, if not then I can do the block transfer thing to get a tempo relatively close to what I want (9xx for even lines and Fxx for odd lines in Deflemask)

Here's an example of an instrument: I have this wave-phased steel drum instrument, it only uses 4 wavetables, so what I do is update the wavetable on every tick on a single channel 4 times every time I play it and then hold on the last wavetable (I do it on every 2 ticks for the lower pitches), So from what you say, I could do this on 2 channels and not have to worry about CPU time right?

Yeah you're right that it sounds 'dirty', but you know what? I'm kinda fond of that dirty sound, I find it to be kinda charming~
What worries me though is this popping you've mentioned, I had no idea it happened, is it loud? I don't have a real PCE to test it on, only emulators... (I do plan on getting one when I can afford it though, and an everdrive to go with it, but I'm a broke college student with no 'real' job so that's gonna take a while)
And well, I think using 2 channels for a single wave-phased instrument is a bit of a waste, if I were to use 2 channels for a single instrument the 2nd channel would most likely be a delay/reverb effect...

Also, I've asked why they had limited the amount of waves in Deflemask to only 32, and basically there's no good reason... In fact, they actively don't want people to push the limits of the system, which is pretty stupid if you ask me, their reasoning is that they want people to compose music that sounds 'genuine', but here's the thing, people aren't gonna stop composing songs that don't show off the hardware just because you allow them to have more than a hundred waves... Oh well, I can live with only 32...

Another cool thing you can do with wave-phasing is change the pulse length on the fly, kinda like the C64 does, and by doing that you can pretty much do SID-like music except with proper chords instead of arpeggios! Unfortunately I don't have anything presentable doing that but I'll eventually do something like that...

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #6 on: December 20, 2016, 08:27:51 AM »
But something interesting happens; where ever that playback pointer is of the channel's waveform, the byte in the waveform memory will be replaced with the byte written to DDA port. So you can corrupt or change the waveform over time, in very specific ways, to create timbre type effects.

I forgot to ask you about this when you mentioned this a week ago ...

But, if you're just writing to wherever-in-waveform-ram the pointer is at the time that you do the write, then how can say that it's a "very specific" change?

Wost-case would be that you'd always be writing to exactly-the-same location in waveform ram.

Is there some reasonably efficient way that you know of to predict where the waveform pointer is at some specific time?  :-k

<edit>

OK, I guess that you could switch to DDA mode and then back to normal mode and that would reset the waveform pointer, and you could time it from there ... but ... that sounds like a lot of effort!
« Last Edit: December 20, 2016, 08:31:34 AM by elmer »

Michirin9801

  • Hero Member
  • *****
  • Posts: 589
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #7 on: December 20, 2016, 08:31:03 AM »
I'm kinda surprised Deflemask doesn't support this:

Instead of replacing the whole waveform, you have a single waveform (of any length), where you write one byte per 1/60th timing or less to one specific channel - all without turning off the channel. Basically, the PCE soundchip is always in DDA mode. When you write to DDA port (also the waveform channel port), regardless if the channel is in DDA mode or waveform mode - the sample will be output to that channel's DAC. But something interesting happens; where ever that playback pointer is of the channel's waveform, the byte in the waveform memory will be replaced with the byte written to DDA port. So you can corrupt or change the waveform over time, in very specific ways, to create timbre type effects. Typically it's used for going to a low static sound to a thin steal-y time timbre. But no one has really explored the idea to see where it can actually go. But the above video shows what this particular PCE game is doing with it.


Oh wow, I never knew that! So could you potentially use that trick to change a tinny sawtooth over time to an almost sine-wave like sound?
Something kinda like this:http://orig00.deviantart.net/1559/f/2016/355/5/0/wave_phasing_test_by_michirin9801-dase02j.mp3


Also, it's very nice to hear an example of a game actually doing it and changing the wavetable on-the-fly!

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #8 on: December 20, 2016, 09:13:03 AM »
Now hear me out: I know Deflemask isn't the best method of making PC engine music, I know its .hes exports are crap, you don't have to tell me that, but I can tell you that it's definitely the easiest way of making PCE music, especially for someone like me who only has experience making music on trackers, I can't use piano-roll programs, nor do I know MML, but I do plan on learning MML eventually so there's that...

It doesn't really matter that much what you choose to use to compose music, as long as you actually find it usable.  :)

At this time, the development community here only really has access to the music/driver that's built into the PC Engine's System Card ... and that's an MML-variant.

Aetherbyte's "Squirrel" is the toolchain that you can use to compose music for that driver.

So you can't "yet" compose in deflemask and produce something that's usable in a game, but it may be possible in the future.  :pray:


I use different clocks depending on the song, I usually do custom so that I can have more control over the tempo of the song, but I don't know if I should be using custom clock speeds or not, if not then I can do the block transfer thing to get a tempo relatively close to what I want (9xx for even lines and Fxx for odd lines in Deflemask)

Hmmm ... I'll have to look at the Deflemask documentation again, but FYI, custom timings were not how console music was created back-in-the-day.

Here's a typical old-skool table of timings-vs-tempo ...

NTSC

Base Tempo = 5/60s per 1/16th  = 20/60s per 1/4 note  = 180.0 bpm  (60 * 60/20)
Base Tempo = 6/60s per 1/16th  = 24/60s per 1/4 note  = 150.0 bpm  (60 * 60/24)
Base Tempo = 7/60s per 1/16th  = 28/60s per 1/4 note  = 128.6 bpm  (60 * 60/28)
Base Tempo = 8/60s per 1/16th  = 32/60s per 1/4 note  = 112.5 bpm  (60 * 60/32)
Base Tempo = 9/60s per 1/16th  = 36/60s per 1/4 note  = 100.0 bpm  (60 * 60/36)

PAL50

Base Tempo = 4/50s per 1/16th  = 16/50s per 1/4 note  = 187.5 bpm  (60 * 50/16)
Base Tempo = 5/50s per 1/16th  = 20/50s per 1/4 note  = 150.0 bpm  (60 * 50/20)
Base Tempo = 6/50s per 1/16th  = 24/50s per 1/4 note  = 125.0 bpm  (60 * 50/24)
Base Tempo = 7/50s per 1/16th  = 28/50s per 1/4 note  = 107.1 bpm  (60 * 50/28)
Base Tempo = 8/50s per 1/16th  = 32/50s per 1/4 note  =  93.8 bpm  (60 * 50/32)


It is possible to do timings differently than that, but doing so comes with a bunch of costs that game developers back then usually didn't see the need to incur.


Quote
Here's an example of an instrument: I have this wave-phased steel drum instrument, it only uses 4 wavetables, so what I do is update the wavetable on every tick on a single channel 4 times every time I play it and then hold on the last wavetable (I do it on every 2 ticks for the lower pitches), So from what you say, I could do this on 2 channels and not have to worry about CPU time right?

Changing the wavetables on every channel every 1/60s is a tiny cost.

Far, far less than a single sample-channel (they're expensive).


Quote
Also, I've asked why they had limited the amount of waves in Deflemask to only 32, and basically there's no good reason... In fact, they actively don't want people to push the limits of the system, which is pretty stupid if you ask me, their reasoning is that they want people to compose music that sounds 'genuine', but here's the thing, people aren't gonna stop composing songs that don't show off the hardware just because you allow them to have more than a hundred waves... Oh well, I can live with only 32...

Hahaha ... that's such totally bogus reasoning from the community!!!  :lol:

256 32-byte waveforms only take up 8KB, which is a minimal cost.

Yet for some reason, they're allowing people to add hundreds of KB of sample data into songs at playback rates that would never have been used back-in-the-day.

The PCE is *practically* limited to 7KHz samples, with 8KHz and 16KHz possible, but unlikely to be worth the higher CPU costs, except in specific uses (from my game developer perspective).

On the PCE CD, you do also have the ADPCM chip, which makes higher-rate samples more usable, but you've got limited sample memory.
« Last Edit: December 20, 2016, 09:14:57 AM by elmer »

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #9 on: December 20, 2016, 09:46:50 AM »
But something interesting happens; where ever that playback pointer is of the channel's waveform, the byte in the waveform memory will be replaced with the byte written to DDA port. So you can corrupt or change the waveform over time, in very specific ways, to create timbre type effects.


I forgot to ask you about this when you mentioned this a week ago ...

But, if you're just writing to wherever-in-waveform-ram the pointer is at the time that you do the write, then how can say that it's a "very specific" change?

Wost-case would be that you'd always be writing to exactly-the-same location in waveform ram.

Is there some reasonably efficient way that you know of to predict where the waveform pointer is at some specific time?  :-k


Well, that's why I tend to call it waveform corruption. Because it's not exact. You'd have more control if you could do this with the TIMER than 60hz. But either way, you'd need a fixed point counter - and as you've already guess - it's rather course (at least at 60hz). You'd need to know the note and octave the channel, and then you would know what fixed point counter to use with it - or however you want to sync the corruption part, that way the timbre effect scales with the notes. But the idea would be a rate of corruption relative to the frequency of the channel - that way you can get replicate-able results - even if they vary somewhat.

Quote
OK, I guess that you could switch to DDA mode and then back to normal mode and that would reset the waveform pointer, and you could time it from there ... but ... that sounds like a lot of effort!

No. But... mednafen author (I always call her that on these forums, because I don't know if she likes her real name used here), discovered a way to 'walk' the waveform pointer. The channel has to be off to do it, but you can reset the waveform pointer and then "walk it". It had something to do with.. meh - forget the reason behind it. But I had it saved on my blog somewhere. I should probably write it down in my notes folder.




Quote
Also, I've asked why they had limited the amount of waves in Deflemask to only 32, and basically there's no good reason... In fact, they actively don't want people to push the limits of the system, which is pretty stupid if you ask me, their reasoning is that they want people to compose music that sounds 'genuine', but here's the thing, people aren't gonna stop composing songs that don't show off the hardware just because you allow them to have more than a hundred waves... Oh well, I can live with only 32...

Hah! Considering how deflemask handles long samples for PCE tunes, you'd think they would think otherwise. Let's limit the computer with some artificial limitation because it doesn't fit our point of view - that's a great attitude to have for a tracker, especially for something as simple as expanding on sample memory that's still only a tiny fraction of long wave samples they support.

Quote
So from what you say, I could do this on 2 channels and not have to worry about CPU time right?
You could do it on all channels and not even sweat it. Let me give you a relative example of cpu resource; if you did this on all six channels - it would still be less CPU resource than play a single long sample on just one channel @ 7kz playback rate. Playing a long sample on a single channel would take up 3-4x the resource as it would to do what you're asking for on all six channels. If someone tells you different, they don't know what they're talking about. I mean, it's not like the PCE sound chip has a slow interface like the YM2612 in the Genesis, where you can't just blast whatever amount a bytes in sequence to it (you have to wait for the delays - read the delay/ready flag). The PCE sound chip has no delays; it's just a simple matter of copying over 32bytes per channel. No sweat for the HuC6280.

Quote
I use different clocks depending on the song, I usually do custom so that I can have more control over the tempo of the song, but I don't know if I should be using custom clock speeds or not, if not then I can do the block transfer thing to get a tempo relatively close to what I want (9xx for even lines and Fxx for odd lines in Deflemask)

From a programming perspective, it's just easier to stick with vsync timing (60hz). Though in my book, multiples of 60hz (using the TIMER to do this) would be an ok trade off; 120hz, 180hz. Something with a fixed interval in the whole frame (which relates to game loop and logic). Anything higher than 60hz requires special interrupts. And anything not multiple of 60hz means the music engine has to drift out of sync with the game logic (not to mean out of sync with playing music; just where that music engine will get called relative to a frame logic layout). It can complicate things. It has its own overhead (cpu resource). It can imposed limitations in strange ways (because of timing). 60hz and 120hz are nicer options to work with. 60hz being optimal (NTSC setting for deflemask).



Michirin9801:
Have you seen this trick before: http://www.pcedev.net/audio/sub_waveform6.xm

If you load it up in a tracker, check out pattern #2 first (it only has two channels playing). See how the waveforms are setup? The main waveform is a triangle wave and the other is a saw wave (with a delay onset). The triangle samples exist only in the upper band of the amplitude range. The  saw waveform is played on the other channel, and only has samples in the lower band of the amplitude range. Can you guess why? Normally when you play samples, their amplitudes add together. Having them in separate ranges (positive range vs negative range), you get a more pronounced effect as they add together. Channel 4 is the main sound, and channel 2 is used to subtract from the main channel's waveform shape. Volume envelopes are used for emphasis (like controlling the amplitude of a modulator affecting a carrier wave). And the final step is pitch sliding. If you've ever looked at some synths waveform output, it looks like to waveforms going out of phase from one another (besides other stuff happening). So if you look at the channel, there are very precise pitch sliding FX to control how the subtractive channel is in phase with the main channel (instead of letting it endlessly drift). This is difficult to do in a tracker, because the depth if pitch sliding directly depends on the main channels note or frequency - and without macros, it has to be done manually for every note or chord. The lower the note, the bigger the steps need to be in the pitch FX column. Think of it as specialized version of detuning two channels.

 Now check out pattern #1, only two channels are doing this effect but it's distinct enough to be heard in a chord - giving the whole chord a timbre like effect when the other contributing channels have no timbre change at all. I call it subtractive waveform phasing. But I'm sure it has a real name, as someone has probably already thought of the idea.

Michirin9801

  • Hero Member
  • *****
  • Posts: 589
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #10 on: December 20, 2016, 10:06:47 AM »
On the PCE CD, you do also have the ADPCM chip, which makes higher-rate samples more usable, but you've got limited sample memory.

That brings me to another question: I know that some PCE CD games had PSG soundtracks that used all 7 channels, the 6 wavetables and the ADPCM of the CD unit, one example that comes to mind is Dragon Slayer The Legend of Heroes (Feel free to name other examples, I always welcome more PC engine music to listen to ;3)

I also know that some Game Boy games such as Kirby's Dream Land 2, Donkey Kong and Space Invaders take advantage of the Super Nintendo hardware when played on the Super Game Boy, DK adds colourful backgrounds, Kirby uses some SNES sound channels to play sound effects, I also know that some GBC games are playable on both the original Game Boy and on the colour variant, and there are even some GBC games like Shantae (I can't think of any other from the top of my head) that take advantage of the GBA hardware when detected (although I have no idea how exactly)...

I think you can already predict where I'm going with this, but here's the question:
Could a HuCard game in any way shape or form access the CD add-on and make use of the ADPCM channel?
Like for example, imagine that I wanted to make a HuCard game that had one soundtrack that played on regular PC engine units without the CD add-on, but then if a CD was detected you could enable a second soundtrack that's "CD-enhanced"?
Could you have some samples stored on the HuCard and play them back on the ADPCM? That would free up a channel on the regular soundchip where you could maybe make triad instead of a power chord or maybe add a delay-reverb effect in order to make the sound of the game more robust!

Now, I know what you're thinking: "If you wanna take advantage of the CD unit why not just make a CD game then?"
And I totally see where you'd be coming from, but the point is to make a game that could be enjoyed on any PC engine model, but also take advantage of the CD add-on when possible!
Also keep in mind that this situation is 100% hypothetical, at the moment it's all a matter of my own curiosity...

Michirin9801

  • Hero Member
  • *****
  • Posts: 589
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #11 on: December 20, 2016, 10:27:15 AM »
Michirin9801:
Have you seen this trick before: http://www.pcedev.net/audio/sub_waveform6.xm


No I hadn't seen that, but I believe Legend of Xanadu 2's soundtrack does these effects a lot, which is why it sounds so ~BEAUTIFUL~
And I recognise these waveforms, they're from Ys IV aren't they? I have them all on Deflemask ;3
Also, the effect in Deflemask to make the instruments on different channels go out of phase like that is E5xx, I've been using it quite a bit recently!

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #12 on: December 20, 2016, 11:18:31 AM »
Related to the CPU popping issue, could you use two channels for sample waveform playback but have them on opposite ticks, one going off as the other goes on, and getting two samples played back while also eliminating the pop?
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

elmer

  • Hero Member
  • *****
  • Posts: 2153
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #13 on: December 20, 2016, 01:15:57 PM »
I think you can already predict where I'm going with this, but here's the question:
Could a HuCard game in any way shape or form access the CD add-on and make use of the ADPCM channel?
Like for example, imagine that I wanted to make a HuCard game that had one soundtrack that played on regular PC engine units without the CD add-on, but then if a CD was detected you could enable a second soundtrack that's "CD-enhanced"?
Could you have some samples stored on the HuCard and play them back on the ADPCM? That would free up a channel on the regular soundchip where you could maybe make triad instead of a power chord or maybe add a delay-reverb effect in order to make the sound of the game more robust!

Yes, there's no problem (in theory) in detecting the presence of the CD add-on and then choosing to play a different tune that supports an ADPCM channel.

As you mentioned ... it's no different to how developers made GBC games backwards-compatible with the GB in order to increase the amount of target consumers.

It costs both development time and some cartridge space, but it's not particularly difficult.

But ... and it's a big "but" ... the existing System Card sound driver that we have access to doesn't support it, and neither does Deflemask AFAIK.

So the question becomes ... how do you compose tunes that take advantage of the combination?  :-k

That's been one of the top questions that I've been considering as I port my old Amiga/ST/GameBoy sound driver over to the PCE.

A decent driver isn't *that* complicated to write, it's all really a question of how to enable the musician to actually create all those wonderful tunes that the sound driver can then play back.

And when you've solved that, then it becomes a question of finding a musician that will push and expand the requirements ... to define and then use new capabilities to make the resulting tunes sound even better.

Michirin9801

  • Hero Member
  • *****
  • Posts: 589
Re: Question: Wave-phasing on the PC engine, how feasible is that?
« Reply #14 on: December 20, 2016, 02:01:47 PM »
So the question becomes ... how do you compose tunes that take advantage of the combination?  :-k

That's been one of the top questions that I've been considering as I port my old Amiga/ST/GameBoy sound driver over to the PCE.

A decent driver isn't *that* complicated to write, it's all really a question of how to enable the musician to actually create all those wonderful tunes that the sound driver can then play back.

And when you've solved that, then it becomes a question of finding a musician that will push and expand the requirements ... to define and then use new capabilities to make the resulting tunes sound even better.

I have a vague idea on how to do that actually... Instead of composing my music on a single track/file I'd make it in two, one for the HuC6280 and the other for the ADPCM, so one track would have the regular 6 channels and the other just the one ADPCM with some drum samples (btw is the ADPCM capable of re-pitching samples? Just in case I wanna throw in some orch hits or something...)
And then in the hardware itself you make the two tracks play together! Or at least that's how I'd imagine it being done...

I've already done some songs that use 2 trackers or 2 instances of the same tracker, and even if you need MML, I've read in another thread in this forum that there are tools to convert MIDI into MML for the PC engine (I think you guys know which thread I'm talking about) and I can use OpenMPT to export MIDI! So it's all a matter of me remaking some song I've already done in Deflemask onto OpenMPT and then figuring out the rest with the MML tools, so I'd totally volunteer to do that!
Heck I've already started doing a song that way a while ago, I just have to finish it...

Unless of course everything I just said is all a load of bollocks and it doesn't work like that... Please let me know...