Sign in to follow this  
phjvh

XML Sound Gauge

Recommended Posts

Hello,first of all I have to say that I am very new to this topic (gauges).I am not an experiend XML programer so I need help fromyou.I would like to set a special sound to an event likegear up = sound01gear down = sound02flaps01 = soundxyzflaps05 = soundxyzand so on...Could please anybody help me how I can solve this withthis xml sound gauge from Doug Dawson...File at AVSIM = dsd_xml_soundThanks in advance.MarcP.S.Sorry for my bad english..

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Marc,What the XML_Sound gauge does is associate a sound file with each ADF2 frequency between 200 and 299 (play once sounds) and 300 to 399 (looping sounds). When the gauge detects that a particular frequency has been set (by your XML gauge) it will play the corresponding sound.To play your gear up sound, you would name it dsd_xml_01.wav; you would then have your gear gauge set the ADF2 frequency to 201 when it retracted the gear.Doug

Share this post


Link to post
Share on other sites

Marc,This is a quick and dirty mouse click section: 33554432 (>K:ADF2_COMPLETE_SET) 0 (>K:GEAR_TOGGLE)If you look in the file ADF2_Frequency_BCD.rtf included in the gauge archive, it includes the BCD codes for each ADF2 frequency. Remember, we are just using ADF2 as a convenient way to allow the XML gauge to convey information to my sound gauge. When the gauge detects a change in the ADF2 frequency, it will play the sound whose number is the same as the last two digits of the new ADF2 frequency.Doug

Share this post


Link to post
Share on other sites

Working with that huge conversion table was pretty tough on me. So I once wrote a macro (read: "stole" from Microsoft :)) to do the conversion, making things easier to "work with". Goes something like this:---SNIP---200 + 10000 * s010 % (>L:ADFConversionTemp,number)l0 10 / flr 10 % 16 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 100 / flr 10 % 256 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 1000 / flr 10 % 4096 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 10000 / flr 10 % 65536 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 100000 / flr 10 % 1048576 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 1000000 / flr 10 % 16777216 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 10000000 / flr 10 % 268435456 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)(L:ADFConversionTemp,number) (>K:ADF2_COMPLETE_SET)300 + 10000 * s010 % (>L:ADFConversionTemp,number)l0 10 / flr 10 % 16 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 100 / flr 10 % 256 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 1000 / flr 10 % 4096 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 10000 / flr 10 % 65536 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 100000 / flr 10 % 1048576 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 1000000 / flr 10 % 16777216 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)l0 10000000 / flr 10 % 268435456 * (L:ADFConversionTemp,number) + (>L:ADFConversionTemp,number)(L:ADFConversionTemp,number) (>K:ADF2_COMPLETE_SET)---SNIP---Use like this:2 @PlayS to play sound "dsd_xml_02.wav" once.15 @PlayL to play sound "dsd_xml_15.wav" in loop.I've had problems getting certain loops to play nicely without gaps in the sound, but I'm sure it's just me :) I now have a nice set of sounds, a shitload of clicksounds, airframe stress, parking brake on/off. Ahh, life is good :)

Share this post


Link to post
Share on other sites

Hi,There is a lot of knowledge shown in all answers to Marc, but being as he probably is, not really skilled with program codes, he ( an I) just would like some concrete example for getting a specific sound run:I need for instance following1. ( When ) Gear_down_set (then) trigger up (ADF code) 50397184 which means I believe 301 (run a loop sound)2. (When) Flaps_set_30

Share this post


Link to post
Share on other sites

Hi,Example(works for me):Look for a ...wav file with the callout: "Minimums!!!" (Or whatever sound)Give that sound the proper dsd-xml-...wav name (Look in the Read Me)Look for the proper code, no loop (........)Make an element in an xml gauge of your choice with this kind of code:(A:Indicated Altitude,feet) 100 < (A:Indicated Altitude,feet) 90 > &&if{ ........ (>K:ADF2_COMPLETE_SET) } els{ (0) }Now every time the plane descends below 100 ft you will hear the call:"Minimums"!!You can vary the (A:Var's) and sounds and add a lot more conditions.(A:...,...) or (L:....,...) or (G:Var)if{ ........ (>K:ADF2_COMPLETE_SET) } els{ (0) }In your case:(Throttle position in reverse)if{ "reverse-sound" (>K:ADF2_COMPLETE_SET) } els{ (0) }Hope it Helps.Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Hi Jan,Thanks for your reply.you wrote:In your case:(Throttle position in reverse)if{ "reverse-sound" (>K:ADF2_COMPLETE_SET) }els{ (0) }How does the Xml gauge know that the throttle are reversed????I am probably dumb but cannot understand since Throttle position in reverse seems not to be an event, or do am I wrong

Share this post


Link to post
Share on other sites

Hi,I didn't, but you can try something with:(A:TURB ENG1 REVERSE NOZZLE PERCENT,percent) 2 >if{ "reverse-sound" (>K:ADF2_COMPLETE_SET) }els{ (0) }Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Jan,He, the lack of good english. I do probably explain my problem from the wrong side.Now you "suggest" (A:Turb ENG1 reverse nozzle percent, percent) 2 My 1. question:Where can I find these commands list. Does such a list exist ???My 2. question:is "reverse-sound" a command or an event or something else ??My 3. question:Where do I set the ADF value which may trigger the sound ???Sorry, I am a bit complicated, and it seems so obvious for you, but I am a real cruck as regards programming.Thanks for your patienceRoger

Share this post


Link to post
Share on other sites

Roger,That list exist, but is probably not accessible.Take a look in the FAQ's!(A:TURB ENG1 REVERSE NOZZLE PERCENT,percent) 2 >is an existing value in one of the lists, a so called "Token Variable".If you press F2 on the keyboard the engines will go in reverse.The value upstairs means that when the reverser valves are more then 2 percent out of normal, an event is triggered, your sound."reverse-sound" means nothing.fill in here the code which you can find in the documentation of Doug Dawson. e.g. 23445576 so the value section in the element must be:(A:TURB ENG1 REVERSE NOZZLE PERCENT,percent) 2 >if{ 23445576 (>K:ADF2_COMPLETE_SET) }els{ (0) }Give it a try, but look for the proper 12345678!!!Jan"Procul Negotiis"

Share this post


Link to post
Share on other sites

Jan I apologize for having been so complicated, but now I guess I got it.Many thanksRoger

Share this post


Link to post
Share on other sites

Hi,just another question...(A:AIRSPEED INDICATED, knots) 80 > (A:AIRSPEED INDICATED, knots) 83 < &&if{ 33619968 (>K:ADF2_COMPLETE_SET) } This code works very well but I get the callout also after landing.How can I set the callouts only for the start procedure ?Hope anybody can help me.regardsMarc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this