03 October 2013, 10:04 | #21 |
2 contact me: email only!
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,187
|
I know very little about audio but just wondering if any software ever "cheated" by having anything played on one of the channels having an identical sampling rate/frequency to allow very fast mixing?
If the sound effects for a game were all tuned to the same frequency as whatever else you played on that channel, presumably you could do something simple like add the 2 samples together and divide by 2 (with a shift), or maybe just use the highest value? You'd get 5 channels that way, very easy computationally and you could "merge" in sound effects with the music as long as it was a drum or something on that channel. Would that work? |
03 October 2013, 14:21 | #22 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
I remember reading the docs of a sound effects engine that worked that way, years ago, but I never tried it out.
|
07 December 2014, 17:28 | #23 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
so there is more insight from Chris Huelsbeck today about how the 7 voice routine works
[ Show youtube player ] how it came about, Jochen Hippel wrote a TFMX player for the Atari ST, that did software mixing to produce all four channels from one output, essentially emulating the Amiga's sound. Chris then took the source code for that back to the Amiga. So there are four channels software mixed into a single channel, with the remaining 3 as native Amiga channels! |
07 December 2014, 19:21 | #24 |
Global Caturator
Join Date: Aug 2004
Location: Porando
Age: 43
Posts: 6,108
|
Any time stamps? This thing's long...
|
07 December 2014, 20:09 | #25 | |
Registered User
Join Date: Jan 2012
Location: USA
Posts: 373
|
Quote:
A pair of articles in November 1983 and December 1983 give theory and source code. The player uses fixed point arithmetic and multiplication to give four voices. The assembly is fairly easy to understand. |
|
08 December 2014, 19:42 | #26 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
sorry, i finished listening to the whole thing before i thought to post about it here. but fortunately i remembered correctly, if you skip ahead to the 20 minutes mark, he talks about it for about 5 minutes.
What amazes me now is that they even managed to get the same Amiga 7-voice Turrican II theme on the Atari ST version! |
10 December 2014, 20:46 | #27 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,892
|
Sample interleaving may be useful to produce more than one channel however at a cost of sampling rate.
|
10 December 2014, 21:20 | #28 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
would you not hear a constant high-pitched whine though?
i've been thinking actually about taking the advantage of the opportunity of doing realtime effects on the sample data, even such simple things as overdrive distortion. one channel could be dedicated to guitar (polyphonic), for instance, and some exciting sounds could be produced. |
10 December 2014, 21:25 | #29 |
Thalion Webshrine
Join Date: Jan 2004
Location: Oxford
Posts: 14,480
|
Lethal Xcess had 7 voices in 1991 too. I wonder which came first? 7-voice Turrican II or 7-voice Lethal Xcess?
If you want the source code then you could ask Jochen or more approachable Grazey of PhF (he's the king of Jochen's music and players in today's era) |
10 December 2014, 22:28 | #30 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,866
|
Quote:
|
|
11 December 2014, 01:55 | #31 | |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,054
|
Quote:
Second Amiga 7V soundformat was TFMX 7V. Third Amiga 7V soundformat was Mugician II (aka Mugician 7V). All Amiga 7V soundformats has 3 normal channels and 4 mixed channels. Many years ago I asked Chris Huelsbeck's about TFMX 7V details, and he wrote that Jochen Hippel was author (idea and mixing code) of 7V routine (exactly mixing 4 channels in 1 channel). Many years ago I asked also Reinier van Vliet (Mugician author), he wrote that he created Mugician II replay, after Turrican 2 was published. Turrican 2 TFMX 7V music was inspiration for him. All Amiga 7V replays with sources code are available on the Wanted Team page. |
|
11 December 2014, 13:32 | #32 | |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
But then a single pattern of a tracker mod mixed down into 4 channels at 22kHz would take about 700k! So we don't have much chip ram left for our game. Well perhaps we could store the music in fast ram and copy it to a buffer in chip. But i don't even want to talk about Amigas with fast ram tbh, let alone accelerators. Stock A1200 or bust, that's my motto. Really i'd only worry about fancy super-multi-channel music on title sequence &c. But i already generated some of my guitar chord samples using software mixing and overdrive effect, and it sounds good. Now to do it in real time... Echo effect is also easy. |
|
11 December 2014, 14:18 | #33 | |
Registered User
Join Date: Dec 2011
Location: Gummersbach
Posts: 18
|
Quote:
|
|
11 December 2014, 15:41 | #34 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,866
|
With four channels per side it becomes 12 bit per channel.
This method is sadly no good for stock machines. |
11 December 2014, 15:56 | #35 |
Registered User
Join Date: Dec 2011
Location: Gummersbach
Posts: 18
|
Uh, I always thought combining 2 channels would result in ~14 Bit quality. One channel playing at full volume and one channel playing at volume 1.
|
11 December 2014, 17:14 | #36 |
Registered User
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,157
|
Yes, that's right - the mixed stream will have roughly 14-bit resolution. When you mix two samples by addition, though, the least significant bit of each is lost, and if you're mixing four samples, you lose the two least significant bits of stream. Thus, if you mix one stereo music stream and six sound effects, as suggested, the music's effective resolution will be roughly 12-bit.
|
11 December 2014, 17:24 | #37 |
Registered User
Join Date: Dec 2011
Location: Gummersbach
Posts: 18
|
The least significant bit ist only lost when dividing the result by 2. I'd prefer proper clamping and try to avoid too much clipping using proper samples, but either way still some resolution will be lost.
|
11 December 2014, 19:57 | #38 |
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
The difference being that using scaled samples always loses bits while clamping/saturation only does in very unlikely situations. But scaling is cheaper cycle-wise on most processors...
|
11 December 2014, 21:16 | #39 | |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
But they are not necessarily equal volume! So it is quite plausible that mixing only two samples could result in 15 bit data if they are at different volumes. For instance one at volume 64 and the other at volume 1. |
|
12 December 2014, 18:41 | #40 | |
Not a Rebel anymore
Join Date: Apr 2005
Location: UK
Age: 51
Posts: 505
|
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sound channels switched? | bLAZER | support.WinUAE | 21 | 28 October 2014 08:43 |
A600: missing sound channels | cosam | support.Hardware | 28 | 23 May 2010 06:43 |
More that 4 Sound Channels??? | Dragon3d | support.WinUAE | 8 | 01 February 2008 17:30 |
shufflepuck cafe 4 channels sound is crazy | turrican3 | support.WinUAE | 5 | 08 November 2007 15:41 |
help sound 4 channels | turrican3 | support.WinUAE | 37 | 13 April 2007 09:17 |
|
|