![]() |
![]() |
#141 | |
Registered User
Join Date: Jan 2016
Location: Knivsta / Sweden
Posts: 20
|
That ratio was chosen to explain the principle with a minimum of code.
Quote:
In a thread called "More than 4 sound channels - how it works", I'd say the answer is yes. |
|
![]() |
![]() |
#142 | |||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Quote:
Quote:
But let's admit we have them. Now do you think the music (or whatever's gonna be played) will gently not change its pitch for durations that are always multiple of 107 and 101 samples ? The number of samples to be played if using some timing like the vbl is also apparently required to be a multiple of this size and obviously it won't. 16khz (higher than what this mixing code will handle) is just 320 samples per vbl. So with lower frequencies you're in the range of these 101 or 107 samples. If you have 107 to do but the intended duration is 150, what will you do ? Quote:
![]() This seems to be purely theoretical and has no practical use at all. So i don't see the point. I want things that have some use in the real world. Normal mixing has some. This one has none. |
|||
![]() |
![]() |
#143 |
Registered User
Join Date: Jan 2016
Location: Knivsta / Sweden
Posts: 20
|
Well, how about not starting the loop at the first instruction, but entering it at 6*(the number of output bytes to skip), so it will generate fewer bytes on the first iteration? Then, one can control the number of generated bytes precisely.
|
![]() |
![]() |
#144 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
So what's missing now is only someone to actually write the code, huh ?
|
![]() |
![]() |
#145 | |
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
Quote:
And to answer your question to me in an earlier post: 1) I don't have the source codes to any mixing routine* 2) I mostly coded mixing routines for PC optimized for 16+ channels on 80486 and low end 16 bit systems 3) as my code wasn't optimized for a 68000 it is surely irrelevant (even though the concepts and optimizations could be ported to 68000)? (* Nor for other pre-2000 developments, partially because I was stupid and deleted stuff and partially because of a crash of a system with no backup. Guess that was me being stupid in that case too) |
|
![]() |
![]() |
#146 |
Registered User
Join Date: May 2014
Location: inside the emulator
Posts: 377
|
Of course and that it a technique used often with generated code. But we are discussing with somebody that seem to think things he hasn't used or heard of is not practical...
|
![]() |
![]() |
#147 |
Registered User
Join Date: Jan 2016
Location: Knivsta / Sweden
Posts: 20
|
Megol, in an earlier post you wrote Reduce the number of sample frequencies + use generated code for changing pitch. Did that refer to something like the dedicated-routines-per-ratio I've tried to describe or something else?
|
![]() |
![]() |
#148 | |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
It was originally about how existing implementations work, but since we've pretty much exhausted that, it's fine to talk about improvements or alternatives, and i don't mind if it's for unexpanded A500, A1200, or Amigas with fast RAM or accelerators. As long as it's for 680x0 and our humble four-channel Paula. It's ok whether you've actually written something or just have an idea. But it is not ok to do petty squabbling and name calling. Right. As far as fixed ratios go, musical notes in the Western scale are not in whole number ratios. Hundreds of years ago people used to tune instruments like that, which can sound quite odd to modern ears, now we are used to "twelve tone equal temperament", or 12TET, that renders all the different keys sounding the same. When Johann Sebastian Bach composed The Well-Tempered Clavier, he had in mind an instrument tuned a particular way (Well Temperament) that made each key have a different character. A lot of musical intervals are still customarily described in terms of simple ratios (a pure fifth, for instance, is a 3:2 ratio) but real instruments are no longer tuned that way. Equal Temperament notes are defined such that every semitone is exactly the same interval, such that each note is calculated by 2^(n/12). This yields a fifth that is very close to pure, but is very slightly off: 2^(7/12) = 1.49830708... Of course, neither simple ratios nor equal temperament are exactly possible to reproduce on the Amiga anyway. |
|
![]() |
![]() |
#149 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Because i'm pretty sure it wouldn't work ?
Quote:
But i already said that. Sometimes people just don't read. Quote:
But writing some more code "from scratch" isn't difficult. Normal 8-bit mixing code looks like this : Code:
add.w a0,d1 addx.l d2,d3 move.b (a2,d3.l),d0 move.b (a3,d0.w),d0 add.w a1,d5 addx.l d6,d7 move.b (a4,d7.l),d4 add.b (a5,d4.w),d0 roxr.b #1,d0 move.b d0,(a6)+ ![]() And doesn't work well here but that's another story. Where's the sense in that ? |
||
![]() |
![]() |
#150 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
A3 and A5 are presumably the volume multiplication tables... but why are there two of them?
|
![]() |
![]() |
#151 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
|
![]() |
![]() |
#152 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
oh, i thought the upper byte of D0/D4 took care of that already.
Edit: and speaking of volume tables, we really only need to adjust the volume of one channel, because we could set the physical volume of the audio channel to whichever is the louder of the two and then only multiply the other one. Last edited by Mrs Beanbag; 28 January 2016 at 21:25. |
![]() |
![]() |
#153 |
Registered User
Join Date: Jan 2016
Location: Knivsta / Sweden
Posts: 20
|
Cool that roxr.b #1,d0 seems to work for halfing the sum whether we're dealing with signed or unsigned values, when one normally has to pick either logic or arithmetic shift.
|
![]() |
![]() |
#154 | |
Registered User
Join Date: Jan 2016
Location: Knivsta / Sweden
Posts: 20
|
Quote:
![]() |
|
![]() |
![]() |
#155 | |
Code Kitten
![]() Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
|
Quote:
This said I might be wrong but I have a hunch that Pandy71 knows more about this than I do and can correct me if needed. ![]() |
|
![]() |
![]() |
#156 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Quote:
Quote:
![]() Anyway, this defeats the signed to unsigned conversion in the volume table and therefore involves sample conversion at startup. Quote:
If we mix two signed values being $E0 and $00, the normal signed result should be $F0 for the average. But we would get $70 instead... So, even though the volume table can include the conversion for the input, some other code has to convert the output back to signed (or we add some eori.b #$80,d0 after the roxr). Quote:
![]() |
||||
![]() |
![]() |
#157 | ||
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
Quote:
It is possible for the Amiga to reproduce all of the classical ratio intervals individually, but it would not be easy to do them all at the same time, although thinking about it, it might work if starting with a base period of 360, which is highly composite. Edit: yes it is possible to do the following octave in Just Intonation: C: 360 D: 320 (9:8) E: 288 (5:4) F: 270 (4:3) G: 240 (3:2) A: 216 (5:3) B: 192 (15:8) C: 180 (2:1) 360 is not a C on the Amiga though, it is more like a D# The first semitone lies on 337.5, however... so best stick to the white notes Last edited by Mrs Beanbag; 29 January 2016 at 14:02. |
||
![]() |
![]() |
#158 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,355
|
Indeed ; it's just that i found it pretty much unimportant.
|
![]() |
![]() |
#159 |
Registered User
Join Date: May 2013
Location: Grimstad / Norway
Posts: 853
|
So mixing two channels then both channels are stretched to a fixed frequency?
Would the sound be shyte if you used the frequency of the channel with the highest frequency, stretched only the lower freq channel to match it, and then mixed them? (Saving cycles on stretching one channel.) |
![]() |
![]() |
#160 | |
Code Kitten
![]() Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
|
Quote:
|
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
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 |
|
|