Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
15 crawler(s) on-line.
 55 guest(s) on-line.
 1 member(s) on-line.


 pixie

You are an anonymous user.
Register Now!
 pixie:  1 min ago
 Deaths_Head:  19 mins ago
 RobertB:  28 mins ago
 DiscreetFX:  37 mins ago
 Lou:  38 mins ago
 michalsc:  45 mins ago
 matthey:  47 mins ago
 AmigaPapst:  1 hr 11 mins ago
 K-L:  1 hr 26 mins ago
 Dave73:  2 hrs 23 mins ago

/  Forum Index
   /  Amiga General Chat
      /  Possible to combine audio channels for up to virtual 16-bit sound?
Register To Post

PosterThread
Hypex 
Possible to combine audio channels for up to virtual 16-bit sound?
Posted on 19-Oct-2015 15:10:27
#1 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

Around the time the 14-bit audio drivers were getting popular I had my own theory on how to go about it. What I was thinking was to drop a 16-bit value down to 14-bit then use the top 8 bits left as a MSB and 6-bits left over to modify volume with AM synthesis. So one channel would play the upper byte and the other channel would use the lower 6-bits to modulate the volume. So that a virtual 14-bit channel was created.

I've since read up on the actual 14-bit routines and how they work more simply by playing 8-bits on one track and 6-bits on another with volume 1. Which I cannot fathom how that can work. My AM idea, though more complicated, made more sense to me. 8-bit data and 6-bits volume. Easy.

If we work off the assumption that the Amiga output volume is half what it usually should be because it "cheats" by hardware mixing each track at half the normal volume then we can look at each audio output as having a dymanic range of 9-bits precision. That is two 8-bit channels combined which gives a maximum range of 512 values or 9-bits. I believe Symphonie exploits this for it's 9-bit output mode.

If we take volume into it then we can virtually add anoher 6-bits on top for 15-bits. And if we also comnbine channel volumes to give us full 7-bits volume precision we can max the dymanic range to a full 16-bits.

As you can see to do so no AM synthesis can be relied on as both channels are needed for either 9-bit amplitude or 7-bit volume scaling. However, the CPU could be programmed to do this directly. Sure, there would be as much time spent spltting up the 16-bit data across two samples and volume values, as there would be with storing the data in the hardware registers manually, making it impractical for normal playback. But I wonder, has anyone tried this? Programing it directly to get maximum dynamic range output?

Failing that and going back to the old 14-bit routines, can 16-bit data actually be used with full 8-bit samples and a proper volume setting for the channel usually set as volume 1?

Well just my thoughts for today.

Last edited by Hypex on 03-Nov-2016 at 08:33 AM.
Last edited by Hypex on 19-Oct-2015 at 03:17 PM.

 Status: Offline
Profile     Report this post  
broadblues 
Re: Possible to combine audio channels for up to virtual 16-bit sound?
Posted on 19-Oct-2015 16:03:54
#2 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4446
From: Portsmouth England

@Hypex

Quote:

I've since read up on the actual 14-bit routines and how they work more simply by playing 8-bits on one track and 6-bits on another with volume 1. Which I cannot fathom how that can work. My AM idea, though more complicated, made more sense to me. 8-bit data and 6-bits volume. Easy.


Assuming 8bits of volume resolution, then the 8 bit MSB is played at full volume and the 6 LSB fit inot the range of the LSb of the MSB (b = bit B = byte) 8 + 6 = 14 Presumably there is some loss due to accuracy of volume setting or smesuch so the limit of 14 rather than the full 16

You idea would work on theoretically perfect hardwarwe but practically it would be very ineficient as you would have to play 1 sample at a time setting the volume for each sample, keeping that in sync would be a minor nightmare I think.

The rest of your post apears to be noise

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
olegil 
Re: Possible to combine audio channels for up to virtual 16-bit sound?
Posted on 20-Oct-2015 12:31:31
#3 ]
Elite Member
Joined: 22-Aug-2003
Posts: 5895
From: Work

@Hypex

You need to consider how Paula does DMA. The extra bit from adding two channels probably works, though.
Basically you can use the volume setting to get 1 15-bit, 2 14-bit or 4 8-bit channels. But I don't think you can do DMA to the volume setting, only audio samples work that way.

_________________
This weeks pet peeve:
Using "voltage" instead of "potential", which leads to inventing new words like "amperage" instead of "current" (I, measured in A) or possible "charge" (amperehours, Ah or Coulomb, C). Sometimes I don't even know what people mean.

 Status: Offline
Profile     Report this post  
Hypex 
Re: Possible to combine audio channels for up to virtual 16-bit sound?
Posted on 20-Oct-2015 17:10:12
#4 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

@broadblues

Quote:
Assuming 8bits of volume resolution, then the 8 bit MSB is played at full volume and the 6 LSB fit into the range of the LSb of the MSB (b = bit B = byte) 8 + 6 = 14


So the 8-bit MSB is used as volume and not amplitude? And the 6-bit LSB fits into the range of bit 0 of the MSB? That's how I read that.

