Digitized sound effects on Next - in Basic and Machine Code

Discuss game and other programming topics not specifically covered in another forum

Moderator: Programming Moderators

SpectrumOldi
Posts: 18
Joined: Tue Aug 21, 2018 12:00 pm

Digitized sound effects on Next - in Basic and Machine Code

Postby SpectrumOldi » Tue Oct 09, 2018 8:42 am

I guess the sound chip support digitized sound effects? Are digitized sound effects loaded from the "disk" and put into memory when you start a program or is it "baked" into the compiled or machine coded file.

Szk
Posts: 36
Joined: Mon May 29, 2017 11:20 pm
Location: São Paulo, Brazil

Re: Digitized sound effects on Next - in Basic and Machine Code

Postby Szk » Wed Oct 10, 2018 2:43 pm

Yes, a SpecDrum/Covox style 8-bit DAC is included in the ZX Next core, so your program can load sampled data from the SD card to play along with the 3x AY "chips" and beeper.

See David Saphier's demo and the comments here: https://www.facebook.com/groups/specnex ... 501722540/

PiyoTaro
Posts: 92
Joined: Thu Jun 01, 2017 11:13 am

Re: Digitized sound effects on Next - in Basic and Machine Code

Postby PiyoTaro » Sat Oct 13, 2018 8:11 am

If the OS manages the FIFO buffer, the DAC is substituted for the PCM sound generator. It became possible to multiply and divide by Z80 CPU, and it became easy to expand wavetable. Will MOD format music player be integrated into OS? 8-)

"DMA audio" installed in the OS assumes a machine clock of 3.5 MHz. When used in 14MHz mode of "Next", sampling data of 13KHz * 4 = 52KHz is required. :(


I would like to use the "Copper Sound System" rather than DMA, because I want to run the application of "Next" in 14 MHz mode, and the memory bank switching and interference with DMA become troublesome when debugging.

By the way, "Copper" can count 312 scanlines on the screen. However, with current firmware Copper does not have interrupt function.
When looking at the current document, first specify the "START, then reset at next VBlank" command in the control register of "Copper". And it seems to upload data programmed to Copper every Vblank period.
I am worried whether the program can be executed at a certain timing. I want sample code.

Alcoholics Anonymous
Posts: 381
Joined: Mon May 29, 2017 7:00 pm

Re: Digitized sound effects on Next - in Basic and Machine Code

Postby Alcoholics Anonymous » Mon Oct 15, 2018 12:18 am

PiyoTaro wrote:
Sat Oct 13, 2018 8:11 am
"DMA audio" installed in the OS assumes a machine clock of 3.5 MHz. When used in 14MHz mode of "Next", sampling data of 13KHz * 4 = 52KHz is required. :(
This has been fixed now. The DMA sampled audio will run at constant rate no matter what the CPU speed is. Sample rates can now be set as low as 3.4kHz.

The version of the core for production was frozen long ago so this change is in a later version.
By the way, "Copper" can count 312 scanlines on the screen. However, with current firmware Copper does not have interrupt function.
When looking at the current document, first specify the "START, then reset at next VBlank" command in the control register of "Copper". And it seems to upload data programmed to Copper every Vblank period.
I am worried whether the program can be executed at a certain timing. I want sample code.
The copper operates in exact lockstep with the display generation. Its instructions allow the copper to wait for a specific line and horizontal byte position. Running an effective "nop" instruction allows the copper to delay past individual pixels in that byte.

Its program is stored in a 2k space on the fpga. Each instruction is 16-bits so that's an instruction space of 1k instructions. The instructions are no reloaded each frame; the internal program counter is just reset to zero (in vbi mode) or allowed to wrap around (in loop mode).


Who is online

Users browsing this forum: No registered users and 0 guests