English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 26 December 2014, 17:48   #41
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
Quote:
Originally Posted by Phantasm View Post
i wondered why it was 7 channels. That always seemed like a very strange number.
This is software limit, 7MHz 68000 can't mix more than 4 channels with good quality. Good 4 channels in 1 channel mixing routine using all 8 data registers and all 9 address registers. Original Hippel's mixing routine used also self modyfying code.
Don_Adan is offline  
Old 19 January 2015, 17:14   #42
leonard
Registered User
 
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 133
Hi,

I think 7 is both because of ATARI and AMIGA Jochen Hippel wrote tons of ATARI code, and his demo group ( TEX ) was one of the first playing "AMIGA" like digital music on ATARI. ( cf AMIGA Demo ). On ATARI, software mixing routines has 4 voices "because" of AMIGA hardware! ( but the CPU is able to mix more than 4 voices).
Then, when Jochen wanted to add voices to AMIGA, I guess he re-use its 4 voices software mixer from ATARI, play the result though one AMIGA hardware voice. So there is 3 hardware channels left.
You get the "magic" 3+4=7 value.
leonard is offline  
Old 19 August 2015, 16:33   #43
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by leonard View Post
Hi,

I think 7 is both because of ATARI and AMIGA Jochen Hippel wrote tons of ATARI code, and his demo group ( TEX ) was one of the first playing "AMIGA" like digital music on ATARI. ( cf AMIGA Demo ). On ATARI, software mixing routines has 4 voices "because" of AMIGA hardware! ( but the CPU is able to mix more than 4 voices).
Then, when Jochen wanted to add voices to AMIGA, I guess he re-use its 4 voices software mixer from ATARI, play the result though one AMIGA hardware voice. So there is 3 hardware channels left.
You get the "magic" 3+4=7 value.
Chris Huelsbeck actually explained at the Netherlands 30 years Amiga event this summer that he got permission from Jochen Hippel to reuse his Atari Mixing routine. On the Amiga he decided to mix only four channels together, so that the three other channels could be played natively. The mixed channels were used to play sound which are usually noisy and do not require a very high fidelity such as percussions, bass, etc...

I am glad I got the chance to talk with him a (very) little bit at this occasion, he is a very nice, soft spoken, friendly and modest person who is super accessible. A very nice human being in addition to being an Amiga legend.
ReadOnlyCat is offline  
Old 19 August 2015, 23:04   #44
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
the strange thing is, although Huelsbeck back-ported the 4-channel mixing to the Amiga to get 7 channels in total, the Turrican II theme on the Atari ST still seems to have 7 channels, at least i don't hear anything obviously missing. I asked Chris about this on Twitter and he seemed not to actually know the answer...
Mrs Beanbag is offline  
Old 19 August 2015, 23:52   #45
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,354
Chris probably didnt back port anything from Atari to Amiga. As well as their musician Jochen was Thalion's Amiga programmer. He ported all of Thalion's Atari games in the first year to the Amiga pretty much on his own. He had his own 7 voice Amiga music too
alexh is offline  
Old 20 August 2015, 12:49   #46
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
Chris wrote TFMX didn't he?
Mrs Beanbag is offline  
Old 20 August 2015, 16:53   #47
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,354
Just saying the Jochen had 7 voice songs working on the Amiga at the same time he licensed / gave his mixer code to Chris for their collaboration
alexh is offline  
Old 21 August 2015, 05:36   #48
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by alexh View Post
Chris probably didnt back port anything from Atari to Amiga. As well as their musician Jochen was Thalion's Amiga programmer. He ported all of Thalion's Atari games in the first year to the Amiga pretty much on his own. He had his own 7 voice Amiga music too
Well, he said pretty explicitly at the event that he adapted the code to the Amiga. I do not remember his exact words though and I do not recall videotaping his speech either so you will have to trust me.
He could have mentioned it was a collaboration but that is not the impression I got.
ReadOnlyCat is offline  
Old 21 August 2015, 06:24   #49
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
About sample interleaving:
Quote:
Originally Posted by Mrs Beanbag View Post
would you not hear a constant high-pitched whine though?
Only if you are a cat!

Let's say you interleave samples from different sounds while playing at 28khz: each sample from the first of the sound essentially is played as a max volume impulse followed by a zero volume one with a frequency of 28/2 = 14kHz.
That's already at the limit of human audition so unlikely to be perceived but since you are interleaving the sample of two sounds you are also playing another 14kHz signal with exact opposite phase so they can end up canceling each other out.

The cancellation is not complete because the samples of each sound obviously differ so you probably end up with a low volume 14khz signal when both sounds have similar volumes/dynamics. When they have highly different (opposed) mostly constant volumes is when the 14kHz signal will be the most perceptible.

This said, if you interleave samples it means that these have already been prepared somewhat in advance so you could as well add them together with clipping: snd1spl1, snd1spl1 + snd2spl1, snd1spl2 + snd2spl1, snd1spl2 + snd2spl2, etc.

