Supersonic Audio

21 Jul 2020 15:51 #47606 by Richard
This is still on my list; and after reviewing the comments I think we agree that the logic should be changed as follows

* Volume cannot be < 0 (during any iteration)
* Volume will be multiplied as per my example(1)
* Offset will be used as per my example(1)

If there are no other opinions then I can get this fixed.

I'm not going to backport this fix as it could break aircraft - and the next release after 2020 is long enough in the future that we can break things and fix them before the release, helped by more testing on FGAddon aircraft.
The following user(s) said Thank You: Algernon, Avionyx

Please Log in or Create an account to join the conversation.

21 Jul 2020 16:34 #47607 by timi
Sounds good. Thanks Richard.

Please Log in or Create an account to join the conversation.

30 Jul 2020 23:34 #47748 by Richard
Changes made to simgear next; commit 3643f1c0

I slightly changed the logic so that the offset was added (in the -ve case) and -ve offsets are permitted.

Results
update(): Have 3 volume entries
 --> 0:prop /a[0]/v1[0] => 0.110000 factor = 0.100000 v=0.011000 offset 0.000000, now 0.000000, v=0.011000 vol=0.011000 ==> 0.011000
 --> 1:prop /a[0]/v2[0] => 0.120000 factor = 3.000000 v=0.360000 -ve offset 1.000000 1.360000 = 0.014960  ==> 0.014960
 --> 2:prop /a[0]/v3[0] => 0.130000 factor = 1.000000 v=0.130000 -ve offset 1.000000 1.130000 = 0.016905  ==> 0.016905
The following user(s) said Thank You: Algernon

Please Log in or Create an account to join the conversation.

31 Jul 2020 10:55 #47750 by Richard
I'm changing the README.xmlsound to document this better;
  <volume> / <pitch>
        Volume or Pitch definition. Currently there may be up to 5
        volume and up to 5 pitch definitions defined within one sound
        event. 

        The volume elements are processed as follows

          total_offset = 0
          total_volume = 1.0

          for each <volume> element:

            (a) Use either <property> or <internal> as the base value
            (b) apply any <type> function to the value
            (c) value = value * factor
            (d) value = max(value, <max>)
            (e) value = min(value, <min>)
            (f) if <factor> was originally negative then use
                offset-mode otherwise use normal mode

                (normal-mode) 
                  total_offset = total_offset + offset
                  total_volume = total_volume * value

                (offset-mode) 
                  value = value + offset
                  total_volume = total_volume * value

        Then after processing all of the <volume> blocks the total
        volume will be determined by

           volume  = total_offset + total_volume;

Please Log in or Create an account to join the conversation.

Time to create page: 0.327 seconds
Powered by Kunena Forum

Latest Forum Posts

PM Notifications

You are not logged in.

PM Mailbox

You are not logged in.

Latest updated downloads