Jump to content
IGNORED

Has anybody played around with digitized sound?


Wookie

Recommended Posts

Not yet, but as far as i know HandyMusic supports streaming digitized sound directly from the cartridge. The HSPL offered the ability to include samples as well, but I believe that they are read in-memory. Not sure on this though. Check the samples I recently shared. One has digitized speech in it.

BTW, did you see this post: http://atariage.com/forums/topic/208856-simpsons-for-the-lynx/

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 years later...

 

And BLL contains playback routines for packed and unpacked digi sound.

 

What do you exactly mean by packed and unpacked? When playing digitalized sound in my game, I'm converting my samples to mono and the smallest bitrate I can (I think 8khz), and this is it (I keep a 8k buffer to dynamically load all sort of stuff, digi sound included... that means a maximum playing length of 2 top 3 seconds... :D).

 

But now you're saying there is the possibility to compress them? tell me more :) Thanks!

Link to comment
Share on other sites

I had a delta packer (lossy) for the samples using only 4 bit to define the delta between the current sample and the next one.

The problem is: I cannot find the packer anymore :( When packing the sound you have to take the error into account.

 

See sample.inc:

***************
* packed Mono-Sample
***************
PlayMono::    lda SmpSema
    bne .no_read
    dec SmpSema
    jsr ReadByte
    sta SmpTemp2
    REPT 4
    lsr
    ENDR
    tax
    clc
    lda tabelle,x
    adc SmpTemp
    sta SmpTemp
    sta $fd22

.cont1    inc DigiCount
    beq .next0
    END_IRQ
.next0    inc DigiCount+1
    beq .next1
    END_IRQ
.next1    inc DigiCount+2
    beq StopSampleIRQ
    END_IRQ

.no_read    stz SmpSema

    lda SmpTemp2
    and #$f
    tax
    clc
    lda tabelle,x
    adc SmpTemp
    sta SmpTemp
    sta $fd22
    END_IRQ

tabelle    DC.B 128,-64,-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32,64
Link to comment
Share on other sites

  • 2 weeks later...

You can just type in 4000 in Resample. The lowes preset value is 8000.

 

When I make the Elvis tune I just wrote it all in C. If you want to know why I set isfrog=0 30 times so it is the delay for one sound value.

 

int Bl17()
{
    unsigned char *musa;
    unsigned int i;
    unsigned char j;
    unsigned char isfrog;
    musa = elvis;
    abc_samplemode(0);
    abc_setvolume(0, 255);
    for (i = 0; i < 21000; i++) {
       for (j = 0; j < 30; j++) {
           isfrog = 0;
       }
       abc_out(0, *musa);
       musa++;
    }
    abc_setvolume(0, 0);


    return 11;
}

And the ad-hoc audio modules:

 

void abc_setvolume(char chan, int volume)
{
        wanted_volume[chan] = (char) volume;
        VOLUME_REG(chan) = (char) volume;
}


void abc_out(char chan, char sample)
{
        OUT_REG(chan) = sample;
}


void abc_samplemode(char chan)
{
        // Disable count
        CTLB_REG(chan) = 0x0;
        CTLA_REG(chan) = 0x10;
        STEREO_REG = 0;
}
Edited by karri
  • Like 1
Link to comment
Share on other sites

  • 6 months later...

Here is an updated version of WAV2LSF with source and Windows .exe.

 

Changes:

- Added "-c" option that outputs the "LSF" sound data as a C file (.h or .c) (for easier workflow)

- Made it a bit more user-friendly w.r.t usage "help" and error messages

 

TODO:

- Handle 16-bit WAV files (as some audio editors can't output 8-bit WAV)

- Output "packed" sample data as C code

- Include C and ASM code for packed sample player

 

If needed, I can put it on my github.

 

Coming soon: Final version of my Bezerk clone, faster and now with VOICE! (hence the detour into "updating" WAV2LSF).

 

Credits to Bastian for the original WAV2LSF.

wav2lsf_1.1.zip

  • Like 2
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...