sample playback doc

All 680x0 related coding posts in this section please.

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
fred76
Atari nerd
Atari nerd
Posts: 47
Joined: Mon Jul 28, 2008 5:30 pm

sample playback doc

Postby fred76 » Fri Sep 05, 2008 11:31 am

Is there any good document on how to playback samples in 68k?
I'm new at this technique so I don't know anything and a beginner's guide would be really helpful.

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5131
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: sample playback doc

Postby simonsunnyboy » Fri Sep 05, 2008 11:47 am

Ray / TSCC has a sample source on his webpage. however he entirely omits how to program a Timer interrupt properly (which can be a problem for the newcomer).
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
Mug UK
Administrator
Administrator
Posts: 11422
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: sample playback doc

Postby Mug UK » Fri Sep 05, 2008 12:04 pm

I've got some source code somewhere from a sampled demo - will upload it later on tonight if still needed.
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

User avatar
fred76
Atari nerd
Atari nerd
Posts: 47
Joined: Mon Jul 28, 2008 5:30 pm

Re: sample playback doc

Postby fred76 » Fri Sep 05, 2008 12:58 pm

muguk wrote:I've got some source code somewhere from a sampled demo - will upload it later on tonight if still needed.

Any demo/help is welcome.

User avatar
Mug UK
Administrator
Administrator
Posts: 11422
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: sample playback doc

Postby Mug UK » Fri Sep 05, 2008 5:46 pm

Several pages to help you out:

Ray's 16/32 bits - http://freenet-homepage.de/ray.tscc/samples.htm (also has a link to An Cool's page at http://home.earthlink.net/~chhome/tcbtracker.html)

And this attachment (open it up in STEEM and copy the files onto your virtual STEEM h/drive to make them easier to read on your PC/MAC) is a simple guide to demo coding by James Ingram and includes sample replay on a stock ST and STE machine.
You do not have the required permissions to view the files attached to this post.
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

User avatar
fred76
Atari nerd
Atari nerd
Posts: 47
Joined: Mon Jul 28, 2008 5:30 pm

Re: sample playback doc

Postby fred76 » Fri Sep 05, 2008 9:49 pm

This is very good stuff to start with. James Ingram rules !
And so do you guys...
Thanks

User avatar
fred76
Atari nerd
Atari nerd
Posts: 47
Joined: Mon Jul 28, 2008 5:30 pm

Re: sample playback doc

Postby fred76 » Fri Sep 05, 2008 10:05 pm

Another question, since I need AVR format.
My copy of 525 (v211) seems to hang whenever I try to convert samples.
Is this a known problem ?
Do I need another program ?

User avatar
Mug UK
Administrator
Administrator
Posts: 11422
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: sample playback doc

Postby Mug UK » Fri Sep 05, 2008 11:20 pm

Use Soundlab instead?
You do not have the required permissions to view the files attached to this post.
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

User avatar
fred76
Atari nerd
Atari nerd
Posts: 47
Joined: Mon Jul 28, 2008 5:30 pm

Re: sample playback doc

Postby fred76 » Sat Sep 06, 2008 11:14 am

Soundlab only seems to work from Drive A (or B), not from harddisk.
I'll try to find a windows convertor.
Any more suggestions ?
What do you guys use to convert ?

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5131
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: sample playback doc

Postby simonsunnyboy » Sat Sep 06, 2008 2:53 pm

I had good success with 525 i the past...this converts many sound sampel formats to others.
It might be a tad slow on a plain ST (or even standard Falcon) but it is pretty straight forward to use.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
Mug UK
Administrator
Administrator
Posts: 11422
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: sample playback doc

Postby Mug UK » Sat Sep 06, 2008 9:28 pm

fred76 wrote:Soundlab only seems to work from Drive A (or B), not from harddisk.
I'll try to find a windows convertor.
Any more suggestions ?
What do you guys use to convert ?


Strange as that's a copy RAR'd up from my emulated STEEM drive C:
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

User avatar
fred76
Atari nerd
Atari nerd
Posts: 47
Joined: Mon Jul 28, 2008 5:30 pm

Re: sample playback doc

Postby fred76 » Sat Sep 06, 2008 11:05 pm

It works fine under Steem ! 525 also works fine under Steem.
I'll never use WinSTon again !
I also wrote a little program that converts raw pcm 8 bits to AVR.
runs under windows.
If anyone might be interested I will post it as soon as I polished it.

User avatar
Mug UK
Administrator
Administrator
Posts: 11422
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Re: sample playback doc

Postby Mug UK » Sun Sep 07, 2008 8:51 am

The muso's on here would love a batch tool that downsamples stereo 44Khz WAV or MP3 samples into single channel 8-bit raw samples :)

Had to do them a folder at a time when I converted a few for Marcer last year .. would be nice to point a tool like above at a folder and say "off you go" and it converts the lot!
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

User avatar
nativ
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4106
Joined: Mon Jul 30, 2007 10:26 am
Location: South West, UK

Re: sample playback doc

Postby nativ » Sun Sep 07, 2008 9:05 am

Hi,
Aniplayer will load MP3 and save Avr.
If I recall . . . .

