 |
Welcome to the Natami / Amiga ForumThis forum is for AMIGA fans interested in the new NATAMI platform.
Please read the forum usage manual.
|
Do you have questions about the Natami? Post it here and we will answer it!
|
|
|---|
Wojtek P Poland
| | Posts 1597 16 Jan 2011 17:45
| Gunnar von Boehn wrote:
|
Wojtek P wrote:
| You CAN NOT do real music with 8 channels. or even 16. |
You means you want to mixdown your music to 2 channels? Then doing this in advance makes most sense. Then you can play it with 2 HW channels with no CPU need at all.
|
or have 500 channels or more done with simple hardware and maybe 2-3 blockrams.
| |
Wojtek P Poland
| | Posts 1597 16 Jan 2011 17:50
| Marcel Verdaasdonk wrote:
| Wojtek seems to be talking a channel for each tone! this means each 'different' tone has it's own channel, it is a simple idea but it would be a challenge to do this correctly.(hard to implement) |
What i mean that you CAN NOT suddenly stop sound before it will be at nearly zero volume (decayed). When you play piano and you press a key, other strings doesn't suddenly stop vibrating. When simulating piano (or other instruments) on computer you must play every tone until it decays to low level. So tens of channels are needed to realistically simulate piano. And hundreds to make real music. Yes music was done on 4 channel amiga, 16 channel GUS and even still is done. And it was great for computer made in 1985 to make quite good music. But today we have 21 century and the difference between "quite good" and "properly done" IS IMPORTANT.And there is one more important thing - PROPER low pass filtering. Paula just holds sample values for sample period on each channel. This produces aliasing, and global low pass filter is used as a crude fix. This was great for 1985, but not for 21 century. The proper is to convert given sample rate for each channel to maximum rate by simple repeating, then apply digital narrow band low pass filter to each channel centered at half the channel's sampling frequency.
| |
Phil "meynaf" G. France
| | (Natami Team) Posts 393 17 Jan 2011 10:14
| Thomas Richter wrote:
| Interesting. I didn't know that. How come? The relative position of the DMA sample fetch of the buffers to the horizontal blank shouldn't really matter. So why does it?
|
I do not know where this comes from, but it's verified on real HW (my A1200, in PAL). IIRC there's a thread about it on EAB.Thomas Richter wrote:
| Adjusting the volume mid-term at a *precise* sample position robustly requires a second audio channel. Or at least a second DMA channel if you can leave the design constraints of the current hardware.
|
That's what i'm trying to say since the beginning, but, as Gunnar will not believe me, i'll try to really implement it and then we'll see.
| |
Gunnar von Boehn Germany
| | (Moderator) Posts 5775 17 Jan 2011 10:34
| Wojtek P wrote:
| or have 500 channels or more done with simple hardware and maybe 2-3 blockrams.
|
But would mixing so many channels not waste a lot of memory bandwidth? If you read 500 channels to mix them down to 2 Stereo channels. Would it be much cheaper to mix them down in advance, store a 2 channels stereo signal and just play it back? This sounds to me 250 times cheaper. BTW How would you mix the 500 channels anyway internally? Lets say you have 16bit samples and 8 Volume per channel. And lest say we have a 24bit DAC. How would you sum up the channels without loosing precision?
| |
Marcel Verdaasdonk Netherlands
| | Posts 3977 17 Jan 2011 10:55
| Gunnar it would be cheaper but in the example would be the worst option since it would require you to load the full audio file into ChipMem and play without interval.(full length sample == full length music file) Another solution for stereo would be to use 4 channels and swap channels at each interval by cross fading them.(Volume) But this can cause a echo effect... Ugh compromise compromise. :(
| |
Thomas Richter Germany
| | (MX-Board Owner) Posts 1425 17 Jan 2011 13:37
| Marcel Verdaasdonk wrote:
| Gunnar it would be cheaper but in the example would be the worst option since it would require you to load the full audio file into ChipMem and play without interval.(full length sample == full length music file) Another solution for stereo would be to use 4 channels and swap channels at each interval by cross fading them.(Volume) But this can cause a echo effect... Ugh compromise compromise. :(
|
Don't make things more complicated than necessary. The downmix can be done by the CPU, then you only need two channels and four buffers. As long as buffer A is played, buffer B is computed. The PAULA engine is smart/strong enough as is to swap the buffers without interference, i.e. you can load a new DMA start/length while the current one is playing.However, this requires more computing power - which *may* be available on Natami. It is clearly possible on a PC. Greetings, Thomas
| |
Golgoth 27 France
| | Posts 185 17 Jan 2011 14:01
| Thierry would say (with more caps and !!!) that we found the right new coprocessor, something for doing what Thomas just said ;-)
| |
Thomas Richter Germany
| | (MX-Board Owner) Posts 1425 17 Jan 2011 14:16
| Golgoth 27 wrote:
| Thierry would say (with more caps and !!!) that we found the right new coprocessor, something for doing what Thomas just said ;-)
|
Well, I guess it really doesn't make sense to add a core for downmixing if PAULA could do the downmix itself - I didn't want to express that a coprocessor is necessary, rather that it *could* be done in principle on the CPU, if the CPU is fast enough.Realistically, I don't think 500 channels are necessary, or possible, or plausible. Having more than 4 would be nice, I guess ~32 would be a realistic option. With volume & frequency modulation you still had 8 channels for the audio output. Greetings, Thomas
| |
Thierry Atheist Canada
| | Posts 1830 17 Jan 2011 14:40
| Golgoth 27 wrote:
| Thierry would say (with more caps and !!!) that we found the right new coprocessor, something for doing what Thomas just said ;-)
|
He he he he!!!!! :-DDD
| |
Thierry Atheist Canada
| | Posts 1830 17 Jan 2011 14:51
| Thomas Richter wrote:
|
Golgoth 27 wrote:
| Thierry would say (with more caps and !!!) that we found the right new coprocessor, something for doing what Thomas just said ;-)
|
Well, I guess it really doesn't make sense to add a core for downmixing if PAULA could do the downmix itself - I didn't want to express that a coprocessor is necessary, rather that it *could* be done in principle on the CPU, if the CPU is fast enough.Realistically, I don't think 500 channels are necessary, or possible, or plausible. |
"THAT'S a lot OF GUM". (Know the reference? ;-) :-D )How BIG would a .wav file be, if that much data was provided for playback??? It can't be the conventional music files used, surely? Music files on a CD are about 700K Bytes per second, so that would make 500 channel music take up what per second, of real estate? You can see that I don't quite get what's happening here, but I can see A LOT of DATA, and it's coming from somewhere.
Thomas Richter wrote:
| Having more than 4 would be nice, I guess ~32 would be a realistic option. With volume & frequency modulation you still had 8 channels for the audio output.
|
| |
Gunnar von Boehn Germany
| | (Moderator) Posts 5775 18 Jan 2011 22:42
| Gunnar von Boehn wrote:
|
Wojtek P wrote:
| or have 500 channels or more done with simple hardware and maybe 2-3 blockrams. |
But would mixing so many channels not waste a lot of memory bandwidth? If you read 500 channels to mix them down to 2 Stereo channels. Would it be much cheaper to mix them down in advance, store a 2 channels stereo signal and just play it back? This sounds to me 250 times cheaper. BTW How would you mix the 500 channels anyway internally? Lets say you have 16bit samples and 8 Volume per channel. And lest say we have a 24bit DAC. How would you sum up the channels without loosing precision?
|
Wojtek?
| |
Wojtek P Poland
| | Posts 1597 19 Jan 2011 08:20
| Gunnar von Boehn wrote:
|
Wojtek P wrote:
| or have 500 channels or more done with simple hardware and maybe 2-3 blockrams. |
But would mixing so many channels not waste a lot of memory bandwidth?
|
500*44.1KHz 8-bit gunnar format=22MB/s assuming all play at 44.1kHz, actually each may play with different speed and usually not 500 channels are in use. So there is actually quite trivial memory bandwidth. If you read 500 channels to mix them down to 2 Stereo channels. Would it be much cheaper to mix them down in advance, store a 2 channels stereo signal and just play it back? |
Why do you have for example .mod's at all so?global volume should be settable.
| |
Ernest Unrau Canada
| | Posts 32 19 Jan 2011 08:36
| Wojtek P wrote:
|
Marcel Verdaasdonk wrote:
| Wojtek seems to be talking a channel for each tone! this means each 'different' tone has it's own channel, it is a simple idea but it would be a challenge to do this correctly.(hard to implement) |
What i mean that you CAN NOT suddenly stop sound before it will be at nearly zero volume (decayed). When you play piano and you press a key, other strings doesn't suddenly stop vibrating. When simulating piano (or other instruments) on computer you must play every tone until it decays to low level. So tens of channels are needed to realistically simulate piano. And hundreds to make real music. Yes music was done on 4 channel amiga, 16 channel GUS and even still is done. And it was great for computer made in 1985 to make quite good music. But today we have 21 century and the difference between "quite good" and "properly done" IS IMPORTANT. And there is one more important thing - PROPER low pass filtering. Paula just holds sample values for sample period on each channel. This produces aliasing, and global low pass filter is used as a crude fix. This was great for 1985, but not for 21 century. The proper is to convert given sample rate for each channel to maximum rate by simple repeating, then apply digital narrow band low pass filter to each channel centered at half the channel's sampling frequency.
|
I wish to interject here that perhaps your concept may be flawed with respect to needing hundreds of channels to generate realistic instrument sounds. But I will also admit that I haven't followed this thread in detail; nor do I know any of the nuts and bolts of this scheme, but I'd like to refer you to this link: EXTERNAL LINK (that's h t t p : / / p i a n o t e q . c o m ) and urge you to listen to the demo sounds and download the demo program and see if that changes your viewpoint. I'm thinking there may be some technology/concepts that can be leveraged in what they are doing; they describe it as the "4th generation piano". Perhaps you may find you don't have to reinvent the wheel, hmm? :-) I'm listening to to some samples even as I write. Very realistic. I don't think my computer (iMac, intel) has hundreds of channels, does it? I've mentioned this before, but I am a piano technician and a pianist. I've also done a considerable amount of midi sequencing with a Peavey DMP-2 synth. I also have several Amiga music programs, such as Dr. T's "Tiger Cub" (a very excellent sequencer program, and I'm still looking for something as good for the Mac, and GarageBand just doesn't cut it). I also have "SuperJam!" for the Amiga. SuperJam could generate some pretty decent sound (using Turbosounds) even with the classic Amiga's limited hardware resources. I was disgusted when Microsoft bought the program and mothballed it, no doubt to eliminate the competition and/or rob the software kernel for their own use. So, I'm contemplating that maybe it's not the number channels that is the issue, but instead it's the sound generation model or software "engine". After all, think what you can do via an ordinary stereo system with just two channels. The crux lies in creating the complex waveform to generate the audio. Example: I am also a ham radio operator. My son and I recently wrote a program in Amiga HiSoft BASIC to recreate the authentic sound of a landline railroad telegraph. That was in large part because we were asked to volunteer to man the railway station telegraph at the local museum's public events. I was surprised to learn that here in continental North America the railroad telegraphers never did adopt the international code (which the hams do use) but stayed more or less with Samuel Morse's original code. It was referred to as "Railroad Code" or also referred to as "American Morse". To make a long story short without the details of hows & whys for doing it, we wanted to write a tutorial and practice program for Railroad Morse. We decoded samples of telegraph audio, and extracted enough of the useful portion of the waveforms to synthesize the telegraph audio on the amiga audio channels within Basic. Because the clicks and clacks are so short we were able to produce some pretty decent and realistic telegraph-sounder audio. We set the frequency of the waveform to coincide with the sample rate and length of the telegraph audio. And it worked! I think it equated to something like 16 milliseconds of audio at 16 kHz sample rate for the click or clack duration. But what a horrible sound if we tried to increase the duration of the sound beyond the length of the array! Then you start getting repetitions of your array with a frequency of its own that corresponds to multiples of the sample repetition rate - something like 1000 ms divided by 16 ms = about 62.5 Hz and multiples thereof (I'm just describing this off the cuff from memory; I'd have to go back through the code again to verify the numbers). So in conclusion, as I see it the greatest limitation is not the number of channels (or lack) but rather lies in language limitations such as the 255 element limit that BASIC imposes for any waveform array. For instance, with Amiga Hi-Soft BASIC (and others) it's not possible to create true "white noise" because the language doesn't allow defining a waveform array that's large enough to hold sufficient waveform data to truly recreate a realistic sound. I'm nowhere near a software expert as Thomas Richter or Gunnar, nor hardware knowledgeable as Marcel, but hopefully some of my thoughts here might steer you in a useful direction. -Ernest
| |
Gunnar von Boehn Germany
| | (Moderator) Posts 5775 19 Jan 2011 08:44
| Wojtek P wrote:
| Gunnar von Boehn wrote:
| Wojtek P wrote:
| or have 500 channels or more done with simple hardware and maybe 2-3 blockrams. |
But would mixing so many channels not waste a lot of memory bandwidth? |
500*44.1KHz 8-bit gunnar format=22MB/s assuming all play at 44.1kHz, actually each may play with different speed and usually not 500 channels are in use. So there is actually quite trivial memory bandwidth. |
With 16bit samples its 50MB/sec. While this is possible is a significant number which if used will reduce your GFX rendering possibilities. 50MB/sec is many times the bandwidth of the classic AMIGAs. But how to you solve this? wrote:
| How would you mix the 500 channels anyway internally? Lets say you have 16bit samples and 8 Volume per channel. And lest say we have a 24bit DAC. How would you sum up the channels without loosing precision? |
| |
Thomas Richter Germany
| | (MX-Board Owner) Posts 1425 19 Jan 2011 09:31
| Ernest Unrau wrote:
| So, I'm contemplating that maybe it's not the number channels that is the issue, but instead it's the sound generation model or software "engine". After all, think what you can do via an ordinary stereo system with just two channels. The crux lies in creating the complex waveform to generate the audio.
|
What else to say? You nail it to the point exactly. There's no need to have 500 channels.Again, this "channel thing" is coming from a different tradition: Today, you create audio by downmixing sound effects in advance creating an audio track you just play, and you only need channels for mixing the SFX with background music with a voice channel. Thus, a small number of channels is sufficient. In the 80's "old school" coding, each individual note required an individual channel, thus the more complex the sound, the more channels you needed. The use case changed, and thus I don't see a reason to demand more audio channels than probably eight usable (times 2 for volume control under DMA, times 2 for frequency control under DMA, giving my estimate of 32 channels). So long, Thomas
| |
Gunnar von Boehn Germany
| | (Moderator) Posts 5775 19 Jan 2011 09:59
| Thomas Richter wrote:
| I don't see a reason to demand more audio channels than probably eight usable (times 2 for volume control under DMA, times 2 for frequency control under DMA, giving my estimate of 32 channels).
|
But isn't volume control and frequency control be done with 1 channel, right?
| |
Thomas Richter Germany
| | (MX-Board Owner) Posts 1425 19 Jan 2011 10:15
| Gunnar von Boehn wrote:
|
Thomas Richter wrote:
| I don't see a reason to demand more audio channels than probably eight usable (times 2 for volume control under DMA, times 2 for frequency control under DMA, giving my estimate of 32 channels). |
But isn't volume control and frequency control be done with 1 channel, right?
|
Oh my, I guess you're right. (-;So long, Thomas
| |
Wojtek P Poland
| | Posts 1597 19 Jan 2011 19:54
| Gunnar von Boehn wrote:
| With 16bit samples its 50MB/sec. While this is possible is a significant number which if used will reduce your GFX rendering possibilities. 50MB/sec is many times the bandwidth of the classic AMIGAs.
|
We are talking about Natami. 32-bit DDR2 DRAM at 400MHz DDR=3.2GB/s peak bandwidth. With many devices accessing memory in the real case and properly designed memory controller (which i assume is true in Natami) - real bandwidth is close to peak.so 50MB/s is less than 2%. And most channel will not be used at 16-bits.
| |
Gunnar von Boehn Germany
| | (Moderator) Posts 5775 19 Jan 2011 20:42
| Wojtek P wrote:
|
Gunnar von Boehn wrote:
| With 16bit samples its 50MB/sec. While this is possible is a significant number which if used will reduce your GFX rendering possibilities. 50MB/sec is many times the bandwidth of the classic AMIGAs. |
We are talking about Natami. 32-bit DDR2 DRAM at 400MHz DDR=3.2GB/s peak bandwidth. With many devices accessing memory in the real case and properly designed memory controller (which i assume is true in Natami) - real bandwidth is close to peak. so 50MB/s is less than 2%. And most channel will not be used at 16-bits.
|
OK, maybe I value 50MB more than you. But this is not the key question. The key question is: How can you MIX 512 channels without loosing the quality I've asked you this now three times. You said mixing the channels is easy, so do you have an answer to this question?
| |
Loïc Dupuy France
| | Posts 253 19 Jan 2011 23:47
| Gunnar von Boehn wrote:
| The key question is: How can you MIX 512 channels without loosing the quality
|
No miracle here, each time you mix channels, you loose bits of resolution. A simple example, you've got 2 instruments, each sample use all the 16bit range for amplitude. One instrument has a volume of 1/64 and the second has full volume. If you mix them on a 16bit channel, your first instrument will have 10bits of amplitude (loss from 16bits), and the second the full 16bits and you have to calculate their addition on 32bits (avoiding saturation), then normalize to 16 bits. So you loose amplitude resolution, and i do not ever count frequency artefact if the two samples have different frequency base. That's why amiga can be better than a pc for mods, you keep the full amplitude and frequency resolution for the 4 channels, paula does an analog mixing (infinite precision in theory :-D ) To mix 512 16bits channels without loosing quality, i would say by instincet that the non optimal way is to mix them on 8192 bits amplitude times your volume amplitude, then normalize the result on 16 bits !!!!! For frequency, it will be better to use the smallest common multiple of all the sample frequency times 2. Then normalize to 44,1khz. Or you goes to 32bitsFFP samples to have a good enough approximation :-D
| |
|
|
|
|