Author Topic: Merry Christmas and... the LFO: can anything musical be done with it???  (Read 650 times)

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Hey, folks.  I know the PCE's LFO (so-called "FM") can create some weird warbling and growling sound effects... but can it actually make anything harmonic resembling an instrument?

Anybody have any LFO settings that approach anything musical?

I did a few more simple tests with the LFO and have some updated technical info about it (contradicting the PSG docs in HuC/MagicKit)

First off, when $0809 (LFO trigger) bit 7 is high, the LFO is activated, and waveform data for channel 1 act as values to add/subtract from channel 0's frequency register.  Whenever any byte in the waveform data is $10, there is no change to the frequency.  When the bytes are $11 to $1F, the frequency reg for channel 0 has $01 to $0F added to it (lowering the pitch).  When the waveform bytes are $0F to $00, the frequency reg for channel 0 has $01 to $10 subtracted from it (raising the pitch).  Thus, if you have a flat waveform of any value in channel 1, you can linearly raise/lower the frequency of channel 0 through the LFO.

Bits 0 and 1 of $0809 scale the waveform amount by 0,1,4, and 16  (not 16 and 256 as in the MagicKit docs.)  Thus if you set the frequency reg in channel 0 to $140, the waveform in channel 1 to all $0Fs, and the LFO is set to 1x scaling, the resultant frequency coming out of channel 0 would be the same as if it had been set to $13F.  If you set the scale factor to 4x, then the resultant frequency of channel 0 would be $13C.  ($140 - $04 = $13C).  Likewise, if you use the 16x scale setting, the resultant frequency would be $130  ($140 - $10 = $130).

Therefore, with the waveform range of $00 to $1F, and the scaling factors, here is the maximum range the output frequency of channel 0 can be changed:

 1x: -$ 10 <-----> +$ F
 4x: -$ 40 <-----> +$3C
16x: -$100 <-----> +$F0


Now the problem is that the frequency register is simply being changed, and not the actual output frequency, thus the modulation that comes out is different for different notes/octaves, and thus totally nonharmonic, as well as the fact that the modulation blindly causes register wraparounds (ie: $030 - $100 = $F30, a very low note), with more problems besides...

Also, I've played with the LFO frequency (with channel 1 frequency) settings while watching an oscilloscope, and although it can create faster and faster vibrato, it never seems to create overtones that shape channel 0's waveform like (I imagine) true FM would.  Worse, at the fastest possible frequencies, the LFO seems to give up as well, meaning its frequency (countdown) timers stay reset at some level, applying a constant modulation value (rather than ultra-fast modulation).

So that's that.  Anybody got any good use out of the LFO?

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Merry Christmas and... the LFO: can anything musical be done with it???
« Reply #1 on: December 25, 2014, 05:02:04 PM »
Unfortunately, the frequency analyzer in my osci is not so good.... it takes steps of about 5-7 Hz when frequencies are below 50hz.

However, if you pair two or three channels together, with the same waveform (a 90% duty cycle pulse wave, for example) and with close frequencies (eg: $F00, $F01, $F02) their interference patterns will help add some rumble.

All this time, tho, there will be a bit of high-frequency aliasing because of the stairstep behaviour of all the PCE's waveforms.  Too bad we can't do anything about that, besides a low-pass filter.

