Converting & loading samples for MSX-Audio

Página 2/3
1 | | 3

Por Meits

Scribe (6476)

Imagen del Meits

20-11-2016, 12:37

I bet Jorito wants to use the samples in Moonblaster, so PCM would be useless anyway.

Por Jorito

Mr. Ambassadors (1773)

Imagen del Jorito

20-11-2016, 12:42

Too bad, you lost Tongue

I mostly want to record some wavs through the MSX-Audio in the most authentic way. Since the MSX-Audio natively supports ADPCM I think that's the most authentic way to do it. Doesn't necessarily have to be in Moonblaster, but it has to be through the natively available hardware.

Por giangiacomo.zaffini

Champion (267)

Imagen del giangiacomo.zaffini

20-11-2016, 15:58

Yes NYYRIKKI You are right, those ITU standards do not apply here.
So I looked at MSX Datapack MSX-AUDIO page, and with the help of GOOGLE translate I can say:

1. Voice analysis

MSX - AUDIO converts 8 - bit PCM data to 4 - bit ADPCM data.

1. First, convert voice to 8-bit PCM data whichever sampling rate (1.8 KHz to 16 KHz).
2. We multiply the obtained PCM data (Symbol X1n) by 256 (i.e. X1n*256 is 16-bit PCM data Symbol Xn), compare it with predicted value as 16 bit data (Symbol X^n), and obtain the difference (Symbol dn). The default value of the predicted value (Symbol X^n) is 8000H.
3. Difference sequence (Symbol dn), sign bit is MSB (Symbol L4) of ADPCM data is set to "0" if positive, if it is negative, it is set to "1", and the absolute value of the difference is calculated at the same time (Symbol |dn|).
4. Next, the remaining 3 bits of ADPCM are determined depending on which of Table 7.82 (Note by me of MSX Datapack) the relationship between absolute value (Symbol |dn|) of this difference and quantization width (Symbol DELTAn) corresponds. The initial setting value of quantization width (Symbol DELTAn) is 7FH.
Data conversion from voice data to ADCPM data is completed with the above operation.
5. When ADPCM data is obtained, update the predicted value (Symbol X^n+1) and quantization width (Symbol DELTAn+1) of the next step.
X^n+1 = (1 - 2*L4)*(L3+L2/2+L1/4+1/8)*DELTAn + X^n
DELTAn+1 = f(L3,L2,L1)*DELTAn
Function f(L3,L2,L1) is tabulated in Table 7.83 (Note by me of MSX Datapack)
After that, by repeating operations 1 to 5 for each sampling time, complete ADPCM type speech analysis can be obtained.

It seems feasable in a simple C application module.

Even though I'm suspecting MSX-AUDIO can do PCM conversion itself since it has PCM - DATA register (address 01AH) as well as ADPCM - DATA register (address 00FH).

Por NYYRIKKI

Enlighted (5900)

Imagen del NYYRIKKI

20-11-2016, 18:50

Ah, I actually just found a proper ADPCM decoder/encoder for Windows here

Por syn

Prophet (2088)

Imagen del syn

20-11-2016, 21:39

While we are on this subject, a while back I tried to create some samples for use Moonsound Music Studio (OPL4/moonsound), and my goal is to make samples smaller in size.

What other tips and tricks are there to do this except lower samplerate/bitdept / "smart" cutting/reordering? I am not really an expert at sound editing but im pretty sure you can make things smaller, like in all those small amiga mods that practically contain a while song.

Por NYYRIKKI

Enlighted (5900)

Imagen del NYYRIKKI

20-11-2016, 21:55

syn wrote:

im pretty sure you can make things smaller, like in all those small amiga mods that practically contain a while song.

Amiga MODs are done exactly by using 8bit PCM samples... and the tricks are pretty much limited to lowering the samplerate in low sounds such as bass, cutting the samples in "smart" way, looping the samples in the end back to middle of it self and loading the samples so that there are no gaps in between... So practically you figured out all the "tricks" already. Rest of the stuff is just changing things like volume and tuning during playback.

Por giangiacomo.zaffini

Champion (267)

Imagen del giangiacomo.zaffini

22-11-2016, 09:20

MSX-AUDIO Yamaha OPL ADPCM encoding is a stadardized WAV data format (and it is aso true for Yamaha OPNA ADPCM ancoding).
It is a WAV with standardized Format-Tag 0x0020 YAMAHA ADPCM.
So any wave-data from that kind of file can be directly fed into MSX-AUDIO.

Por Jorito

Mr. Ambassadors (1773)

Imagen del Jorito

22-11-2016, 18:28

I don't run Windows, so I wasn't able to try the converter NYYRIKKi linked, but at least this info gives me something to search for a converter.

Por NYYRIKKI

Enlighted (5900)

Imagen del NYYRIKKI

22-11-2016, 21:37

Jorito wrote:

I don't run Windows, so I wasn't able to try the converter NYYRIKKi linked, but at least this info gives me something to search for a converter.

Please don't give up... The packet also included C-source, so if you are familiar with *insert OS here* then it should be pretty trivial to compile a working version... From little brainless Googling around I found that these keywords are also good to check out: Yamaha ADPCM, YADPCM, Wiimote, NeoGeo ADPCM-B, YM2608, DELTA-T

Por giangiacomo.zaffini

Champion (267)

Imagen del giangiacomo.zaffini

14-12-2016, 14:55

In year 2005 Yamaha released an official converter YAMAHA ADPCM ACM Driver Version 1.0.0.0, 2005 but I cannot find it.
Some information are in ffmpeg source, MPlayer that uses ffmpeg, in Yamaha chips datasheet and applicatin note supporting ADPCM, and in this piece of source of Rockbox, a free replacement firmware for digital music players.
libpcm Yamaha adpcm module

The wind told me that if you are concerned about sound quality, it is better to convert to ADPCM only the original 16-bit Wave. Conversion of 8 bit → 4 bit ADPCM is severely degraded.

Página 2/3
1 | | 3