Jump to content
IGNORED

[AQUARIUS] - New Demo


Recommended Posts

Hi,

 

I can't thank @Pernod enough for his work enhancing MAME to support bank switching.  I have really had a lot of fun this weekend creating this new demo.  It is not very different from the Portal demo but has some new features and better audio quality.  I also have to thank Matt for writing Aquarius Draw because it really helped with graphics, although I am 90% sure I have found a bug.  I even sent him a tip asking him to email me so I can explain, but it's ok, I was able to use the output regardless.  Anyway, two big changes as well.  The audio on this player is vastly superior to the audio on the portal demo, not only did I squeeze down the t-state between samples to 29 adding 20% speed clocking in at 123 kHz, I also implemented a 2nd order Sigma Delta Modulator.  I tried to implement a 3rd order and a multi-stage but both of those had garbage output.  I added "dancing Aquamen" but they do not really dance, you'll notice a bit of a pop when they move so I did not move them much.    I believe that this is the best audio output quality that I will be able to achieve using the 1-bit DAC on the Aquarius.  Thank you everyone here as this journey started for me on the forum and I didn't know a single line of assembler.  I don't have my Aquarius set up at the moment, so I can't run it on real hardware.  

 

Video of Demo Here

 

Here is the file if you want to run it yourself.

 

BitPlay.zip

 

I explored trying to put a text scroller and blinking lights but it had too much of an impact on the audio quality.  I'll have to learn how to use the AY to do something like that.  Not sure where to go next but I'll be doing something.  

 

Thanks,

 

Chris

 

 

  • Like 5
Link to comment
Share on other sites

Speaking of 1-bit, last week I learned about the plethora of music player routines that run on a ZX Spectrum with beeper, multiplexing channels onto it. While I'm not sure how good it sounds on real hardware, perhaps that is something you'd be interested in porting to the Aquarius. It would run without expansions and be a natural branch off the 1-bit sample player. Here some info + download link to 1tracker if you're interested.

Link to comment
Share on other sites

5 hours ago, chjmartin2 said:

Hi,

 

I can't thank @Pernod enough for his work enhancing MAME to support bank switching.  I have really had a lot of fun this weekend creating this new demo.  It is not very different from the Portal demo but has some new features and better audio quality.  I also have to thank Matt for writing Aquarius Draw because it really helped with graphics, although I am 90% sure I have found a bug.  I even sent him a tip asking him to email me so I can explain, but it's ok, I was able to use the output regardless.  Anyway, two big changes as well.  The audio on this player is vastly superior to the audio on the portal demo, not only did I squeeze down the t-state between samples to 29 adding 20% speed clocking in at 123 kHz, I also implemented a 2nd order Sigma Delta Modulator.  I tried to implement a 3rd order and a multi-stage but both of those had garbage output.  I added "dancing Aquamen" but they do not really dance, you'll notice a bit of a pop when they move so I did not move them much.    I believe that this is the best audio output quality that I will be able to achieve using the 1-bit DAC on the Aquarius.  Thank you everyone here as this journey started for me on the forum and I didn't know a single line of assembler.  I don't have my Aquarius set up at the moment, so I can't run it on real hardware.  

 

Video of Demo Here

 

Here is the file if you want to run it yourself.

 

BitPlay.zip 813.64 kB · 2 downloads

 

I explored trying to put a text scroller and blinking lights but it had too much of an impact on the audio quality.  I'll have to learn how to use the AY to do something like that.  Not sure where to go next but I'll be doing something.  

 

Thanks,

 

Chris

 

 

That's very impressive!  And good choice in picking Shannon for the track. ?

Link to comment
Share on other sites

1 hour ago, DZ-Jay said:

That's very impressive!  And good choice in picking Shannon for the track. ?

Thanks - apparently the audio fidelity was good enough that the copyright filter picked it up on Youtube which I took as a compliment.  

  • Like 1
  • Haha 1
Link to comment
Share on other sites

6 hours ago, carlsson said:

Speaking of 1-bit, last week I learned about the plethora of music player routines that run on a ZX Spectrum with beeper, multiplexing channels onto it. While I'm not sure how good it sounds on real hardware, perhaps that is something you'd be interested in porting to the Aquarius. It would run without expansions and be a natural branch off the 1-bit sample player. Here some info + download link to 1tracker if you're interested.

Any ZX Spectrum code should be a straightforward port to Aquarius.  I think it would be fun to figure out how to use 1tracker to output to Aquarius.  Now we need MAME to support the Bruce's SD Card reader and then we'd be able to make a general purpose tracker player, a la Aquarius Juke Box.  Hmmmm.... I like this idea. 

  • Like 1
Link to comment
Share on other sites

