Blitter sound routine

GFA, ASM, STOS, ...

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

User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Blitter sound routine

Post by metalages »

I shared some ideas here about using blitter for 2 pcm channels sound mixing here :
http://cyber.savina.net/sound.htm

... and also some proto code here :
https://github.com/gibs75/demOS

What do you think ?
Last edited by metalages on Tue Jun 19, 2018 8:04 pm, edited 1 time in total.
AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2978
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Using blitter for sound mixing

Post by AtariZoll »

Interesting idea. But I don't think that on STE we have much possibilities, because it is slow for any serious processing of audio data.
As title says "mixing" it reminds me that I spent some time for code what mixing background music and sound effects. Would be good if blitter could make it faster.
Famous Schrodinger's cat hypothetical experiment says that cat is dead or alive until we open box and see condition of poor animal, which deserved better logic. Cat is always in some certain state - regardless from is observer able or not to see what the state is.
User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3954
Joined: Sat Jun 30, 2012 9:33 am

Re: Using blitter for sound mixing

Post by dml »

metalages wrote:I shared some ideas here about using blitter for 2 pcm channels sound mixing here :
http://cyber.savina.net/sound.htm

... and also some proto code here :
https://github.com/gibs75/demOS

What do you think ?
Interesting. I also found it wasn't much use for adding - but if you move the aim from real-world samples towards YM-like synthesis from short waveforms then you can do a few interesting things. e.g. using smudge + halftone to perform modulation effects on 4-bit 'samples' - or perhaps more interestingly - on the most significant bits of 16-bit samples!

I've mostly been working with 8->16bit samples on F030 so it's not that much use to me in this form but I think there is room to explore more here. Good stuff. Keep investigating :)
User avatar
FedePede04
Atari God
Atari God
Posts: 1216
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Using blitter for sound mixing

Post by FedePede04 »

what a great idea, keep it up the good work
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

dml wrote: Interesting. I also found it wasn't much use for adding - but if you move the aim from real-world samples towards YM-like synthesis from short waveforms then you can do a few interesting things. e.g. using smudge + halftone to perform modulation effects on 4-bit 'samples' - or perhaps more interestingly - on the most significant bits of 16-bit samples!
Yep. Using small synthetized samples are possible as the blitter loops for free ; also it would prevent from excessive memory usage due to the need of pre-transposing samples for semi-tones.
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

dml wrote: Interesting. I also found it wasn't much use for adding - but if you move the aim from real-world samples towards YM-like synthesis from short waveforms then you can do a few interesting things. e.g. using smudge + halftone to perform modulation effects on 4-bit 'samples' - or perhaps more interestingly - on the most significant bits of 16-bit samples!

I've mostly been working with 8->16bit samples on F030 so it's not that much use to me in this form but I think there is room to explore more here. Good stuff. Keep investigating :)
Just to be sure I well understood your post DML :)

You mean using smudge mode with HOP = 3 to combine two waves with an AND operation :
- the source wave (8 bits resolution)
- a second wave with 4 bits resolution that address value set in the halftone

Am I right ? :D
User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3954
Joined: Sat Jun 30, 2012 9:33 am

Re: Using blitter for sound mixing

Post by dml »

Sort of - the smudge provides a 4-bit indexing operation on the source, so you can fill the 16 words of halftone with any translation (e.g. invert 0->15, punch holes in the table at certain volumes, or make a saw/ramp with it) and then use scroll to access the bits in the sample you want to translate, and endmask to replace just the bits of interest. I was thinking about pointing source/dest at the same sample, but separating them would let you combine two samples in a limited way.

But it seems that you can do a variety of even stranger things with this. Since the halftone table is indexed with the y (line) field, you could use x:y inc ratios to scroll the translation - which gives you another (sortof) waveform period for the translation. A bit like what you describe on your page re: periods for short samples except using indirection via halftone ops.

Of course none of this maps to typical audio mixing/processing steps and it's probably hard to find combinations that make useful sounds. :-) Still it looks fun to explore.
User avatar
Mikefulton
Captain Atari
Captain Atari
Posts: 169
Joined: Sun Nov 29, 2015 10:27 am

Re: Using blitter for sound mixing

Post by Mikefulton »

Despite the limitations I have to say it's a very clever idea!
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

I have updated the page here http://cyber.savina.net/sound.htm and have a link to the PC executable version of the prototype (at the bottom of the page). In case you want to give it a try...
Same code takes an age to generate samples on STe (even under emulators at full speed) for the moment but then it mainly works the same way.
Of course currently these samples are not interesting in musical terms :)
The channel 2 features the dynamic use of halftone to mask less significant bits.
Currently it does not demonstrate the use of bitshift to change volume (but this can be used in the prototype)
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

