Subject: uade and resample

From: giulio
Date: Tue Apr 12 19:15:20 2005

To: UADE-Developer-discussion
Hello,

i have found a package that seem interesting, called resample (
http://www-ccrma.stanford.edu/~jos/resample/resample-1.7.tar.gz   ).

It's able to interpolate a low frequency sample into an higher freq
sample with good results ( interpolation ).

I have tried it changing the uaerc in /usr/local/share/uade and
modifying a bit my script ( called mod2ogg.sh, in the frontend dir of uade ) [ i have also added a normalize function with sox only without the need of normalize ] , and it seem to work fine ;) [ it isn't an impression since i have analyzed the wave form and it's noticeably smoother than the normal one ].

In order to to do it i have found the undocumented -config switch in the c sources to load the new 28 khz config ( apropos, what is the exact frequence of Paula ( actually i have used 28800 ) ?)

What do you think about postprocessing the output in order to make it
smoother? It's already done inside uae, but this way is much better imo.

There is also a library ( even better ) that should be more accurate and
faster ( http://www-ccrma.stanford.edu/~jos/resample/libresample-0.1.3.tgz ), but i can't use it in a script.

[quote:a7c1a1e9e3]
libresample-0.1.3.tgz7 (LGPL) (released Jan, 7, 2004) by Dominic Mazzoni is a real-time library for sampling rate conversion providing several useful features relative to resample-1.7 on which it is based: 
[/quote:a7c1a1e9e3]

What do you think about adding a resample function to uade itself ( like what happens for example with modplugplay )?

---

From: shd
Date: Thu Apr 14 13:49:27 2005

To: UADE-Developer-discussion
[quote:b4f3f5c174="giulio"]
In order to to do it i have found the undocumented -config switch in the c sources to load the new 28 khz config ( apropos, what is the exact frequence of Paula ( actually i have used 28800 ) ?)
[/quote:b4f3f5c174]

Check http://uade.ton.tut.fi/amiga-hardware/ (all picture files).

The base frequency of paula is 3.58 MHz (in NTSC). And at each period (lasting time 1 / (3.58 MHz)) there is one state transition in the audio state engine (see the sm0.png). The period register counts down to 1, and then a new sample is put onto DA converter. It takes certain time for the DMA to fetch a new sample pair, but that time is large so large that minimum 'allowed' period is something like 127 (I don't remember the exact value). Thus it follows that the maximum sampling rate that is DMA driven is near 28800. However, since each channel varies in sampling rates, the only common denominator is 3.58 MHz. So if you want exact sampling rate then use 3.58 MHz ;-)

Just use 16-bit stereo 44kHz/48kHz :-)

[quote:b4f3f5c174="giulio"]
What do you think about adding a resample function to uade itself (like what happens for example with modplugplay )?
[/quote:b4f3f5c174]

No. This should be implemented into special audio applications, not UADE. It's a general DSP algorithm so it really doesn't belong to an Amiga simulator.

But we could distribute scripts and configs for DSP applications to postprocess Amiga sound :-)

shd / uade team

---

From: giulio
Date: Sun Apr 17 08:02:17 2005

[quote:6c7c2d3f1d]

[/quote:6c7c2d3f1d]

Sorry but i don't understand that much in that images :( . I haven't enought knowledge of these diagrams and of hardware.

I wanted only to know if 28800 was ok or not.

[quote:6c7c2d3f1d]

giulio wrote:

shd / uade team
[/quote:6c7c2d3f1d]

Surely you are right, but atm uade output is probably the audio player that is most similar to the amiga one, even in terms of quality.
But there are apps ( with their problems too of course ), like modplugplay, capable of better audio output due to filtering.

So i wanted to improve for what i can the audio quality uade.
I found resample and the output seems better.

Of course it can resample a lower frequency sound into a greater one, but it isn't able to interpolate a 44100 Hz.

If you know the name of free command line DSP apps that are able to interpolate the sound ( maybe even remove clicks ) let me know.

---

From: mld/uade team
Date: Mon Apr 25 20:31:15 2005

hej, Guilo

28khz is max rate iirc (on Amiga it was dependent on the screenmode, please correct me if I remember it wrong)

However, instruments/samples on the amiga could be played on different rates on each channel.

Btw. In the easter eggs section/UADE User forum there's some tips how you can set some replays to use that mixing mode.  :)

About filtering... Something that might be another easteregg too, there already is interpolation code in uade *grin* It plainly just isn't used :)

If you add samplesi_crux_handler() and  samplesi_rh_handler()  to include/gensound.h and change sample16s_hanlder to one of these in your outputmodule uade is uses the UAE filtering code. crux=light filtering, rh=muffled filtering ... :))))

hope it helps

mld/uade team