English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 07 January 2016, 16:45   #81
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,771
Quote:
Originally Posted by Toni Wilen View Post
US Patent 4,829,473 says ""Each of the data registers 29,31 transfers its data into a plurality of audio control counters and registers 33 and 35, which in turn each drive an individual one of the digital to analog (D/A) converters 37,39 of which there are four in all." and FIG 4 shows 4 identical channel blocks and each has single analog out line.
This can be valid for original Paula but there is at least 3 known revisions and i assume side to fixing issues in silicone some of them may be 'cost reduction'.
But of course this is pure speculation...
pandy71 is offline  
Old 07 January 2016, 21:31   #82
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by meynaf View Post
Mixing channels without interpolation is an easy task, actually.
I do not think the "easy" part is being disputed, the tough part is making it suitable for real time usage (a game). Hence my suggestion to accept only fixed frequency samples.
ReadOnlyCat is offline  
Old 08 January 2016, 09:28   #83
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by ReadOnlyCat View Post
I do not think the "easy" part is being disputed, the tough part is making it suitable for real time usage (a game). Hence my suggestion to accept only fixed frequency samples.
Fixed frequency mixing can work well for SFX, but i'm afraid it's ill-suited for multichannel music...
So things like 7V are usually reserved to areas such as menus.
For in-game musics you could play some pre-mixed pcm data (like 8svx), but this takes space.
meynaf is offline  
Old 08 January 2016, 10:22   #84
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,771
Quote:
Originally Posted by meynaf View Post
Fixed frequency mixing can work well for SFX, but i'm afraid it's ill-suited for multichannel music...
So things like 7V are usually reserved to areas such as menus.
For in-game musics you could play some pre-mixed pcm data (like 8svx), but this takes space.
It works on PC world... so why not on Amiga (i mean Soundblaster series card that determined Audio industry even nowadays are only few, fixed sample rates, 11025, 22050 - most of games even those most important titles such as Doom, Quake not use more than 22050Hz sample rate).

And yes, You can use plenty of LUT's to speed up operations but still You are limited in a way that prevent to even think about relatively HQ audio without decent DSP.
Proper error rounding is beyond Amiga capabilities even with 68030 and proper multirate (ASRC) processing is beyond 68060.
pandy71 is offline  
Old 08 January 2016, 12:14   #85
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by pandy71 View Post
It works on PC world... so why not on Amiga (i mean Soundblaster series card that determined Audio industry even nowadays are only few, fixed sample rates, 11025, 22050 - most of games even those most important titles such as Doom, Quake not use more than 22050Hz sample rate).
In PC world waste of cpu power isn't an issue


Quote:
Originally Posted by pandy71 View Post
And yes, You can use plenty of LUT's to speed up operations but still You are limited in a way that prevent to even think about relatively HQ audio without decent DSP.
Proper error rounding is beyond Amiga capabilities even with 68030 and proper multirate (ASRC) processing is beyond 68060.
Depends what you call HQ. Perhaps you need to try the Delitracker 14-bit noteplayer (the one written by Chris Hodges, not the original one) ; its infinite oversampling method sounds a lot better than what many pc software can do.
meynaf is offline  
Old 08 January 2016, 19:07   #86
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,771
Quote:
Originally Posted by meynaf View Post
In PC world waste of cpu power isn't an issue
Yep - for sure valid for 8086 with 8MHz clock or 80286 with 10MHz...

Quote:
Originally Posted by meynaf View Post
Depends what you call HQ. Perhaps you need to try the Delitracker 14-bit noteplayer (the one written by Chris Hodges, not the original one) ; its infinite oversampling method sounds a lot better than what many pc software can do.
Well not sure what kind of marketing specialist described algorithm but for sure oversampling from my perspective is something else than "infinite oversampling" especially with technical limitations of Audio HW Paula.
pandy71 is offline  
Old 08 January 2016, 20:15   #87
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
Quote:
Originally Posted by meynaf View Post
In PC world waste of cpu power isn't an issue
In PC world, waste of CPU power is practically a badge of honour!
Mrs Beanbag is offline  
Old 09 January 2016, 07:28   #88
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by meynaf View Post
Fixed frequency mixing can work well for SFX, but i'm afraid it's ill-suited for multichannel music...
So things like 7V are usually reserved to areas such as menus.
For in-game musics you could play some pre-mixed pcm data (like 8svx), but this takes space.
Well, the fun part is to make it happen not to admit defeat before trying so one has to accept a few constraints along the way, and musicians are usually creative enough to adapt to new constraints or even turn them to their advantage.