New version of the prototype : to allow experimentations by musicians without coding, the new prototype use a script files + samples instead of generated sounds.
Documentation into the script (SYNTH.INI)

Links here: http://cyber.savina.net/sound.htm
PC executable here: http://cyber.savina.net/synthsound/synthsound_proto.zip
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

The prototype now runs on STe (tested on my 2mb STe) and PC. New version submitted (sources are on github).

STe + PC executables are here: http://cyber.savina.net/synthsound/synthsound_proto.zip
Links here: http://cyber.savina.net/sound.htm

This prototype is a proof of concept => its allows to experiment with your own samples to see if something interesting is possible with this approach.
Just edit SYNTH.INI script file and add / modify your samples.
Current script + samples are designed to be similar with my first prototype (1st proto was working with generated sounds).

Currently DMA runs at 50khz. It is possible to save CPU and memory using 25khz...
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

I have just added some rasterization on STe here http://cyber.savina.net/sound.htm
(playing at 25khz and 50khz)

Image
Image
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

And the optional effects you have for free from the same sample are :

- decimate bits with half pattern mask
- shift bit (reduce volume)
- octave transpose

Image
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

... And of course managing small samples efficiently by looping for free.
MM41
Captain Atari
Captain Atari
Posts: 154
Joined: Sun Jun 28, 2015 2:36 pm
Location: France

Re: Using blitter for sound mixing

Post by MM41 »

Tested on my STe 4mb, nice work Metalages :D
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

Thank you :)
It is a proof of concept more than a tool for the moment.
Anyway the new version with script and samples allows some user experimentations ;)
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

Dok told me to look at wavetables synth to get some ideas.
For example: https://www.youtube.com/watch?v=R2Ka3wJgwIk

As you can change the sustain sample on the fly without restarting the sound (W => ; keys on AZERTY keyboard)
it would be possible to create a set of pre-interpolated waves.

In the provided test, this is the case for the first sound (3 samples can be choosen as sustain on the fly)
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

I have rebooted my experiments on a more traditional approach using standard protracker .mod format as input.
https://youtu.be/HgQVavtUOGI
User avatar
Cyprian
10 GOTO 10
10 GOTO 10
Posts: 2815
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Using blitter for sound mixing

Post by Cyprian »

sounds cool, especially distortion
Lynx I / Mega ST 1 / 7800 / Portfolio / Lynx II / Jaguar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
DDD HDD / AT Speed C16 / TF536 / SDrive / PAK68/3 / Lynx Multi Card / LDW Super 2000 / XCA12 / SkunkBoard / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.atari.org
User avatar
ggn
Atari God
Atari God
Posts: 1260
Joined: Sat Dec 28, 2002 4:49 pm

Re: Using blitter for sound mixing

Post by ggn »

This is absolutely great! Great work metalages, and IMO much more interesting than the usual what-happens-when-you-flip-this-shifter-bit-at-exactly-29.3-cycles-from-the-vbl-and-it-totally-works-in-my-machine-yours-is-bad-boooo kind of research that people usually do with the ST/E :).

Also, I do have some projects in the pipeline that could benefit from such a sound routine so thanks for sharing this :)
is 73 Falcon patched atari games enough ? ^^
User avatar
shoggoth
Nature
Nature
Posts: 1268
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Using blitter for sound mixing

Post by shoggoth »

Wow!! Amazing stuff, new ground. Hats off!
Ain't no space like PeP-space.
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

Thanks for your kind words :)

I have huge respect for the reverse engineering work some people do, but it is not my stuff indeed ;)
I prefer trying new stuffs. Even on a small machine like the STe some stuffs have not been tried yet.
User avatar
metalages
Captain Atari
Captain Atari
Posts: 330
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Post by metalages »

ggn wrote:This is absolutely great! Great work metalages, and IMO much more interesting than the usual what-happens-when-you-flip-this-shifter-bit-at-exactly-29.3-cycles-from-the-vbl-and-it-totally-works-in-my-machine-yours-is-bad-boooo kind of research that people usually do with the ST/E :).

Also, I do have some projects in the pipeline that could benefit from such a sound routine so thanks for sharing this :)
My idea was trying to do a screen with this routine and then putting the whole code on my github depot.
Let's keep in touch about that
Maartau
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2632
Joined: Thu Dec 15, 2005 2:15 am

Re: Using blitter for sound mixing

Post by Maartau »

Really great :thumbs: .

Hats off [smilie=greencolorz4_pdt_01.gif] .
User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2989
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: Using blitter for sound mixing

Post by charles »

any chance youll adapt midi as the file format ?
have loaded spl/wav triggered via midi notes ..?
I guess like gadjits seq one and other commercial tracker/sequeners for Atari?
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!
Post Reply

Return to “Coding”