PlayStation sound format sound engine research
BotB Academy Bulletins
 
 
151404
Level 23 Pedagogist
ViLXDRYAD
 
 
 
post #151404 :: 2022.02.01 10:00am
  
  BubblegumOctopus, damifortune, liveheaven, nitrofurano and now_its_dark liēkd this
Hello, and good day!

The next source source contains a baremetal assembly for PlayStation that plays a sample on two channels, with effects that the 24-channel sound chip in features, set on:
https://cdn.discordapp.com/attachments/240273316961714177/938131676113022986/Sony_SPU.zip

It is extremely barebones: main.s is the whole source code: The program sets registers for the effects, the ADPCM sample repeat address is yet hardcoded, sets one channel to play, a loop waits for some time, and plays the same sample on another sample. In the linked archive is a render of the project output, ps.psf as played in foobar2000 via a plugin named as Highly Experimental PSF decoder, by kode. The source code took its form greatly thanks to baremetal PlayStation assembly examples by PeterLemon.

make_psf.py is a Python3 script that takes the assembled output of main.s and puts it into a PlayStation sound format container

main.ld is a linker script: It makes the labels in main.s point to their equivalent placement in PlayStation memory defined in the PS-EXE header, 0x80010000

sqrwave.pss is the ADPCM sample: Similar to the Super Nintendo BRR, it features blocks of 16 bytes; the first block are all zeroes; the first byte defines the filter used to decode samples in the block; its second byte defines whether the block is a loop start, loop end, or othewise; the rest of bytes are the samples: Each of are 4 bits signed, therefore, two samples are stored in each byte, making for 28 samples in each 16 bytes block. You could edit the sample values manually in a hex editor: The lower 4 bits of each byte comes first; the higher 4 bits of each byte comes after it: 7777777799999999 is a square waveform: 10322301efcddcfe is a triangle waveform! More information about the sample format may be found on the document that the next hyperlink leads at:
https://www.problemkaputt.de/psx-spx.htm#spuadpcmsamples

data.s is unused and incomplete; it creates note symbols meant to be associated with a frequency table, and used to create tracks using

make.sh is the script that calls command to build the source code, and output ps.psx: A PlayStation executable, and ps.psf: A Playstation sound format container, with a compressed ps.psx in for PSF players to execute. It using GNU Binutils, targeting the triplet mips-none-elf, and Python3 to create the ps.psf

A wonderful PlayStation debugger, and PSF player, named as PSFLab, by the, also PSF format creator, Neill Corlett, may be downloaded via the next hyperlink:
https://web.archive.org/web/20130616071758/http://www.neillcorlett.com/downloads/PSFLab104.zip

A description of MIPS processor architecture, may be viewed at and downloaded from the next hyperlink:
https://www.ece.lsu.edu/ee4720/mips32v2.pdf

An hyperlink to the most complete PlayStation system documentation that I am aware of:
https://www.problemkaputt.de/psx-spx.htm

Download links for GNU Binutils source code:
http://ftp.gnu.org/gnu/binutils/

Online documentation of a GNU Binutils version:
https://sourceware.org/binutils/docs-2.37/

Download web page of Python3:
https://www.python.org/downloads/

GNU Binutils may be compiled to target the none mips-none-elf triplet by having a C compiler, and the software named as make, on path, decompressing it, and using the next commands:
cd binutils
mkdir build
cd build
../configure prefix=/usr/local target=mips-none-elf
make
make install

It can be build on Windows too, by using MinGW and equivalent commands, or in Cygwin, offering a POSIX implementation, and software package repository one may download and install python, a C compiler, and make, and bash shell software one may execute the aforementioned commands as they are, using. One may download MinGW via the next hyperlink:
https://sourceforge.net/projects/mingw/files/Installer/

The next hyperlink leads at Cygwin home page:
https://www.cygwin.com/

I am feeling desire to express thanks to BotBrs MiDoRi, for encouraging and supporting me on delving on this platform; Googie, for gifting me b00ns I can make bulletins with ^^ being a good buddy for me, and a list of matters you have benefited me with, I differ from being aware of where it begins and end; and Robyn, also for supporting me, encouraging me, and being so nice towards me.

I am aiming to build a sound engine for I can use to compose music with, and would love to watch at other beings approach for a sound engine, and algorithms related to! I am also feeling appealed to effects others may implement on a! You are utmost welcome to share any about sound engines and algorithms for effect, including theoretical, guides, and research on this thread too!
 
 

LOGIN or REGISTER to add your own comments!