Quote:
You idea would work on theoretically perfect hardwarwe but practically it would be very ineficient as you would have to play 1 sample at a time setting the volume for each sample, keeping that in sync would be a minor nightmare I think.


Using the standard 8-bit samples and 6-bit volume it is possible. Since the hardware supports AM and FM modes. The audio.device and AHI both seem to be ignorant of this fact. So hardware banging must be used then. The only problem is both a left and right channel have to be modulated for stereo output. And also the output will be half volume which shouldn't matter much. This way the audio hardware keeps it in sync.

Implementing a 9-bit mode would be easiest. Only slightly better than 8-bit, but less CPU intensive to calculate and audio output would be at full volume. Again hardware keeps it in sync.

There's a few ways to program the audio directly to max out dynamic range. The first and obvious is to just write the values in with the CPU, wait a while and repeat. A timer interrupt could do this. Sync should be close as all audio data is written sequentially.

Another is to use a sample length of one word with normal DMA playback and use an audio interrupt to change audio data. This could be more accurate and proper than the first. CPU sync.

A third idea I have is to write the data in a copper list. The DMA is said to read a word of samples every line for the max output frequency. So a copper could be programed to write the data then wait till an X,Y position before the next. This would likely be over complicated. Sync dependant on copper write so possible lag.

Quote:
The rest of your post apears to be noise


Well I needed to set a context. And here's some more.

So we have 8-bit samples with 6-bit volume. Multiplying up:
256*64=16384. Combined channels give 32768 or 15-bits.

With 9-bits from combined samples:
512*64=32768 or 15-bits.

Unlikely to work. Combined 9-bit samples with combined 7-bit volume:
512*128=65536 and 16-bit.

Just to complete. 8-bit samples with combined 7-bit volume:
256*128=32768 or 15-bits.

I am of course looking at from an integer perspective.

Last edited by Hypex on 20-Oct-2015 at 05:23 PM.

 Status: Offline
Profile     Report this post  
Hypex 
Re: Possible to combine audio channels for up to virtual 16-bit sound?
Posted on 20-Oct-2015 17:28:47
#5 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

@olegil

Quote:
Basically you can use the volume setting to get 1 15-bit, 2 14-bit or 4 8-bit channels. But I don't think you can do DMA to the volume setting, only audio samples work that way.


In AM and FM mode the audio word of one channel read in is used to modulate another channel. With AM it changes the volume. With FM the period value. AFAIK all working like normal DMA.

But I do wonder if an 8-bit LSB from a 16-bit word can be used with low volume instead of 6-bits.

 Status: Offline
Profile     Report this post  
Thorham 
Re: Possible to combine audio channels for up to virtual 16-bit sound?
Posted on 20-Oct-2015 17:49:58
#6 ]
Regular Member
Joined: 5-Mar-2014
Posts: 183
From: Unknown

Quote:
Hypex wrote:

So one channel would play the upper byte and the other channel would use the lower 6-bits to modulate the volume.

There two problems with that:

1. Each sample used for modulation modulates two successive samples that are being modulated. That means that you get only half the sample rate.

2. You'll get nasty quantization errors, so it won't sound good.

Quote:
Hypex wrote:

If we work off the assumption that the Amiga output volume is half what it usually should be because it "cheats" by hardware mixing each track at half the normal volume then we can look at each audio output as having a dymanic range of 9-bits precision. That is two 8-bit channels combined which gives a maximum range of 512 values or 9-bits. I believe Symphonie exploits this for it's 9-bit output mode.

There's not point because 14 bit is better and extremely easy. All you need to do is take a 16 bit sample and shift the low byte two bits to the right and write the result to the playback buffer.

 Status: Offline
Profile     Report this post  
Hypex 
Re: Possible to combine audio channels for up to virtual 16-bit sound?
Posted on 21-Oct-2015 14:23:52
#7 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

@Thorham

Quote:
1. Each sample used for modulation modulates two successive samples that are being modulated


That's a good point. Being it operates on word regardless. I was wondering if the rate was affected. This would make it like HAM fringing or copper chunky. Not quite 1:1.

Quote:
2. You'll get nasty quantization errors, so it won't sound good.


Still I'd like to hear what would happen. Some times making strange noises can be fun.

Quote:
There's not point because 14 bit is better and extremely easy


Easy enough apart from the accuracy, but it only uses half the dynamuc range, so the output is at half volume. With 9-bit you can use the full range and it doesn't "cheat" by using an LSB to change the gradient of the volume slightly to increase resolution.

Quote:
All you need to do is take a 16 bit sample and shift the low byte two bits to the right and write the result to the playback buffer.


All Commodore needed to do was put in a 16-bit mode to avoid this mess. Even if it was an attached mode that used two channels for one 16-bit sample. It could have matched a standard sound card.

Still, I would like to test leaving that LSB at 8-bits and see what happens.

 Status: Offline
Profile     Report this post  

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle