FSX DSD_xml_sound - extra sim status variables/volume control?

Heretic

Resource contributor
#1
I'm trying to make a looped sound play in spot view only, but I can't get a return from the (L:ViewSystemStatus, number) variable built into dsd_xml_sound.

Same thing with (L:FSSimIsPaused, number) for stopping sounds when FSX is paused.

Both variables always return zero, regardless of view or sim state. :confused:

The gauge version is v5.2.0 (jul/aug 2014)*. FSX version is the Steam Edition. All SimConnect versions (RTM, SP1, SP2/Acc, SE) are installed.

Not sure whether this is a gauge bug or a remotely possible incompatibility with the Steam Edition, but can anyone confirm this? o_O


*http://douglassdawson.ca/
 
#2
FSX Gold Both variablen work with me!

For the view-status you could use
Code:
(C:SIMVARS:Current View Mode,Number)
// (L:ViewSystemStatus,number) ** 0 – Outside (spot) view. ** 1 – 2D cockpit view ** 2 – 3D VC view ** 4 – Orthogonal (map) view

Some for the simvar
 

ddawson

Resource contributor
#4
What is the (L:SimConnected, bool) variable returning?
If I get a chance in the next day or two, I'll try loading the thing in SE myself.

Doug
 
#5
I use this to determine if the sim is paused:

Code:
0 1 (P:ABSOLUTE TIME,seconds) (G:Var1,number) == ? (>L:SimRunning,bool)
(P:ABSOLUTE TIME,seconds) (>G:Var1,number)
 

Heretic

Resource contributor
#6
What is the (L:SimConnected, bool) variable returning?
If I get a chance in the next day or two, I'll try loading the thing in SE myself.
"1", weirdly enough.


I use this to determine if the sim is paused:

Code:
0 1 (P:ABSOLUTE TIME,seconds) (G:Var1,number) == ? (>L:SimRunning,bool)
(P:ABSOLUTE TIME,seconds) (>G:Var1,number)
Genial einfach - einfach genial. Danke!
 
Last edited:

taguilo

Resource contributor
#7
It's even more simple:

Code:
(P:ABSOLUTE TIME,seconds) (G:Var1,number) == ! (>L:SimRunning,bool)
..or...
(P:ABSOLUTE TIME,seconds) (G:Var1,number) == (>L:SimPaused,bool)
....
(P:ABSOLUTE TIME,seconds) (>G:Var1,number)
All comparisons place a bool 1 (equal) or 0 (different) value on the stack.

Tom.
 
Last edited:

Heretic

Resource contributor
#8
I've amended the thread title because I'm expanding my inquiry a bit.

First, Tom's pause detection code somehow only does after toggling pause at least once. Steven's always works.


Second, I need an example or help for/with volume control via XML_sound. Or I think I ran into a bug.

While there's a few threads on the subject, none of the solutions proposed there work for me and the readme for DSD_XML_sound doesn't contain any working examples and too little info on required syntax, limitations and other caveats.

Below is a working example for an APU sound environment.
Code:
  (A:APU PCT RPM, percent) 5 >
  (L:APU State, number) 0 == and
  if{ 1 (>L:APU_Start, number) 1 (>L:APU State, number) }
  
  (A:APU PCT RPM, percent) 98 >
  (L:APU State, number) 1 == and
  if{ 0 (>L:APU_Start, number) 2 (>L:APU_Run, number) 2 (>L:APU State, number) }
  
  (A:APU PCT RPM, percent) 98 <
  (L:APU State, number) 2 == and
  if{ 0 (>L:APU_Run, number) 1 (>L:APU_Stop, number) 3 (>L:APU State, number) }
  
  (A:APU PCT RPM, percent) 5 <
  (L:APU State, number) 3 == and
  if{ 0 (>L:APU_Stop, number) 0 (>L:APU State, number) }
The sounds play just fine, but I want them to be quieter in the VC, so I'm using the default volume control variable to set the volume depending on the view.