(You can test this all out here: http://www.pcenginefx.com/forums/index.php?topic=11401.msg220803#msg220803 )

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Merry Christmas and... the LFO: can anything musical be done with it???
« Reply #2 on: December 26, 2014, 08:58:22 PM »
I might have an MML file laying around with some LFO settings in it from Squirrel that sounded cool.

I'd have to dig around for it though.
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: Merry Christmas and... the LFO: can anything musical be done with it???
« Reply #3 on: December 28, 2014, 01:27:56 PM »
I would like to hear some samples of this effect to illustrate it.
<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

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Merry Christmas and... the LFO: can anything musical be done with it???
« Reply #4 on: December 30, 2014, 08:33:32 AM »
Yeah, magickit description has some errors, as well as other older docs. I did LFO testing with rypheca and exodus as few years ago and found some interesting things, but nothing that made notes like traditional FM. I was able to make some high frequency sound effects with it, but other than that - it's useless. It's useless as LFO, because you can change the PCE's period registers without artifacts that other older audio chips had at the time (nes and sms come to mind).

 IIRC, the modulating channel will also 'audio' leak to the DAC if the volume isn't set to zero. I also had a bug where if I didn't initialize ALL sound registers, that the waveform data from the modulation channel would be applied as square waves (regardless of what was written to it). I never isolated the problem, because it was random at boot up (not a usable exploit). Initializing every sound register fixed it.

 Edit: Found this info I had from a while back
Quote
_ D1-0: These are the FM data multipliers. They are: $00=Off, $01=0.5x, $02=4x, $03=16x.
I tested this by applying the settings, recording from the system, and then checking against a frequency analyzer.

 Also, this:
Quote
Channel 1 will output the waveform data as normal sound in LFO mode. You can also write to channel 1’s data port and replace the waveform memory as it’s playing. Just like with other channels. It’s unclear if the new data written on the port effects the frequency modulation right away, either. This still needs to be tested. But I do know that the sound will be heard if channel 1’s volume is high enough
  Just like with any normal channel, if you write to the DDA port while the channel is 'playing' - it will transfer that written value into the channel's ram at the current playback pointer (this is used as an effect by a few games). The same applies for when the channel is in modulation mode.
« Last Edit: December 30, 2014, 08:47:15 AM by Bonknuts »

elmer

  • Hero Member
  • *****
  • Posts: 2154
Re: Merry Christmas and... the LFO: can anything musical be done with it???
« Reply #5 on: December 30, 2014, 02:57:39 PM »
ccovel & Bonkuts ...

Yes, it's a documentation error in MagicKit. The official PSG manual confirms what you're saying.

Just for laughs ... the description of bit 7 ... the LF TRG bit is ...

Writing "1" to the LF TRG bit (MSB) causes the LFO reset and initialization. And modulation is halted with modulation data from address "0" of waveform register of ch2. Wave counter is also reset to 0.

AFAIK it's not there for FM ... it's purely for producing a "vibrato" effect, at least that's how the musicians that I've worked with used similar hardware on other machines.

BTW ... I've followed both of your explorations for years now ... thank you. The PCE is one of the few systems that I haven't worked on, and your efforts are part of the body of work that may finally make it possible to rectify that.

ccovell

  • Hero Member
  • *****
  • Posts: 2245
Re: Merry Christmas and... the LFO: can anything musical be done with it???
« Reply #6 on: January 01, 2015, 04:49:06 PM »
Happy new year!

Edit: Found this info I had from a while back
Quote
_ D1-0: These are the FM data multipliers. They are: $00=Off, $01=0.5x, $02=4x, $03=16x.
I tested this by applying the settings, recording from the system, and then checking against a frequency analyzer.

I don't think this is accurate.  If you set another channel to the same waveform type and a near frequency, you can get a far more accurate way of judging what the modulated frequency is, by changing the other channel's frequency until they are exactly in phase.

That's how I tested the resultant frequencies, with my ears and an oscilloscope.  From this I found the multiplier for $01 was 1x.

In my experience, FFTs and analyzers aren't accurate down to the Hertz.

elmer

  • Hero Member
  • *****
  • Posts: 2154
Re: Merry Christmas and... the LFO: can anything musical be done with it???
« Reply #7 on: January 02, 2015, 09:42:57 AM »
Happy New Year. You're right again, Chris ...

The manual says 0=off, 1=0-bit shift, 2=2-bit shift left, 3=4-bit shift left.
« Last Edit: January 03, 2015, 03:30:45 PM by elmer »

Punch

  • Hero Member
  • *****
  • Posts: 3278
Re: Merry Christmas and... the LFO: can anything musical be done with it???
« Reply #8 on: January 02, 2015, 11:38:55 AM »
Don't tease us, where's the pdf of the manual?

elmer

  • Hero Member
  • *****
  • Posts: 2154
Re: Merry Christmas and... the LFO: can anything musical be done with it???
« Reply #9 on: January 03, 2015, 03:37:10 PM »
You do realize that all the LFO information, and all the interesting video register settings too, are shown in Hudson Soft's patent filings that have been made available on Archaic Pixels within the last year or so?

Punch

  • Hero Member
  • *****
  • Posts: 3278
Re: Merry Christmas and... the LFO: can anything musical be done with it???
« Reply #10 on: January 03, 2015, 03:46:19 PM »
Actually no, I didn't. But it would sitll be interesting to see an official document for the PCE/Turbo if you're interested in sharing the manual. If not no big deal.