Archived

This topic is now archived and is closed to further replies.

StephanS

DSD Spoiler sound problem

Recommended Posts

Help AVSIM continue to serve you!
Please donate today!

Hello Niclas Try (A:AIRSPEED INDICATED,knot) 150 > (A:SPOILERS HANDLE POSITION,percent) 60 > & if{ 1 (>L:Wiper_xml_Spoiler,enum) } els{ 0 } I think the first part of the handle movment arms the spoiler so using 60 % should be past that.

Share this post


Link to post
Share on other sites

Hello and thanks alot for your help :D,.. now it works as I want itCheers :-beerchugNiclas

Share this post


Link to post
Share on other sites

>> Hello Niclas> > Try> (A:AIRSPEED INDICATED,knot) 150 > (A:SPOILERS HANDLE>POSITION,percent) 60 > & if{ 1 (>L:Wiper_xml_Spoiler,enum)>} els{ 0 }>> I think the first part of the handle movment arms the>spoiler so using 60 % should be past that.>I changed the code a little so the spoilersound is looped:(A:AIRSPEED INDICATED,knot) 150 > (A:SPOILERS HANDLE POSITION,percent) 60 > & if{ 2 (>L:Wiper_xml_Spoiler,enum) } els{ 0 (>L:Wiper_xml_Spoiler,enum) }

Share this post


Link to post
Share on other sites

This is my first post here on AVSIM and i would say hello to all you simmers.Hi Niclas,I`m also on my way in realising a separate gear and spoiler-wind-sound as feelthere did it in their addons.I`m really new to xml-programming and in the DSD-XML-SOUND-Story, so I have no idea in realising the wind sounds.But I`m happy to see a solution that works as you wrote. All threads i found in ohter forums had only questions, but no answer.This here looks very simple - great . Thank you !!I will try it this week, beacause i have`nt the DSD_XML_SOUND.GAU function on my FS. Maybe i`m doing something wrong with the DSD_XML_SOUND.INI but that`s another story...In addition, my target is to provide the spoiler-wind and gear down wind-sounds with dynamic volume. This means, when you extract thespoilers for example to 50% then the volume of the sound is about 70%, 60% spoiler means 75% volume, and so on...Read, that there is a volume-parameter for each sound, which can be set as a variable in the xml.(A:AIRSPEED INDICATED,knot) 150 > (A:SPOILERS HANDLE POSITION,percent) 60 > & if{ 2 (>L:DSD_XML_SOUND_ID00,enum) } els{ 0 (>L:DSD_XML_SOUND_ID00,enum) }(A:SPOILERS HANDLE POSITION,percent) 50 > (A:SPOILERS HANDLE POSITION,percent) 60 < & if{ 70 (>L:DSD_XML_SOUND_ID00_VOLUME,enum) }(A:SPOILERS HANDLE POSITION,percent) 60 > (A:SPOILERS HANDLE POSITION,percent) 70 < & if{ 75 (>L:DSD_XML_SOUND_ID00_VOLUME,enum) }(A:SPOILERS HANDLE POSITION,percent) 70 > (A:SPOILERS HANDLE POSITION,percent) 80 80 (>L:DSD_XML_SOUND_ID00_VOLUME,enum) }(A:SPOILERS HANDLE POSITION,percent) 80 > (A:SPOILERS HANDLE POSITION,percent) 90 < & if{ 90 (>L:DSD_XML_SOUND_ID00_VOLUME,enum) }(A:SPOILERS HANDLE POSITION,percent) 90 > (A:SPOILERS HANDLE POSITION,percent) 100 < & if{ 100 (>L:DSD_XML_SOUND_ID00_VOLUME,enum) }(Maybe it`ll be a better way to use the "SPOILER LEFT POSITION,percent" instead of the "SPOILERS HANDLE POSITION,percent" when setting the volume, to simulate the delaybetween the handle and the deflaction-movement of the model).What do you think ? Is this the way it should work, or is there a more graceful way to realise it ?Thank you...

Share this post


Link to post
Share on other sites

Hello ? Try(A:AIRSPEED INDICATED,knot) 150 > (A:SPOILERS HANDLE POSITION,percent) 60 > & if{ 2 (>L:DSD_XML_SOUND_ID00,enum) } els{ 0 (>L:DSD_XML_SOUND_ID00,enum) }(A:SPOILERS HANDLE POSITION,percent) s0 50 59 l0 rng if{ 70 } 60 69 l0 rng if{ 75 } 70 79 l0 rng if{ 80 } 80 89 l0 rng if{ 90 } 90 100 l0 rng if{ 100 }(>L:DSD_XML_SOUND_ID00_VOLUME,enum)

Share this post


Link to post
Share on other sites

Wow,thanks for your quick reply. Seems i have a lot to learn. I will give it a try tonight :)

Share this post


Link to post
Share on other sites

Hi PVE,the solution you posted here did not work for me. I have to find out why, but when I insert the lines above the sound does not play anymore.Maybe something with my DSD-XML-config is still wrong. The volume-parameter was added to the ini-file and i also tried to add the command for setting the volume-value for the soundvariable in addition...(A:AIRSPEED INDICATED,knot) 150 > (A:SPOILERS HANDLE POSITION,percent) 60 > & if{ 2 (>L:DSD_XML_SOUND_ID00,enum) } els{ 0 (>L:DSD_XML_SOUND_ID00,enum) }(A:SPOILERS HANDLE POSITION,percent) s0 50 59 l0 rng if{ 70 } 60 69 l0 rng if{ 75 } 70 79 l0 rng if{ 80 } 80 89 l0 rng if{ 90 } 90 100 l0 rng if{ 100 }(>L:DSD_XML_VOLUME,enum) 3 (>L:DSD_XML_SOUND_ID00,enum)BTW: my solution from above also did not work (the sound plays, but doesn`t change the volume). I will provide, if i find out the problem.Cheers...