Code:
(C:SIMVARS:Current View Mode,Number) 2 ==
  if{ -2000 (>L:dsd_xml_sound_volume_in, number) }
  (C:SIMVARS:Current View Mode,Number) 0 ==
  if{ 0 (>L:dsd_xml_sound_volume_in, number) }
The play/loop mode number for volume (and pan) controlled sounds is 7 and 8 respecively, so (without posting the entire code above):
Code:
...
  if{ 7 (>L:APU_Start, number) 1 (>L:APU State, number) }

...
  if{ 0 (>L:APU_Start, number) 8 (>L:APU_Run, number) 2 (>L:APU State, number) }
  
...
  if{ 0 (>L:APU_Run, number) 7 (>L:APU_Stop, number) 3 (>L:APU State, number) }
  
...
  if{ 0 (>L:APU_Stop, number) 0 (>L:APU State, number) }
Since the script is processed linearly, all APU sounds should inherit the volume setting specifed above. With the slight difference that they don't, because I'm can't hear a thing.

One variation I've tried, without success, is this one:
Code:
(C:SIMVARS:Current View Mode,Number) 2 ==
  if{ -2000 (>L:dsd_xml_sound_volume_in, number)
  3 (>L:APU_Start, number)
  3 (>L:APU_Run, number)
  3 (>L:APU_Stop, number) }
  (C:SIMVARS:Current View Mode,Number) 0 ==
  if{ 0 (>L:dsd_xml_sound_volume_in, number)
  3 (>L:APU_Start, number)
  3 (>L:APU_Run, number)
  3 (>L:APU_Stop, number) }

Also a very simple one like this one...
Code:
(C:SIMVARS:Current View Mode,Number) 2 ==
if{ -2000 (>L:dsd_xml_sound_volume_in, number) }
(C:SIMVARS:Current View Mode,Number) 0 ==
if{ 0 (>L:dsd_xml_sound_volume_in, number) }

(A:APU PCT RPM, percent) 98 >
if{ 8 (>L:APU_Run, number) }
...or this one...
Code:
(A:APU PCT RPM, percent) 98 >
if{ (C:SIMVARS:Current View Mode,Number) 2 == if{ -2000 (>L:dsd_xml_sound_volume_in, number) } (C:SIMVARS:Current View Mode,Number) 0 == if{ 0 (>L:dsd_xml_sound_volume_in, number) } 8 (>L:APU_Run, number) }
...does not work.

The config says:
Code:
...
VolumeVarIn=dsd_xml_sound_volume_in
...
Sound19=Sounds\xapu_starter.wav
Sound20=Sounds\xapu.wav
Sound21=Sounds\xapu_shutdown.wav
...
Lvar19=APU_Start
Lvar20=APU_Run
Lvar21=APU_Stop


What am I doing wrong?
Or is this a bug at work?
 
#9
In my understanding Doug introduced a new volume and pan control separately for any soundvariable since version 5 (5.20)
Explanation in the zip file "new for version 5.txt" Also "dsd_fsx_xml_sound.ini"
I 'm also interested in this. But had no time to play around with this.
Otherwise Doug hopefully will help us.

Edi
 

Heretic

Resource contributor
#10
Still won't work.

Code:
(C:SIMVARS:Current View Mode,Number) 2 ==
if{ -1000 (>L:APU_Volume,number) }
(C:SIMVARS:Current View Mode,Number) 0 ==
if{ 0 (>L:APU_Volume,number) }
The sound variable correctly changes values based on the current view mode.

Test code:
Code:
(A:APU PCT RPM, percent) 98 >
if{ 8 (>L:APU_Run, number) }
.ini:
Code:
Lvar19=APU_Start
Lvar20=APU_Run
Lvar21=APU_Stop

[Volume_Variables]
Lvar19=APU_Volume
Lvar20=APU_Volume
Lvar21=APU_Volume
 

taguilo

Resource contributor
#11
First, Tom's pause detection code somehow only does after toggling pause at least once. Steven's always works.
Actually my code and Steven's give the same result, hence both always work the same. There must be no difference in FSX performance.

Tom
 
Top