[comp.sys.atari.st.tech] How do you play Sound Samples ?

redmond+@cs.cmu.edu (Redmond English) (05/02/91)

How can I play digitised sound samples from a program ?  I've
downloaded a number of *.SND samples, and a program that plays them,
but I'd like to load them into my program and play them myself.

I can handle background tasks using interrupts, so I don't need
details of that, but what do I actually *do* with all those numbers ?

                       Thanks in advance,

                               Red/.

ZVD007@DMSWWU1C.BITNET (Ulrich Kuehn) (05/02/91)

In article <1991May2.012642.26008@cs.cmu.edu>, redmond+@cs.cmu.edu (Redmond
English) says:
>
>How can I play digitised sound samples from a program ?  I've
>downloaded a number of *.SND samples, and a program that plays them,
>but I'd like to load them into my program and play them myself.
>
>I can handle background tasks using interrupts, so I don't need
>details of that, but what do I actually *do* with all those numbers ?
>
These soundfiles contain 8-bit-sampled sounds with 0 as the lowest an 255 as th
e highest value. To play such a sound, you "only" have to use the internal
soundship as a D/A-converter. To do so, set all the delay-values in the registe
rs 0 to 5 of the soundship to 0 (the highest frequency it can play) an then
turn it off (it has really to be off, otherwise there are interferences in the
sound). Install then an interrupt-routine that gets every  time it's called a
byte from the soundfile (which hab been read somewhere into memory), then
converts it with a table, because the soundship has only 4 levelcontrolbits
per voice and it's not linear. You can get this table by analysing one off
those soundplayers while playing a sound, they often use the timer-a-interrupt.
There you can also see a playing routine. After converting, all you have to do,
is put the 3 values for the 3 voices into the right registers ( I think it's
8 to 11)

When using the DMA-sound of the STE, remember that these sounds range from
-128 to 127 (signed), so you have to convert them before playing.

U. Kuehn <zvd007@dmswwu1c.bitnet>

friedric@r2d2.fmi.uni-passau.de (Carsten Friedrich) (05/03/91)

In article <91122.134051ZVD007@DMSWWU1C.BITNET> ZVD007@DMSWWU1C.BITNET (Ulrich Kuehn) writes:
>In article <1991May2.012642.26008@cs.cmu.edu>, redmond+@cs.cmu.edu (Redmond
>English) says:
>>
>>How can I play digitised sound samples from a program ?  I've
>>downloaded a number of *.SND samples, and a program that plays them,
>>but I'd like to load them into my program and play them myself.
.
.
.
>is put the 3 values for the 3 voices into the right registers ( I think it's
>8 to 11)
>

if this doesn't help you, you can also have the source-code of a program doing this.
Just mail me if you want it and I'll send it to you. 

>When using the DMA-sound of the STE, remember that these sounds range from
>-128 to 127 (signed), so you have to convert them before playing.
>
>U. Kuehn <zvd007@dmswwu1c.bitnet>

I tried to produce DMA-sound on a STE, but failed. Can anyone give me some hints
how to do this ?

Carsten Friedrich, e-mail: friedric@unipas.fmi.uni-passau.de

ZVD007@DMSWWU1C.BITNET (Ulrich Kuehn) (05/06/91)

In article <1991May3.122558.5911@forwiss.uni-passau.de>,
friedric@r2d2.fmi.uni-passau.de (Carsten Friedrich) says:
>I tried to produce DMA-sound on a STE, but failed. Can anyone give me some    s
>hint
>how to do this ?
>
I think the problem is, that you dont have set the micro-wire-register
to enable the output of the analog signals, so the soundchip did its work,
but you didnt hear it.
Unfortunately, I dont have a STe myself, so I cant tell you more exactly
about that.

Ulrich Kuehn