06 March 2017, 18:43 | #61 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
|
Quote:
Last edited by paraj; 06 March 2017 at 21:28. |
|
07 March 2017, 10:45 | #62 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
I think it might be a viable way to multiplex sound effects, so you could have say 3 normal channels for music and 1 channel split into two or three virtual ones for sound effects. Then volume isn't an issue usually.
If the sample rate could be 40kHz or more it would be viable to use the channel modulation feature to do volume control. |
07 March 2017, 11:25 | #63 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
You can exceed the 28kHz limit if you don't use DMA to transfer data to Paula. The hardware reference manual says you can copy data to AUDxDAT with the CPU and an interrupt is available for this purpose.
I wonder if you could instead use the copper. DMA copies one word per scanline, so actually the maximum rate is determined by the horizontal scanning frequency. But that makes me think that if you set the copper up to copy data in the middle of a scanline, you could exceed the speed of DMA. You would need to copy the samples into the copperlist, probably with the blitter. |
07 March 2017, 22:16 | #64 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
|
Quote:
Have you tried prototyping how it sounds in practice? I don't really have access to any good test data, but in principle it should be really easy to test. |
|
08 March 2017, 11:20 | #65 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
My Amiga isn't set up at the moment, so I have not tried anything. Once I get it going I'll see what I can do.
The official hardware guide suggests that 50kHz is possible if you feed Paula via CPU interrupts. One other interesting thing about that add-on for the BBC is that the wavetable RAM is very small. 128 bytes with 8 bits per sample, total 2k. For chip music you could maybe just pre-render every note you needed to avoid having to do sample rate conversion on the fly. Edit: For testing I'd use an oscilloscope. It's really easy to see the actual sample rate by outputting a square wave, and with multiple levels you can easily see how your multiplex is working too. |
09 March 2017, 15:50 | #66 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
You mean, if i mix 4 channels together, then i only have 7 kHz/sample?
|
10 March 2017, 10:24 | #67 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
If you do time division multiplexing, yes. The sample rate is the sample rate of the real channel divided by the number of virtual channels.
I think if you used such a channel for sound effects only it could be quite realistic to use it in a game. Say you had one real channel split into 3 virtual channels. 24kHz sample rate so you have 3x 8kHz virtual channels. Use the blitter to build playback buffers every frame. At 50Hz you would need to copy 160 bytes per virtual channel per frame, but it would be a simple blitter copy. The reason I say use it for sound effects is that then you can resample everything to 8kHz before hand and also set volume there, so there is absolutely no processing done on the fly. Then you have 3 real channels for music and 3 virtual ones for sound effects. |
11 March 2017, 22:13 | #68 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
If you use the copper or blitter to copy data during scanlines, then isn't that means that you cannot do graphic effects with them?
|
12 March 2017, 09:49 | #69 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,745
|
This topic deserve to be read:
http://eab.abime.net/showthread.php?t=65348 |
12 March 2017, 11:08 | #70 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
It's somehow related to mine: http://eab.abime.net/showthread.php?t=86284 There is somewhere audiotests from user Nut? (not active on the board for a few months) |
|
13 March 2017, 12:39 | #71 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
Wow, Nut says that 176kHz is possible. You could multiplex 22 8kHz channels onto that!
Archive link for the volume control stuff: http://web.archive.org/web/201603180...ebby.org/?p=11 Last edited by zero; 13 March 2017 at 12:49. |
13 March 2017, 14:35 | #72 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
mmh, I think that 176KHz is very unrealistic. Not the 176KHz itself (anyhow remember the PWM: >~55KHz require volume=64..) but the 22*8 thing: You have to construct a line with a sequence of copper write (facing the problem of the lost cycle..) and make volume working. Bye, |
|
14 March 2017, 11:26 | #73 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
Now, can someone explain this to me? Is it really possible to poke sound registers with copper/blitter during scanlines and still use them for other effects on screen?
|
14 March 2017, 12:03 | #74 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
Sure, you can poke the registers. Looking at the thread ross linked to, it seems that poking the register causes an immediate DAC conversion, but I wonder if that is entirely correct because you poke two 8 bit samples at once and obviously the second one is then delayed by the frequency setting.
Anyway, you need to create a copperlist that pokes a value at regular intervals. The interval for 28kHz playback would be around 35.7uS, about twice per scanline. The copper can go a lot faster than that. The problem will come when you try to do other copper effects. You would have to interlace them with the sound pokes. It's possible but you will either end up wasting a lot of DMA cycles on copper NOPs or making it tricky to blit your sound data into unevenly spaced words. You could either use the CPU to set up the screen after every vblank and use the copper just for audio, and maybe simulate copper effects with CPU interrupts. But if you want to do a lot of copper stuff it is going to be really tricky. 3:1 at 9kHz per channel is possible with normal DMA playback. If you want to use it in a game, I'd go for 3:1 virtual channels for sound effects and 3 real channels for music. Overhead will be fairly low. |
14 March 2017, 13:23 | #75 | ||
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
So if You want to interleave remember: think in bytes (not word!). It's possible to interleave with blitter but not so trivial Quote:
For Your needs I think that is better to make something 31250KHz (and submultiples) based. EDIT: and yes, in this case probably the not-DMA copper/CPU audio does not make sense Last edited by ross; 15 March 2017 at 18:04. Reason: remark |
||
15 March 2017, 13:12 | #76 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
@zero:
I don't need 3 channels for sound effects, i need 7 channels for music. Based on what you've said, my guess is that it is not possible on a stock A500, even with the copper doing the mixing. |
15 March 2017, 17:30 | #77 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
You could do 7 channels on an A500, especially if you only had one volume control per pair of virtual channels (3x 2:1 virtual and a single real channel). It would use a moderate amount of CPU power, but you wouldn't need the copper.
All depends how many CPU cycles you can spare. |
16 March 2017, 19:42 | #78 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
But currently there is no such kind of tracker, what can do this, right?
|
17 March 2017, 11:58 | #79 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
No, you would have to write one yourself. Maybe compose on a PC or with AHI soundcard and then write your own playback code. It's not really very complicated.
|
18 March 2017, 21:17 | #80 |
Newbie Amiga programmer
Join Date: Jun 2012
Location: Front of my A500+
Age: 38
Posts: 372
|
Unfortunately it's out of my legaue. I'm not that experienced.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Optimized Player 6.1 Playroutine 'p6107.lha' | Photon | Coders. Releases | 68 | 21 March 2023 12:13 |
Super Optimized P6108.lha playroutine :) | Photon | Coders. General | 15 | 07 November 2013 18:15 |
Looking for ArtOfNoise Playroutine (68k assembler) | Herpes | Coders. Asm / Hardware | 5 | 05 September 2012 00:10 |
Tracker/Playroutine to play tubular.mod | Photon | Coders. General | 15 | 10 March 2006 21:09 |
Optimized Protracker playroutine? | Photon | Coders. General | 10 | 11 June 2005 00:54 |
|
|