English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 30 March 2018, 16:10   #1
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,348
Using blitter for sound mixing?

I found a post by Gibs on Atari-forum where he has been experimenting with mixing and modulating samples using the STe blitter. Is this applicable on the Amiga, and does it have any useful applications?
http://cyber.savina.net/sound.htm
idrougge is offline  
Old 30 March 2018, 16:16   #2
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,016
Quote:
Originally Posted by idrougge View Post
I found a post by Gibs on Atari-forum where he has been experimenting with mixing and modulating samples using the STe blitter. Is this applicable on the Amiga, and does it have any useful applications?
http://cyber.savina.net/sound.htm
Pretty sure this is how all more than 4 channel audio replayers work by using the blitter.

TFMX 7 channel, Star Trekker and others
Galahad/FLT is offline  
Old 30 March 2018, 16:27   #3
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,348
Oh, I always thought they used the CPU for mixing.
idrougge is offline  
Old 30 March 2018, 16:32   #4
frank_b
Registered User
 
Join Date: Jun 2008
Location: Boston USA
Posts: 466
Quote:
Originally Posted by idrougge View Post
I found a post by Gibs on Atari-forum where he has been experimenting with mixing and modulating samples using the STe blitter. Is this applicable on the Amiga, and does it have any useful applications?
http://cyber.savina.net/sound.htm
Bear in mind the Atari blitter has an indirect addressing mode and 16 word look up table built in. That can be combined that with first/middle/last word masks protecting selected bits in the destination during translation. That allows 0-4 bit to any 16 bit value translations on the fly. That's how he's able to do volume variation and other translation effects. The same feature can be used for graphics operations. 1-2x-4x-8x-16x scaling on the x or hflipping a raster in four passes. I'm not sure some of it is applicable to the Amiga blitter. It's a major difference between them. Paula has built in mixing of voices, frequency and volume variation per channel anyway
frank_b is offline  
Old 30 March 2018, 18:23   #5
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
Quote:
Originally Posted by Galahad/FLT View Post
Pretty sure this is how all more than 4 channel audio replayers work by using the blitter.

TFMX 7 channel, Star Trekker and others
All the mixing code i've seen so far used nothing but the cpu.
meynaf is offline  
Old 30 March 2018, 18:30   #6
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
I do not think it's possible to create a fast mixer with the blitter (if you want it anyway a really slow one can be made..).
At least not the classic (fast) one made with linear ADD in the same frequency domain.
And I can not think of a quick way to use blitter for a linear interpolation oversample usage..

At least you could create a blitter interlaced mixer (one byte of a sample followed temporally from that of another sample), but qualitywise is a no-no.
Or prepare a downward shift of the sample in real time and then cpu add without clip.
ross is offline  
Old 30 March 2018, 18:42   #7
frank_b
Registered User
 
Join Date: Jun 2008
Location: Boston USA
Posts: 466
He's using the halftone/smudge mode for some free effects in real time. Looks like it maxes out at 16% CPU time. Impressive!!!
[ Show youtube player ]
frank_b is offline  
Old 30 March 2018, 18:57   #8
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
Well, so apparently it's not for sound mixing but for applying quick'n'dirty sound effects. I'm not impressed.
meynaf is offline  
Old 30 March 2018, 20:02   #9
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,033
Quote:
Originally Posted by meynaf View Post
Well, so apparently it's not for sound mixing but for applying quick'n'dirty sound effects. I'm not impressed.
This is the only one known me Amiga module, which used blitter for synth samples manipulations:
http://aminet.net/package/mods/misc/CriticalsPromo
Second known me Amiga music, used blitter for sample depacking only.
http://aminet.net/package/mods/cust/SpaceAcedemo
Don_Adan is offline  
Old 31 March 2018, 17:54   #10
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,652
Manipulation and unpacking isn't mixing, tho. The Blitter ALU can be used in passes for arithmetic operations, the problem is the carry. It would likely also need the instruments to change from sampled waves to something prepared for mixing. Typically, a proof of concept used in a demo is not usable in the general case. Finally, it must also sound almost-as-good as the one wave per hardware channel version. That's the real trick
Photon is offline  
Old 22 December 2022, 22:59   #11
metalages
Registered User
 
Join Date: Dec 2022
Location: France
Posts: 4
Quote:
Originally Posted by meynaf View Post
Well, so apparently it's not for sound mixing but for applying quick'n'dirty sound effects. I'm not impressed.

I use the Blitter for mixing Bit decimation is an optional bonus stuff provided by halftone registers while copy is done.
Of course the STe hardware is basic and the routine is very constraining as explained here https://github.com/jhubrt/demOS/tree...r/DOCS/BLITSnd


Retrocomputing is about playing with contraints, and probably programming on the Atari ST has always been about that too


Here is what we have managed to release using this routine thanks to Dok talent [ Show youtube player ]
metalages is offline  
Old 23 December 2022, 00:29   #12
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,652
Quote:
Originally Posted by metalages View Post
Here is what we have managed to release
ST(e) can sort of do samples, and under some circumstances, it can do scrolling, too.