And as I said in a previous post, percussions and sound effects do not usually need to be played at varying frequencies so they are good candidates for fast mixing. And I am sure there are other constraints which can be used to make the mixing even faster.
ReadOnlyCat is offline  
Old 09 January 2016, 11:48   #89
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by pandy71 View Post
Yep - for sure valid for 8086 with 8MHz clock or 80286 with 10MHz...
These are long dead you know.
The smallest peecee i've seen mixing audio was a 386SX16 - and the result was far below a 68000 Amiga.


Quote:
Originally Posted by pandy71 View Post
Well not sure what kind of marketing specialist described algorithm but for sure oversampling from my perspective is something else than "infinite oversampling" especially with technical limitations of Audio HW Paula.
Not having seen the code, i don't know what exactly it is. What i know is that it has a "natural", not too filtered out, sound - and that 32ch mixing works fine on a 030.


Quote:
Originally Posted by Mrs Beanbag View Post
In PC world, waste of CPU power is practically a badge of honour!
Indeed


Quote:
Originally Posted by ReadOnlyCat View Post
Well, the fun part is to make it happen not to admit defeat before trying so one has to accept a few constraints along the way, and musicians are usually creative enough to adapt to new constraints or even turn them to their advantage.

And as I said in a previous post, percussions and sound effects do not usually need to be played at varying frequencies so they are good candidates for fast mixing. And I am sure there are other constraints which can be used to make the mixing even faster.
Tricks to make mixing faster that i know are :
- reducing the mixing's output frequency
- reducing the overall number of channels
- mix only channels that currently play something
- using a fixed pitch, like you suggest
- using a fixed volume (some trackers on the Atari did this)
- mixing 7-bit samples rather than 8-bit (very little gain though)
meynaf is offline  
Old 09 January 2016, 13:02   #90
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,304
I guess it is more a "proof of concept". At least you need to code a new tracker progam that use the new routine if you want that a musican will use it (if he wants with the limits). 4 and mulitchannel without limits are there. More interesting would be realtime softsynth manipulation what would give musicans more freedom for creativity.
daxb is offline  
Old 09 January 2016, 15:56   #91
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by meynaf View Post
Tricks to make mixing faster that i know are :
- reducing the mixing's output frequency
- reducing the overall number of channels
- mix only channels that currently play something
- using a fixed pitch, like you suggest
- using a fixed volume (some trackers on the Atari did this)
- mixing 7-bit samples rather than 8-bit (very little gain though)
Indeed, these are the ones I was thinking of.
I would have thought using 7bit samples would have provided a large boost though but maybe I overestimated it.

Do you know if there is an available open source tracker which implements these tricks?

Quote:
Originally Posted by daxb View Post
I guess it is more a "proof of concept". At least you need to code a new tracker progam that use the new routine if you want that a musican will use it (if he wants with the limits). 4 and mulitchannel without limits are there. More interesting would be realtime softsynth manipulation what would give musicans more freedom for creativity.
Soft synth could be a possibility indeed, particularly to reduce memory needs, specially given that the corresponding samples could be generated and cached in advance when there is idle CPU time in the frame but they still have to be mixed together.

It is hard to say though without FM synth knowledge whether good samples are computationally intensive to generate or not. I seem to recall reading that the best MegaDrive/Genesis sounds were obtained by varying the FM parameters dynamically with the machine's Z80 but I am not too sure anymore if I actually read it or if I deduced it from a few reads here and there.
ReadOnlyCat is offline  
Old 09 January 2016, 16:33   #92
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
Quote:
Originally Posted by ReadOnlyCat View Post
Indeed, these are the ones I was thinking of.
I would have thought using 7bit samples would have provided a large boost though but maybe I overestimated it.

Do you know if there is an available open source tracker which implements these tricks?
The original OctaMED 1.0 mixing routines pre-shifted the sample data 1 bit right so that all 4 voices could be doubled for a total of 8 when competing standards (TFMX) could only do 7 on a stock 68000. The rest of the story is purely academic in this day and age. Preshifting a sample one bit right is cheaper and shifting the whole mixed pattern x bits right is usually also cheap enough on a modern CPU.