The above program outputs nice source code to the player and music data so it might be quite feasible given an evening or a weekend, depending on how fluid you are in Z80 as well as the two respective platforms. The music program has some 40 different routines, generating 2-8 voices over the speaker.

Link to comment
Share on other sites

On 7/6/2021 at 1:27 PM, chjmartin2 said:

Any ZX Spectrum code should be a straightforward port to Aquarius.  I think it would be fun to figure out how to use 1tracker to output to Aquarius.  Now we need MAME to support the Bruce's SD Card reader and then we'd be able to make a general purpose tracker player, a la Aquarius Juke Box.  Hmmmm.... I like this idea. 

You mean the Micro Expander with CH376? This should be doable, the USB would simply point to a local shared folder to read the files.

 

Here's a little MAME usage tip ... in your MAME folder create software/aquarius subfolders and place your .bin files in there instead of the mame root folder. Now whenever you open the File Manager to load your .bin it should default to this new folder.

Also, you can edit your ui.ini and change skip_biosmenu to 1 to avoid having to select S2/S1 every time you run the machine.

Edited by Pernod
Link to comment
Share on other sites

17 hours ago, jltursan said:

Really nice!, I doubt you can get any better 1-bit sound with the machine ?

I would need to either implement an even higher order Sigma Delta Modulator (I tried, went unstable and/or gave me garbage output) or figure out how to get an even higher bit rate.  I am at 123 KHz which is 29 t-states per sample.  

 



main:

    ld bc, 8191            ; (10) number of bytes of samples
    ld hl, $C000           ; (10) Memory Location to ROM Sample
 
    ld a, (hl)               ; (7) load first sample set into A
    rlc b                     ; (8) set up b to be rotated, waste cycles
    
replay:    
    
    out ($fc), a          ; (11) send out the sample
    ld de, 13312        ; (10) Load the border memory location (and waste cycles)
    rlca                     ; (4) rotate the PWM model left
    nop                    ; (4) waste cycles

                             ; 29

    out ($fc), a         ; (11) send out the sample
    inc hl                 ; (6) Move up the Rom sample location
    rlca                   ; (4) rotate the PWM model left
    rrc b                  ; (8) unrotate b from previous rotate
    
                            ; 29

    out ($fc), a        ; (11) send out the sample
    rlca                    ; (4) rotate the PWM model left
    ld (de),a             ; (7) waste cycles
    ld (de),a             ; (7) waste cycles

                           ; 29

    out ($fc), a        ; (11) send out the sample
    rlca                   ; (4) rotate the PWM model left
    ld (de),a            ; (7) change border color
    ld (de),a             ; (7) waste cycles

                            ; 29 

    out ($fc), a        ; (11) send out the sample
    rlca                   ; (4) rotate the PWM model left
    jp skiplou            ; (10) waste cycles
skiplou:    
    nop                    ; (4) waste cycles
                        
                             ; 29

    out ($fc), a        ; (11) send out the sample
    rlca                   ; (4) rotate the PWM model left    
    ld d, (hl)            ; (7) load next sample into d
    ld d, (hl)            ; (7) waste cycles

                        ; 29    

    out ($fc), a          ; (11) send out the sample
    rlca                  ; (4) rotate the PWM model left
    dec bc                ; (6) Reduce the byte counter
    rlc b                ; (8) see if loop counter went negative

                        ; 29

    out ($fc), a          ; (11) send out the sample
    ld a, d                ; (4) next first sample set into A
    nop                    ; (4) waste cycles
    jp p, replay          ; (10) do it again until we are done!
    
                        ; 29 

[/CODE]

 

The above is my main player loop and it has to be exactly the same number of t-states between samples.  I do have to waste some cycles in some steps and the cycle accuracy isn't SUPER important between 8k blocks when I switch banks.  So it essentially reads a sample, sends it out (the last bit gets sent to the speaker port) and then rotates the bits to play the next bit.  One way I know I could make the player faster would be to use a full byte per sample but then I would be wasting 7 bits of ROM storage per sample.  I may do that just to show how high quality we could get.  It would be 170 kHZ but only 6 seconds of audio for a full megabyte ROM.  Again, my guess is that somebody who is really good with Z80 ASM could figure out how to reduce the t-states needed and still use every bit of ROM we have, but that person isn't me.  Anyway, the 2nd order sigma delta modulator itself produces CD quality noise free audio at 384 kHZ.  

 

OUTPUT.wav

 

This Wave file will play if your system supports direct output of 384 kHZ (mine does, and I have a pretty old PC now) and if you look at the file you will see that it only contains two output values either all the way on or all the way off.  The challenge is that the out command itself takes 11 t-states which if it were only that instruction is 325 kHZ but we have to get the value in the accumulator first, so yeah, that's it for that.  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...