Your readme puts some tighter requirements for running it at all, though. E.g. beyond 1040 STe, 520 STe can't run it as I understand it and you have to set it up just so. Please correct me with exact platform target.

In this topic, the question was asked if the more capable Blitter of the Amiga could even substitute for the CPU in proper software mixing. This however requires arithmetic and carry. (For any Blitter including the simplistic ones on some PC graphics cards, and they didn't really get any less simplistic with time either).

Thus far objectivity.

If you are posing this against Amiga, know that you are competing with 1990 CPU 8-channel mixing, and as we know the 7-channel SMFX, launched not as a limited special-case proof of concept, but to solve the problem of music+SFX with a game using the hardware fully at the same time. [ Show youtube player ]
Photon is offline  
Old 23 December 2022, 04:58   #13
saimon69
J.M.D - Bedroom Musician
 
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,590
I thought the first turrican did not have the 7-channel mixing routine, the second one for sure do
saimon69 is offline  
Old 23 December 2022, 07:26   #14
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,929
Quote:
Originally Posted by saimon69 View Post
I thought the first turrican did not have the 7-channel mixing routine, the second one for sure do
It does not: https://www.exotica.org.uk/wiki/TFMX_7V
TCD is online now  
Old 23 December 2022, 08:25   #15
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,449
The 7-voice mixing routine used in TFMX 7V was written by Jochen Hippel of Thalion who did the arrangements for the Atari ST version of Turrican I & II. It was also used in Lethal Xcess and Amberstar.
alexh is offline  
Old 23 December 2022, 08:34   #16
metalages
Registered User
 
Join Date: Dec 2022
Location: France
Posts: 4
Quote:
Originally Posted by Photon View Post
If you are posing this against Amiga, know that you are competing with 1990 CPU 8-channel mixing, and as we know the 7-channel SMFX, launched not as a limited special-case proof of concept, but to solve the problem of music+SFX with a game using the hardware fully at the same time. [ Show youtube player ]

Nope i was just answering to the comment saying the blitter was just used as a post process for bit decimation which is not the case. Also with compliant composition it is not so specific as that.



I am curious on how the more than 4 voices are usuallly implemented on amiga ? From what I understand Paula can get its data from 4 places in memory at variable pace. In case of more than 4 voice does it mean some of the voice run at fixed freq + cpu mixing ?

A long time ago i have heard amiga blitter has a bresenham engine. Is it the case ?
metalages is offline  
Old 23 December 2022, 08:44   #17
metalages
Registered User
 
Join Date: Dec 2022
Location: France
Posts: 4
Quote:
Originally Posted by alexh View Post
The 7-voice mixing routine used in TFMX 7V was written by Jochen Hippel of Thalion who did the arrangements for the Atari ST version of Turrican I & II. It was also used in Lethal Xcess and Amberstar.

Whaou i was not aware mad max wrote this kind of routine on amiga
metalages is offline  
Old 23 December 2022, 08:46   #18
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by metalages View Post
In case of more than 4 voice does it mean some of the voice run at fixed freq + cpu mixing ?
Yes, in case of 7-voices TFMX one channel with fixed frequency gets four cpu mixed sources and 3 channels are free for normal playback.
But there are other players who behave differently.

Quote:
A long time ago i have heard amiga blitter has a bresenham engine. Is it the case ?
Yes, but the engine is not exposed. So only a destination pointer is calculated and pre-defined data is used for line mode.
ross is offline  
Old 23 December 2022, 11:07   #19
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,436
Quote:
Originally Posted by Photon View Post
If you are posing this against Amiga, know that you are competing with 1990 CPU 8-channel mixing, and as we know the 7-channel SMFX, launched not as a limited special-case proof of concept, but to solve the problem of music+SFX with a game using the hardware fully at the same time. [ Show youtube player ]
The 7-channel TFMX routine is not used during gameplay (only for the title and perhaps the outro/high score - but not sure about those), it just plays 4 voices as normal. The TFMX modules mostly only use 3 channels (there's one tiny bit that uses 4 channels, but that is played when no SFX can play so it works out). SFX gets played on the free channel. Some other music channels get cut out when there's more than one simultaneous SFX playing back.
roondar is offline  
Old 23 December 2022, 11:29   #20
no9
Registered User
 
no9's Avatar
 
Join Date: Feb 2018
Location: Poland
Posts: 362
To add to what Roondar said we can clearly hear in the Turrican 2 credits how mixing quality is downgraded every time the player character appears and gets back to higher mixing samplerate when there is only text displayed on the screen. During full gameplay software mixing was to much [ Show youtube player ]
no9 is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sound samples sound pitched down when imported to Amos Brick Nash Coders. AMOS 5 24 September 2017 21:52
Turrican 2 with replayer patched to use 28khz mixing? Dr.Venom project.WHDLoad 3 05 December 2016 07:50
Blitter busy flag with blitter DMA off? NorthWay Coders. Asm / Hardware 9 23 February 2014 21:05
Sound is muffled after boot until change of settings - sound filter emulation issue? rsn8887 support.WinUAE 1 30 May 2010 20:44
Mixing Retr0Bright safely without a blender? mancalledSun support.Hardware 3 04 February 2010 19:45

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:10.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11174 seconds with 13 queries