Quote:
Originally Posted by ReadOnlyCat View Post
Soft synth could be a possibility indeed, particularly to reduce memory needs, specially given that the corresponding samples could be generated and cached in advance when there is idle CPU time in the frame but they still have to be mixed together.

It is hard to say though without FM synth knowledge whether good samples are computationally intensive to generate or not. I seem to recall reading that the best MegaDrive/Genesis sounds were obtained by varying the FM parameters dynamically with the machine's Z80 but I am not too sure anymore if I actually read it or if I deduced it from a few reads here and there.
Try out HivelyTracker on an AHI mixer equipped Amiga to find out (or try AHX for non-mixing). AHX requires an '020 for the editor and an '030 is recommended for Hively. The mods are quite small but some features are very CPU intensive.
Samurai_Crow is offline  
Old 09 January 2016, 20:32   #93
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by ReadOnlyCat View Post
Indeed, these are the ones I was thinking of.
I would have thought using 7bit samples would have provided a large boost though but maybe I overestimated it.
7bit samples only remove ONE instruction from the mixing loop (actually ROXR.B #1 to shift back from 9 to 8 bits).
Well, ok, one would say that you have more bits to shift if you mix more channels, but then you mix in 16 bits and shift just once at the end (or not shift at all if using 14bit output).


Quote:
Originally Posted by ReadOnlyCat View Post
Do you know if there is an available open source tracker which implements these tricks?
Honestly i don't know how current trackers do their mixing...


Quote:
Originally Posted by ReadOnlyCat View Post
It is hard to say though without FM synth knowledge whether good samples are computationally intensive to generate or not. I seem to recall reading that the best MegaDrive/Genesis sounds were obtained by varying the FM parameters dynamically with the machine's Z80 but I am not too sure anymore if I actually read it or if I deduced it from a few reads here and there.
The Megadrive has a FM synth chip. The Amiga has none. So the situation is very different.
meynaf is offline  
Old 09 January 2016, 21:07   #94
nogginthenog
Amigan
 
Join Date: Feb 2012
Location: London
Posts: 1,311
Quote:
Originally Posted by meynaf View Post
The Megadrive has a FM synth chip. The Amiga has none. So the situation is very different.
The Amiga can do FM audio. 1 channel can modulate another.
nogginthenog is offline  
Old 09 January 2016, 21:31   #95
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by nogginthenog View Post
The Amiga can do FM audio. 1 channel can modulate another.
Clearly not enough to have the same level of features as a true FM chip.
meynaf is offline  
Old 15 January 2016, 16:56   #96
Megol
Registered User
 
Megol's Avatar
 
Join Date: May 2014
Location: inside the emulator
Posts: 377
Quote:
Originally Posted by meynaf View Post
These are long dead you know.
The smallest peecee i've seen mixing audio was a 386SX16 - and the result was far below a 68000 Amiga.
8088 4.77MHz can play modules with a sound card or covox type device (DAC connected to the parallel port). Sure it isn't easy but still...

A 386 even in the sx version have no problem mixing many 16 bit channels.
Quote:
Tricks to make mixing faster that i know are :
- reducing the mixing's output frequency
- reducing the overall number of channels
- mix only channels that currently play something
- using a fixed pitch, like you suggest
- using a fixed volume (some trackers on the Atari did this)
- mixing 7-bit samples rather than 8-bit (very little gain though)
- "Batching", handle x samples from one channel at a time before switching channels.
- Reduce the number of volume levels.
- Reduce the number of sample frequencies + use generated code for changing pitch.
- Use pre-scaled samples.
- Self-modifying code.
- Mixing buffer with higher precision than input samples (8 bit samples -> 16 bit buffer, 16 bit samples -> 32 bit buffer), reduces overflow management.

But the target platform have to be known before coding a mixing routine, a superscalar processor with fast multiply may work best with a tight routine with little optimizations, a superscalar with somewhat slower multiply may benefit from doing batching in order to use one multiplication instruction for doing two volume scalings and of course in a really slow machine one can't do too advanced optimizations as there isn't enough cycles available - so reducing sample precision + playback frequencies are really the only tool available.
Megol is offline  
Old 15 January 2016, 18:16   #97
NorthWay
Registered User
 
Join Date: May 2013
Location: Grimstad / Norway
Posts: 839
Just for shits&giggles, might someone perhaps paste in one of the used mixer inner loops?
NorthWay is offline  
Old 15 January 2016, 18:50   #98
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by Megol View Post
8088 4.77MHz can play modules with a sound card or covox type device (DAC connected to the parallel port). Sure it isn't easy but still...
Yuck. I don't want to hear that.


Quote:
Originally Posted by Megol View Post
A 386 even in the sx version have no problem mixing many 16 bit channels.
But without any kind of interpolation.


Quote:
Originally Posted by Megol View Post
- "Batching", handle x samples from one channel at a time before switching channels.
Not necessarily better because of the extra loop control.


Quote:
Originally Posted by Megol View Post
- Reduce the number of volume levels.
Totally useless, unless this number is reduced to just one.


Quote:
Originally Posted by Megol View Post
- Reduce the number of sample frequencies + use generated code for changing pitch.
This kind of trick was used on the ST for the TCB tracker. NOT nice.


Quote:
Originally Posted by Megol View Post
- Use pre-scaled samples.
Impractical ; not useful.


Quote:
Originally Posted by Megol View Post
- Self-modifying code.
Ugly. Fails on any cpu with a cache.


Quote:
Originally Posted by Megol View Post
- Mixing buffer with higher precision than input samples (8 bit samples -> 16 bit buffer, 16 bit samples -> 32 bit buffer), reduces overflow management.
Reduces overflow management but needs extra instructions to convert from 8 to 16 or 16 to 32. Useless for speed.


Quote:
Originally Posted by Megol View Post
But the target platform have to be known before coding a mixing routine, a superscalar processor with fast multiply may work best with a tight routine with little optimizations, a superscalar with somewhat slower multiply may benefit from doing batching in order to use one multiplication instruction for doing two volume scalings and of course in a really slow machine one can't do too advanced optimizations as there isn't enough cycles available - so reducing sample precision + playback frequencies are really the only tool available.
If you have a superscalar processor you have enough horsepower to mix as many channels as you want, with interpolation. Even a 030 can do that. And you don't even need a fast multiply (in fact you don't need a multiply at all).
meynaf is offline  
Old 16 January 2016, 13:26   #99
Megol
Registered User
 