Share this post


Link to post
Share on other sites

Hi,(L:DSD_XML_SOUND_ID00,enum) will always be 3Is that your intention?Jan

Share this post


Link to post
Share on other sites

Hi Jan,yes: the documentation of the dsd-xml-sound says, that a value of1 = plays the sound2 = loops the sound (set in the conditional IF above)3 = sets the volume of the desired soundfile (DSD_XML_SOUND_ID00 in that case) to the value of the Volume-Variable (DSD_XML_VOLUME).My DSD-XML.INI contains:[LVars]Lvar00=dsd_xml_sound_id00VolumeVar=DSD_XML_VOLUME[sounds]Sound00=./Sound/dsd/spoilerwind.wavI thougt, that the soundfile DSD_XML_SOUND_ID00 will loop and also the volume for it will be set every processing-interval of the gauge according to the volume-parameter.

Share this post


Link to post
Share on other sites

Hi,May be i am wrong, will have a look in my files later(at work!),but it looks like (L:DSD_XML_SOUND_ID00,enum) will never be 0, 1 or 2, so you will here no sound.Try without that command.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi,Found some code from under the dust:I activated the sound somewhere in a click area, arm spoiler or something, and then the position of the spoiler determines the volume.Tested:(>K:SPOILERS_ARM_TOGGLE) 2 (>L:spoiler sound,number) 75 (>L:dsd_xml_sound_volume,number)(A:SPOILERS HANDLE POSITION,percent) 60 > if{ 3 (>L:spoiler sound,number) } (A:SPOILERS HANDLE POSITION,percent) s0 50 59 l0 rng if{ 80 } 60 69 l0 rng if{ 85 } 70 79 l0 rng if{ 90 } 80 89 l0 rng if{ 95 } 90 100 l0 rng if{ 100 } (>L:dsd_xml_sound_volume,number) And it worked...Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Sorry folks,thought in the wrong direction. You are definetly right.Without setting the sound to this specific sound-variable it works.Thank you Jan and pve :-) May be, i have to set the volume to a specific soundfile at another point in my gauge, because I`m planning to add a wind-sonud for the undercarriage as well.Maybe setting the volume to the sound itself should only occur, when the SPOILER HANDLE POSITION changes. Then i will increase the update frequency of the gauge and this should work. I will give it a try and come back here...

Share this post


Link to post
Share on other sites

>Hi,>>Found some code from under the dust:>>I activated the sound somewhere in a click area, arm spoiler>or something, and then the position of the spoiler determines>the volume.>>Tested:>>>(>K:SPOILERS_ARM_TOGGLE) >2 (>L:spoiler sound,number) >75 (>L:dsd_xml_sound_volume,number)>>>>>(A:SPOILERS HANDLE POSITION,percent) 60 > >if{ 3 (>L:spoiler sound,number) } >(A:SPOILERS HANDLE POSITION,percent) s0 >50 59 l0 rng if{ 80 } >60 69 l0 rng if{ 85 } >70 79 l0 rng if{ 90 } >80 89 l0 rng if{ 95 } >90 100 l0 rng if{ 100 } >(>L:dsd_xml_sound_volume,number) >>>And it worked...>>>Jan>>"Beatus ille qui procul negotiis..."Hi Jan,i will try it. Thanks !

Share this post


Link to post
Share on other sites

Sorry people,i can`t get it to work. I have searched other Threads to find something that helps, but without success. So here is the question of the questions : Is it possible to change the volume while the sound is playing, or is it just possible to change the volume for the netxt time the sound is played ?(A:SPOILERS HANDLE POSITION, percent) 30 > (A:SPOILERS HANDLE POSITION, percent) 39 80 (>L:dsd_xml_sound_volume, number) }(A:SPOILERS HANDLE POSITION, percent) 40 > (A:SPOILERS HANDLE POSITION, percent) 49 < & if{ 85 (>L:dsd_xml_sound_volume, number) }(A:SPOILERS HANDLE POSITION, percent) 50 > (A:SPOILERS HANDLE POSITION, percent) 59 < & if{ 90 (>L:dsd_xml_sound_volume, number) }(A:SPOILERS HANDLE POSITION, percent) 60 > (A:SPOILERS HANDLE POSITION, percent) 69 < & if{ 92 (>L:dsd_xml_sound_volume, number) }(A:SPOILERS HANDLE POSITION, percent) 70 > (A:SPOILERS HANDLE POSITION, percent) 79 < & if{ 95 (>L:dsd_xml_sound_volume, number) }(A:SPOILERS HANDLE POSITION, percent) 80 > (A:SPOILERS HANDLE POSITION, percent) 89 < & if{ 97 (>L:dsd_xml_sound_volume, number) }(A:SPOILERS HANDLE POSITION, percent) 90 > (A:SPOILERS HANDLE POSITION, percent) 100 < & if{ 100 (>L:dsd_xml_sound_volume, number) }and then set a "3" to the Sound control variable like3 (>L:DSD_XML_SOUND_ID01, number)In this manner i can`t hear the sound any more, even if these commands are followed by the conditional "play"command:...(A:SIM ON GROUND,bool) 0 == (A:SPOILERS HANDLE POSITION, percent) 31 > & if{ 2 (>L:DSD_XML_SOUND_ID01, enum) } els{ 0 (>L:DSD_XML_SOUND_ID01, enum) }...Whithout setting the sound-control variable to 3 it works, but only when i trigger the sound variable in the "if" condition with a "1" and not a "2" for looping the sound. The trigger is then the update rate of the gauge, but the volume changes only with the new begin of the wav-file played. This is all dissatisfactory.Have i misunderstood the volume-changing in DSD_XML ? Is it possible to change the volume while playing the sound and take the effectdirectly to the looped sound ? Or is it the intention of the DSD_XML_SOUND to change the volume for each new wav-cycle only ? I use thedsd_xml_sound3.gau - Version 3.7.0.0Thank you by the way for your gentle support and Douglas Dawson for this gauge !

Share this post


Link to post
Share on other sites

Hi,You can change the volume while playing a soundloop.Probably you cannot put the sound on and change volume together from within tags.So maybe you need first to put the sound on in a (see upstairs)You can make a small gauge to read the values of the sound command in a string, so you can see what happens.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

You should be able to dynamically change the volume of any playing sound.Remember though, you can only change the value of a particular LVar once on any given gauge update.Doug

Share this post


Link to post
Share on other sites

Hi Doug & JanThank you for the hints.I will try it with the definition. And i will build a separate gauge for dispaynig the variables for me to control while programming.I won't settle for less. :-)

Share this post


Link to post
Share on other sites

OK, i made it.Thanks another time for your help.Double times using a value for the sound-variable was the problem.Now i activate the sound (sound loop with the value "2") via a button i build into the panel and change the volume via a section.An improvement i made: i used the "SPOILER LEFT POSITION" instead of the "... HANDLE POSITION", because it simulate the real spoilermovement that the sounds are intended for ( the left side and the right side are checked, and the greater value is used )The only thing left is: Is it an effective way to play the sound the whole time keeping its volume to zero ?But i have found no other solution in activating and setting-the-volume in once as the double does not function.For anybody here feel free with the following lines (but if you find improvements please post them here):SpoilerSound ON/OFF(G:Var1) ! (>G:Var1) (G:Var1) 0 == if{ 0 (>L:DSD_XML_SOUND_ID01, number) } els{ 2 (>L:DSD_XML_SOUND_ID01, number) }(G:Var1)(A:SPOILERS LEFT POSITION, percent) (A:SPOILERS RIGHT POSITION, percent) > if{ (A:SPOILERS LEFT POSITION, percent) (>G:Var2, percent) } els{ (A:SPOILERS RIGHT POSITION, percent) (>G:Var2, percent) }(G:Var2, percent) 0 > (A:SIM ON GROUND, bool) 0 == & if{ (G:Var2, percent) (>L:dsd_xml_sound_volume, enum) } els{ 0 (>L:dsd_xml_sound_volume, enum) } 3 (>L:DSD_XML_SOUND_ID01, number)

Share this post


Link to post
Share on other sites

Continually playing a sound at zero volume is very inefficient. You will be better off comparing the current required volume against the last volume you set. Reset the volume when the difference becomes significant.Doug

Share this post


Link to post
Share on other sites

Hi Doug,i`ve activated the loop-sound (value=2) in the section, because setting it also in a section did not function. This, because i set the volume (value=3) in a section where i associate it with the spoilers-position. To avoid hearing the sound the whole flight, i set the volume to zero, when no spoiler is active.Is there a way to combine setting the sound to "2" for the loop and "3" for accepting the volume setting, both in a section ?In this case i can condition the loop-playcommand for the sound only when the spoilers go out.Thanks ! :-)

