Jump to content

Photo

Has anybody played around with digitized sound?


14 replies to this topic

#1 Wookie OFFLINE  

Wookie

    Chopper Commander

  • 199 posts
  • Location:Las Vegas, NV

Posted Wed Feb 26, 2014 11:04 AM

I just saw the youtube video showing the Simpson's digitized sound demo and I was wondering how it was done.  Has anybody played around with digitized sound effects on the Lynx?

 

-wookie



#2 LX.NET OFFLINE  

LX.NET

    Dragonstomper

  • 766 posts
  • Location:The Netherlands

Posted Wed Feb 26, 2014 5:00 PM

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/...s-for-the-lynx/



#3 GadgetUK OFFLINE  

GadgetUK

    Stargunner

  • 1,946 posts
  • Location:UK

Posted Fri Mar 14, 2014 2:05 PM

I am interested in this as well.

#4 enthusi OFFLINE  

enthusi

    Dragonstomper

  • 537 posts
  • Location:Potsdam, Germany

Posted Tue Aug 21, 2018 8:39 AM

A bit off date but on topic :)

http://atariage.com/...fx-to-swing-to/



#5 42bs OFFLINE  

42bs

    Moonsweeper

  • 312 posts
  • Location:Germany/Southest West

Posted Tue Aug 21, 2018 10:16 AM

A bit off date but on topic :)

http://atariage.com/...fx-to-swing-to/

 

Well, the dragnet demo :-) And BLL contains playback routines for packed and unpacked digi sound.



#6 enthusi OFFLINE  

enthusi

    Dragonstomper

  • 537 posts
  • Location:Potsdam, Germany

Posted Tue Aug 21, 2018 11:29 AM

Yes, of course. This is only great (to me) since it is my code/player/converter :-)

I enjoy coding the most, when all parts are my own. So no external libs/tools (to some extent at least).



#7 LordKraken OFFLINE  

LordKraken

    Chopper Commander

  • 150 posts
  • Location:Sverige

Posted Tue Aug 21, 2018 1:18 PM

 

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!



#8 42bs OFFLINE  

42bs

    Moonsweeper

  • 312 posts
  • Location:Germany/Southest West

Posted Tue Aug 21, 2018 1:51 PM

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


#9 Irgendwer OFFLINE  

Irgendwer

    Stargunner

  • 1,466 posts
  • Location:Germany

Posted Thu Aug 30, 2018 4:24 PM

The problem is: I cannot find the packer anymore :(

 

You mean this one:

 

Attached File  WAV2LSF.ZIP   3.37KB   64 downloads

 

?



#10 sage OFFLINE  

sage

    Dragonstomper

  • 994 posts
  • Location:Germany

Posted Fri Aug 31, 2018 5:45 AM

does a mod player count as digital sound?



#11 karri OFFLINE  

karri

    River Patroller

  • 2,636 posts
  • Location:Espoo, Finland

Posted Fri Aug 31, 2018 5:58 AM

In Always winter, never Christmas you can choose Elvis in the bar. He will sing Jailhouse rock as digitized sound at 4kHz.

#12 LordKraken OFFLINE  

LordKraken

    Chopper Commander

  • 150 posts
  • Location:Sverige

Posted Fri Aug 31, 2018 7:16 AM

Can someone explain to me how to create sample at 4khz?

I can't go under 8khz mono, which leads to playing time of a just a couple of seconds with my 8kb buffer :(


Edited by LordKraken, Fri Aug 31, 2018 7:16 AM.


#13 karri OFFLINE  

karri

    River Patroller

  • 2,636 posts
  • Location:Espoo, Finland

Posted Fri Aug 31, 2018 8:37 AM

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, Fri Aug 31, 2018 10:30 AM.

  • jum likes this

#14 jum OFFLINE  

jum

    Chopper Commander

  • 126 posts
  • Location:Cape Town

Posted Mon Mar 25, 2019 7:48 AM

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.

Attached Files



#15 LordKraken OFFLINE  

LordKraken

    Chopper Commander

  • 150 posts
  • Location:Sverige

Posted Tue Mar 26, 2019 2:24 AM

Thanks Jum, will give it a try!


  • jum likes this




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users