The clipping artifacts are probably preferable to the 14kHz whine overall.
ReadOnlyCat is offline  
Old 21 August 2015, 09:54   #50
robinsonb5
Registered User
 
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,153
Quote:
Originally Posted by ReadOnlyCat View Post
That's already at the limit of human audition so unlikely to be perceived
Nitpick: plenty of people (though mostly younger ones!) can hear a 14KHz signal - and generally find such sounds quite objectionable. CRT whine from old TVs, anyone?
robinsonb5 is offline  
Old 21 August 2015, 22:37   #51
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by robinsonb5 View Post
Nitpick: plenty of people (though mostly younger ones!) can hear a 14KHz signal - and generally find such sounds quite objectionable. CRT whine from old TVs, anyone?
Ah, true.
That's the horizontal scan frequency and it is around 15kHz and I do recall hearing it very finely when I was younger. These days I can notice it faintly when switching the monitor on but after a second or two I cannot distinguish it from the background noise anymore.

So yup, indeed, it would probably be quite noticeable to young ears. Although it would not be constant and vary quite a bit as samples are played which may or may not be a good thing. I will test it when that reaches the top of my priority list.
ReadOnlyCat is offline  
Old 22 August 2015, 01:03   #52
robinsonb5
Registered User
 
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,153
Quote:
Originally Posted by ReadOnlyCat View Post
I will test it when that reaches the top of my priority list.
Ah yes, I have a priority list like that. "When it reaches the top of my priority list" means "some time between now and the heat death of the universe"!
robinsonb5 is offline  
Old 22 August 2015, 04:21   #53
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 840
Quote:
Originally Posted by Mrs Beanbag View Post
would you not hear a constant high-pitched whine though?
Many many summers ago I tested doing this. I can't really remember what it sounded like, but IIRC it wasn't bad with high enough samplerate playback. I think it did sound bad on lower rates. (Kinda metallic sounding?)
NorthWay is offline  
Old 22 August 2015, 14:39   #54
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by robinsonb5 View Post
Ah yes, I have a priority list like that. "When it reaches the top of my priority list" means "some time between now and the heat death of the universe"!

I actually meant it literally since some of my projects would benefit from more than 4 channels of sound.
ReadOnlyCat is offline  
Old 22 August 2015, 15:35   #55
voxel
Amiga Nuts!
 
voxel's Avatar
 
Join Date: Sep 2006
Location: Le Mayet d'Ecole, 03800, FRANCE
Posts: 176
there was oktalyser that could do up to 32 channels on a 060 amiga with (plenty of) ram by real time mixing the samples ^^)
voxel is offline  
Old 22 August 2015, 20:58   #56
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 840
I'll take aim at my mouth with my foot, but sound mixing is a pretty well known exercise in signal handling / processing. It is basically (open mouth wide) stretching/skipping the source samples until they fit the target playback frequency, adding all the values together, and then dividing by the number of samples you just added. Making it sound good is the magic part (and you have to be careful about overflow and rounding).

Even the original Amiga is mixing two signals together in each left and right channel, however much that might be done with analog circuits; the theory is still the same.
NorthWay is offline  
Old 22 August 2015, 21:42   #57
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
Quote:
Originally Posted by NorthWay View Post
Even the original Amiga is mixing two signals together in each left and right channel, however much that might be done with analog circuits; the theory is still the same.
The theory of basically writing an emulator for the Amiga's sound capabilities to run on the CPU, is the same as the theory of wiring the output of two op-amps together with resistors? Dunno about that.

Obviously the "mixing" is simply addition, but there is also resampling and volume-multiplying to be done. Easy in theory, getting it to output in real-time on a stock A500 maybe not so easy in practice.
Mrs Beanbag is offline  
Old 23 August 2015, 00:12   #58
Michael Sykes
WinUAE end user
 
Michael Sykes's Avatar
 
Join Date: Jan 2014
Location: Bremen
Age: 44
Posts: 649
Quote:
Originally Posted by voxel View Post
there was oktalyser that could do up to 32 channels on a 060 amiga with (plenty of) ram by real time mixing the samples ^^)
Reading that reminds me of the 14bit Noteplayer for Delitracker.
I never tried 64 channel mods but at least up to 16 channels work fine on 040+ Amigas. It's not what I would call HiFi quality and you have to turn the volume up a little more but it works.

I also remember getting a "You need more CPU power" requester from Musicline editor with a basic A1200 when playing some 8 channel mods. Many of them played fine on Delitracker.
Michael Sykes is offline  
Old 27 October 2015, 12:17   #59
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Mixing channels without interpolation is an easy task, actually.

You have to bring all channels to the same replay frequency and volume levels, then make an average (i.e. add then shift back).
This is done by upsampling/downsampling the sound accordingly (just skip or repeat samples), and the volume level is made not with multiplies (too slow !), but with a table lookup (a 256x64 entry table is small enough and easily built at startup).

A 68000 can do something like 4 channel mixing at 25khz, and 8 channel at half that rate.
A 68030 can do 32 channel mixing with interpolation. Use the 14bit Noteplayer for Delitracker2, the one made by Chris Hodges - awesome quality you get there, especially with calibrated 14bit output. I would love to see the actual routine for its 16:16 infinite oversampling mixing mode !
meynaf is offline  
Old 27 October 2015, 14:36   #60
kovacm
Banned
 
Join Date: Jan 2012
Location: Serbia
Posts: 275
I must ask something that is not related strictly to topic but 14bit sound on Amiga is achieved by combining two 8 bit channels but Amiga still have 8bit DAC at output? right? So internally (in memory and CPU) you work with 14bit but at output you have 8bit OR Amiga have 4 separate 8bit DAC connected to stereo output chinches?
kovacm is offline  
 


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

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 13:51.

Top

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