Blitter sound routine
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
Blitter sound routine
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 ?
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.
Re: Using blitter for sound mixing
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.
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.
Re: Using blitter for sound mixing
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!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 ?
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

d:m:l
Home: http://www.leonik.net/dml/sec_atari.py
AGT project https://bitbucket.org/d_m_l/agtools
BadMooD: https://bitbucket.org/d_m_l/badmood
Quake II p/l: http://www.youtube.com/playlist?list=PL ... 5nMm10m0UM
Home: http://www.leonik.net/dml/sec_atari.py
AGT project https://bitbucket.org/d_m_l/agtools
BadMooD: https://bitbucket.org/d_m_l/badmood
Quake II p/l: http://www.youtube.com/playlist?list=PL ... 5nMm10m0UM
- FedePede04
- Atari God
- Posts: 1216
- Joined: Fri Feb 04, 2011 12:14 am
- Location: Denmark
- Contact:
Re: Using blitter for sound mixing
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
sometime my English is a little weird, Google translate is my best friend

Re: Using blitter for sound mixing
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.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!
Re: Using blitter for sound mixing
Just to be sure I well understood your post DMLdml 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

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 ?

Re: Using blitter for sound mixing
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.
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.

d:m:l
Home: http://www.leonik.net/dml/sec_atari.py
AGT project https://bitbucket.org/d_m_l/agtools
BadMooD: https://bitbucket.org/d_m_l/badmood
Quake II p/l: http://www.youtube.com/playlist?list=PL ... 5nMm10m0UM
Home: http://www.leonik.net/dml/sec_atari.py
AGT project https://bitbucket.org/d_m_l/agtools
BadMooD: https://bitbucket.org/d_m_l/badmood
Quake II p/l: http://www.youtube.com/playlist?list=PL ... 5nMm10m0UM
- Mikefulton
- Captain Atari
- Posts: 169
- Joined: Sun Nov 29, 2015 10:27 am
Re: Using blitter for sound mixing
Despite the limitations I have to say it's a very clever idea!
Re: Using blitter for sound mixing
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)
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)
Re: Using blitter for sound mixing
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
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
Re: Using blitter for sound mixing
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...
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...
Re: Using blitter for sound mixing
I have just added some rasterization on STe here http://cyber.savina.net/sound.htm
(playing at 25khz and 50khz)


(playing at 25khz and 50khz)


Re: Using blitter for sound mixing
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

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

Re: Using blitter for sound mixing
... And of course managing small samples efficiently by looping for free.
Re: Using blitter for sound mixing
Tested on my STe 4mb, nice work Metalages 

Re: Using blitter for sound mixing
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

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

Re: Using blitter for sound mixing
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)
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)
Re: Using blitter for sound mixing
I have rebooted my experiments on a more traditional approach using standard protracker .mod format as input.
https://youtu.be/HgQVavtUOGI
https://youtu.be/HgQVavtUOGI
Re: Using blitter for sound mixing
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
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
Re: Using blitter for sound mixing
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

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 ? ^^
Re: Using blitter for sound mixing
Wow!! Amazing stuff, new ground. Hats off!
Ain't no space like PeP-space.
Re: Using blitter for sound mixing
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.

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.
Re: Using blitter for sound mixing
My idea was trying to do a screen with this routine and then putting the whole code on my github depot.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
Let's keep in touch about that
Re: Using blitter for sound mixing
Really great
.
Hats off [smilie=greencolorz4_pdt_01.gif] .

Hats off [smilie=greencolorz4_pdt_01.gif] .
Re: Using blitter for sound mixing
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?
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 ...!
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!