Share this post


Link to post
Share on other sites

Perhaps nobody home ?!I made a gauge based on dsd_xml_sound for the spoilers to generate a wind sound, when they are used. I activate the sound-loop by mouseclick and change the volume in a section as shown above (3 posts back).I made another gauge wich generate a wind-sound of the lowered undercarriage. It works also with the sound-loop-activation by a mouseclick and the volume-setting in a section.My problem: when i install both gauges in a panel. one of them does not work, although i set the volume to the specific sound. I tried to combine both gauges in one, but the same problem persists.Most times it is the spoiler-sound that don`t work, and it semms to be important wich gauge you enable first by mouseclick.Please, who can give me a hint to the detail, what went wrong ?Do i have this right, that i have the possibility with dsd-xml-sound to play simultaneous sounds with different trigger-conditions and different volumes ? I thought this is contained in the manual.Here`s my dsd-ini-file:=======================[Config]MaxSounds=4ErrorFlag=0ResetVolumeVar=1 //i also tried 0 but didn`t help !LvarStop=soundstopVolumeVar=dsd_xml_sound_volume[LVars]Lvar00=DSD_XML_SOUND_ID00Lvar01=DSD_XML_SOUND_ID01[sounds]Sound00=./Sound/dsd/gearair.wavSound01=./Sound/dsd/spoilerair.wavHere`s the second gauge i programmed in addition to the spoilerwindsound above - they don`t work togehter :================================================================Gear-Wind-Sound ON/OFF(G:Var1) ! (>G:Var1) (G:Var1) 0 == if{ 0 (>L:DSD_XML_SOUND_ID00, number) } els{ 2 (>L:DSD_XML_SOUND_ID00, number) }(G:Var1)(A:AIRSPEED INDICATED, knots) s0 0 50 l0 rng if{ (A:AIRSPEED INDICATED, knots) } 50 60 l0 rng if{ 81 } 60 70 l0 rng if{ 82 } 70 80 l0 rng if{ 83 } 80 90 l0 rng if{ 84 } 90 100 l0 rng if{ 85 } 100 110 l0 rng if{ 86 } 110 120 l0 rng if{ 87 } 120 130 l0 rng if{ 88 } 130 140 l0 rng if{ 89 } 140 150 l0 rng if{ 90 } 150 160 l0 rng if{ 91 } 160 170 l0 rng if{ 92 } 170 180 l0 rng if{ 93 } 180 190 l0 rng if{ 95 } 190 200 l0 rng if{ 95 } 200 210 l0 rng if{ 96 } 210 220 l0 rng if{ 96 } 220 230 l0 rng if{ 96 } 230 240 l0 rng if{ 97 } 240 999 l0 rng if{ 98 }(>G:Var2)(A:GEAR CENTER POSITION, percent) 0 == if{ 0 (>L:dsd_xml_sound_volume, enum) } els{ (A:GEAR CENTER POSITION, percent) 4 * 20 / 80 + 100 / (G:Var2) * (>L:dsd_xml_sound_volume, enum) } 3 (>L:DSD_XML_SOUND_ID00, number)Thank you...Hopefully

Share this post


Link to post
Share on other sites