Megol's Avatar
 
Join Date: May 2014
Location: inside the emulator
Posts: 377
Quote:
Originally Posted by meynaf View Post
Yuck. I don't want to hear that.
The Covox or the 8088? :P

A resistor ladder DAC coupled to an amplifier sounds surprisingly good for 8 bit playback, it's when one starts with 12..16 bits the resistor values begin to be critical IIRC.

If you want to hear something worse: [ Show youtube player ]

Jump to 6:59 for a 4 channel playback routine on the PC speaker :P

Quote:
But without any kind of interpolation.
Perhaps. I've never coded a playback device for the 386.
Interpolation isn't always useful though, some modules sound strange with it.

Quote:
Not necessarily better because of the extra loop control.
In itself it doesn't do too much, helps keeping cache misses down + allows some shortcuts like simplifying changing pitch. It's in combination with other tricks it starts paying off big.

Quote:
Totally useless, unless this number is reduced to just one.
Nope. Think table lookup with a small data cache -> 64*256 =16kiB, 16*256 = 4kiB.

Quote:
This kind of trick was used on the ST for the TCB tracker. NOT nice.
Can't but agree. Still better than no playback at all though.

Quote:
Impractical ; not useful.
It's been done before so... If one have short samples + memory not used by anything else then it can be useful. Sure, not a tool for arbitrary mixing but for playing a custom module.

Quote:
Ugly. Fails on any cpu with a cache.
Maybe 68k but not for x86.
But the kind of SMC I'm talking about here uses large enough code blocks that flushing the cache isn't a problem. Perhaps I should call it dynamic code generation?

Quote:
Reduces overflow management but needs extra instructions to convert from 8 to 16 or 16 to 32. Useless for speed.
Eh... Nope. Personal experience talking. More advantages the more channels are mixed of course.

Quote:
If you have a superscalar processor you have enough horsepower to mix as many channels as you want, with interpolation. Even a 030 can do that. And you don't even need a fast multiply (in fact you don't need a multiply at all).
How do you handle per channel volumes if not by multiply? You may do the multiply via lookup tables but it's still there. In hardware one can "dither" samples but that is essentially multiplication via PWM+smoothing filter.

And I thought we were talking about optimization not if a processor may mix channels?
Megol is offline  
Old 16 January 2016, 15:50   #100
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
resample all the samples before playback, to all the actually used notes. Will use a lot of memory...
Mrs Beanbag 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 03:15.

Top

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