Realfun 3

Page 9/10
2 | 3 | 4 | 5 | 6 | 7 | 8 | | 10

By Huey

Prophet (2673)

Huey's picture

07-06-2021, 10:32

Great stuff!

By GhostwriterP

Hero (595)

GhostwriterP's picture

12-06-2021, 16:19

So I have been tweaking the re-player a bit to see what is faster for the PSG, update all registers all the time or testing if a resister needs to be updated. The later method is what is currently in the re-player.
Updating all will give a constant cpu load while with the testing method this will vary. If a lot of registers will be updated at the same time the extra time required for the test and update flag management will make the update slower than needs to be.

After some testing it turns out that there is no real clear winner... for some songs we gain up to 300 cylces others we lose same amount. But looking at the highest cycles peak of all the songs, the test method is about 100 cycles faster, so I think I will stick with that for now.

Anyway, below is an updated table for the cpu loads (did some re-calibrating and minor code optimizations). I also added a 4 int peak average cycle count. This may come in handy as an indication in case the game is not required to run under full fps but at 30,25,20 etc. In that case the cpu load by re-player would be smeared out over multiple instances which will soften peak load a bit.

song     1 int peak           4 int peak average
         cycles   CPU use %   cycles   CPU use %
                 60 Hz  50 Hz         60 Hz  50 Hz
---------------------------------------------------
hydroc    11549  19,5%  16,1%   9852  16,7%  13,8%
miners    11972  20,2%  16,7%  10040  17,0%  14,0%
corridor  11784  19,9%  16,5%   9053  15,3%  12,6%
staff     11878  20,1%  16,6%   9288  15,7%  13,0%
metalsqd  10656  18,0%  14,9%   8583  14,5%  12,0%
battle	  11643  19,7%  16,3%   9711  16,4%  13,6%
vector     9387  15,9%  13,1%   5998  10,1%   8,4%

By Grauw

Ascended (9910)

Grauw's picture

12-06-2021, 21:57

Note that writing to the envelope shape register retriggers the phase, so always writing vs only writing when it changes will not sound identical. The SCC has something similar when writing the period register.

By GhostwriterP

Hero (595)

GhostwriterP's picture

13-06-2021, 09:45

Indeed, envelope shape register is always tested. And the same for the SCC, the registers are updated only when needed... well most of the time... I think at the moment a new note event will trigger an update regardless if the content is already the same. That is slightly different from the editor music player where the new and previous period values are compared and based on that updated or not. It may become noticeable when playing the same note repeatedly...
I probably should have look into this, possibly there is an easy fix in the re-player format encoding.

By Manuel

Ascended (17945)

Manuel's picture

13-06-2021, 10:38

Can you explain what you are actually doing with realfun 3? Are you updating the wave data exactly in time to get the effect of a 'longer' sample?

By GhostwriterP

Hero (595)

GhostwriterP's picture

13-06-2021, 14:02

Wave updates are not exactly on time, not certain that it is practically feasible. I know there is a topic about sample playback on SCC on this forum somewhere which may describe some methods for "knowing" where the SCC wave pointer is, but not using this atm. I suppose it would improve the sound quality a bit if it were possible though...

In realfun 3 wave updates are just every instance or every now and then, based on the timer used.

The most basic effect is the wave morphing from one wave form to another like Konami and TT do. In addition there are some other effects, for instance wave interference. With this effect a wave form is mix with itself (or another wave form) but the second can be offset in 32 steps. By cycling through these 32 offset steps you get automatically a nice continuous loop of 32 wave forms, which can be seen as 'longer' sample.
With the plain wave interference effect it is sort of simulating a de-tune effect on a single channel instead of using two channels. The cycling speed and timer determines the value of de-tune. By using this effect with two different wave forms you are sort of putting two instruments into one channel. Both give more body to the sound, but will of course soften the volume a bit.
Furthermore there are some limitations to it. For some wave forms it works out better than others, as it will produce this kind of rattling sound (the pluck on staff roll is already on the edge...). To mask this a bit you can play with differents cycle speeds and mix the result with another wave form to water it down a bit.

The method I've been using so far to create the SCC patches is by using WavePad, to look at some Moonsound samples, or watching the oscilloscope music videos on youtube. Then model some basic wave forms at certain "key frames" and play around with some effects to fill in between and/or after.
Usually I am ending up with some wave morphing in the attack portion of the instrument and then switching into an interference loop. Not using modulation as much recently, which is used for the guitar sounds, because it very hard to predict or control the outcome. Basically using modulation based patches are hours of trial and error and requires lots of patience or just get lucky. Perhaps it is possible to develop a feel for it over time Wink

One could probably write a book on how all the effects work and how to use them to create some nice SCC patches.

By GhostwriterP

Hero (595)

GhostwriterP's picture

14-06-2021, 17:48

Created some new scc voice patches over the weekend. Of course I had to try them out... Green or blue

Strange title... and a solo with interesting timing... This song is old one, once included as a demo song for the first Realfun (the one for moonsound/opl4 that is, for anyone still remembers ;), now rearranged for the SCC+ & PSG.
This song features several instrument patches and with a little imagination you can hear a marimba, synth bass, brass section, some organ (in the distance), electric piano and of course last but not least the trombone.

I think that synth bass is really something, who imagined an SCC sound like that!

By GhostwriterP

Hero (595)

GhostwriterP's picture

25-07-2021, 18:20

It has been a while since last update. Lately I have been working on integrating the replayer in one of my ongoing (never ending) game projects. Worked out most of the quirks in the song conversion tool, so the replayer should sound exactly the same now.
Was quite a bit of work really. This because wave forms were calculated differently in C than in assembly and I had to make sure I got the same round off errors in C code. So ended up translating the assembly code to C code instruction by instruction Smile. And of course there were also still some silly bugs that needed fixing.
Strangely enough the C code optimizer interprets things differently in the release build than the debug build ... so that still needs fixing ... possible due to the mixed use of signed and unsigned integers among other things... still have to dive into that.

... and then there are still bugs in realfun 3 editor that I need to pick up some day ....

O well, in the mean time I uploaded a new song rearrangement for you all to enjoy: Tower

By thegeps

Paladin (831)

thegeps's picture

25-07-2021, 19:33

First like is mine Smile

By Huey

Prophet (2673)

Huey's picture

27-07-2021, 09:59

Nice song again!
I was wondering; could you make a video of the same music without the waveform manupilation? I was wondering how much that has effect on the overall sound.

Page 9/10
2 | 3 | 4 | 5 | 6 | 7 | 8 | | 10