Thanks
Atari STFM 512 / STe 4MB / Mega ST+DSP / Falcon 4MB 16Mhz 68882 - DVD/CDRW/ZIP/DAT - FDI / Jaguar / Lynx 1&2 / 7800 / 2600 / XE 130+SD Card // Sega Dreamcast / Mega2+CD2 // Apple G4

http://soundcloud.com/nativ ~ http://soundcloud.com/nativ-1 ~ http://soundcloud.com/knot_music
http://soundcloud.com/push-sounds ~ http://soundcloud.com/push-records

User avatar
bod/STAX
Atari Super Hero
Atari Super Hero
Posts: 508
Joined: Wed Nov 24, 2004 8:13 pm
Location: Halesowen, West Midlands, England

Re: sample playback doc

Postby bod/STAX » Mon Sep 08, 2008 5:03 pm

I used to use a program called NoiseMaster on the PC. You can resample your samples into any frequency,
which is ideal for convertivng .WAV files to your ST. If you do a quick Google search you can find a few
programs to convert MP3's to .WAV.

Here's the program, along with the source code to the Megabang demo for replaying samples on the ST:
You do not have the required permissions to view the files attached to this post.
So let it be written, So let it be done. I'm sent here by the chosen one.

User avatar
fred76
Atari nerd
Atari nerd
Posts: 47
Joined: Mon Jul 28, 2008 5:30 pm

Re: sample playback doc

Postby fred76 » Mon Sep 08, 2008 11:02 pm

Nice demo. Looked into the code and can really learn from it as it uses MFP.
Might crash the ST a thousand times by trying, just like the good old days.

muguk wrote:The muso's on here would love a batch tool that downsamples stereo 44Khz WAV or MP3 samples into single channel 8-bit raw samples :)
.. would be nice to point a tool like above at a folder and say "off you go" and it converts the lot!


If you have a nice algorithm for 44k1 16-bit WAV to 8-bit whatever freq.(<30k) I will think about it.
...Actually, I am thinking about it. Would be a nice tool !

User avatar
unseenmenace
Atari God
Atari God
Posts: 1961
Joined: Tue Sep 21, 2004 9:33 pm
Location: Margate, Kent, UK
Contact:

Re: sample playback doc

Postby unseenmenace » Mon Jan 19, 2009 5:14 pm

I don't know if you started a conversion tool but a fast and simple method would be the following:-

Convert from 16-bit to 8-bit by discarding the least significant 8 bits (i.e. just take the most significant byte).
Then reduce to simple fractions like 3/4, 2/3, 1/2, 1/3 or 1/4 frequency by skipping bytes or taking averages of each few bytes.
Its worth noting that 1/3 of 44.1KHz (CD playback frequency) is a little under 15KHz which is the frequency you get if you synchronise sample playback with scanline redraw (At 50Hz/PAL) which is useful if you want to play samples alonside rasters/plasmas/fullscreens etc.
You may want to convert to unsigned format as this is best for playback via the ST's YM2149 sound chip. I believe this is just a case of adding 128 to each signed byte.
UNSEEN MENACE
Several STFM's, 4MB STE, 2MB TT with 1.2GB Hard Drive and 14MB Falcon with 540MB Hard Drive,
Lynx 2 and Jaguar with JagCD
Member of GamebaseST and AtariLegend team
Check out my website at http://unseenmenace.110mb.com

ppera

Re: sample playback doc

Postby ppera » Mon Jan 19, 2009 5:41 pm

unseenmenace wrote:...
Convert from 16-bit to 8-bit by discarding the least significant 8 bits (i.e. just take the most significant byte).
Then reduce to simple fractions like 3/4, 2/3, 1/2, 1/3 or 1/4 frequency by skipping bytes or taking averages of each few bytes.
Its worth noting that 1/3 of 44.1KHz (CD playback frequency) is a little under 15KHz which is the frequency you get if you synchronise sample playback with scanline redraw (At 50Hz/PAL) which is useful if you want to play samples alonside rasters/plasmas/fullscreens etc.
You may want to convert to unsigned format as this is best for playback via the ST's YM2149 sound chip. I believe this is just a case of adding 128 to each signed byte.


I tried with averaging in sample playback of 25033 KHz signed sample (for STE), for playback via YM (PSG) with half sample rate. So, averaged 2 neighbout values and sent result to lookup table. But sound was very bad. It is unexpected, I think. Don't know reason, really. Lookup table is for signed values (probably there are for non-signed too).
Hmm... maybe averaging signed value is not same as non-signed ? 50 + 80 = 130 . /2 =65 average. In signed values it would be: 178+208=386. 386/2=193. 193-128=65 . Matches. So theory and practice is not same here.... Or I made some dumb bug in simple rutine ?

User avatar
oberje
Atari freak
Atari freak
Posts: 58
Joined: Sat Jan 10, 2009 2:38 pm
Location: Sussex, UK
Contact:

Re: sample playback doc

Postby oberje » Mon Mar 16, 2009 8:22 am

For 2:1 downsampling, you're better off just dropping the extra samples. Ideally you'd first pass the sample through a filter to band-limit it, but that's not viable on an ST in realtime!

If you're still looking for a good batch process to downconvert wavs to ST playback ranges, on the PC, sox is a good bet, it does decent resampling.

Cheers,
oberje


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 4 guests