Blitter sound routine

GFA, ASM, STOS, ...

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

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Blitter sound routine

Postby metalages » Sun Jan 03, 2016 8:31 pm

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

Postby AtariZoll » Sun Jan 03, 2016 8:55 pm

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: 3472
Joined: Sat Jun 30, 2012 9:33 am

Re: Using blitter for sound mixing

Postby dml » Sun Jan 03, 2016 9:08 pm

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 :)

FedePede04
Atari God
Atari God
Posts: 1072
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Using blitter for sound mixing

Postby FedePede04 » Sun Jan 03, 2016 9:53 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Sun Jan 03, 2016 10:12 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Mon Jan 04, 2016 3:29 pm

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: 3472
Joined: Sat Jun 30, 2012 9:33 am

Re: Using blitter for sound mixing

Postby dml » Mon Jan 04, 2016 6:49 pm

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

Postby Mikefulton » Tue Jan 05, 2016 12:23 pm

Despite the limitations I have to say it's a very clever idea!

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Tue Jan 05, 2016 11:14 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Mon Apr 11, 2016 6:47 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Mon Apr 18, 2016 4:31 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Wed Apr 20, 2016 10:14 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Wed Apr 20, 2016 10:28 pm

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Thu Apr 21, 2016 5:45 am

... And of course managing small samples efficiently by looping for free.

MM41
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 108
Joined: Sun Jun 28, 2015 2:36 pm
Location: France

Re: Using blitter for sound mixing

Postby MM41 » Thu Apr 21, 2016 7:43 pm

Tested on my STe 4mb, nice work Metalages :D

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Fri Apr 22, 2016 7:14 am

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Mon Jun 20, 2016 8:33 am

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Thu Mar 29, 2018 9:19 pm

I have rebooted my experiments on a more traditional approach using standard protracker .mod format as input.
https://youtu.be/HgQVavtUOGI

User avatar
Cyprian
Atari God
Atari God
Posts: 1518
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Using blitter for sound mixing

Postby Cyprian » Thu Mar 29, 2018 9:54 pm

sounds cool, especially distortion
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Steem SSE / Aranym / Saint
http://260ste.appspot.com/

User avatar
ggn
Atari God
Atari God
Posts: 1208
Joined: Sat Dec 28, 2002 4:49 pm

Re: Using blitter for sound mixing

Postby ggn » Fri Mar 30, 2018 5:27 am

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: 952
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Using blitter for sound mixing

Postby shoggoth » Fri Mar 30, 2018 7:59 am

Wow!! Amazing stuff, new ground. Hats off!
Ain't no space like PeP-space.

User avatar
metalages
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Fri Mar 30, 2018 9:25 am

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
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Thu Jun 06, 2013 5:14 pm
Location: France
Contact:

Re: Using blitter for sound mixing

Postby metalages » Fri Mar 30, 2018 9:42 am

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: 2619
Joined: Thu Dec 15, 2005 2:15 am

Re: Using blitter for sound mixing

Postby Maartau » Fri Mar 30, 2018 1:18 pm

Really great :thumbs: .

Hats off [smilie=greencolorz4_pdt_01.gif] .

User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2407
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: Using blitter for sound mixing

Postby charles » Fri Mar 30, 2018 1:59 pm

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 ...!


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 5 guests