Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need (A:HSI CDI NEEDLE VALID,bool) to play sound only 1 time

Featured Replies

I have a gauge to detect the events, but I need to know how to play the sound -ONLY- ONE time. The event stays up for a while, so it keeps repeating the sound.For instance using part of my gauge below to detect when the Glideslope Becomes active, usually about 24 miles from touchdown when it detects the NAV1 (ILS) frequency.--if{(A:HSI CDI NEEDLE VALID,bool)if{1 (>L:snd_2,enum)Big picture is I'm just trying to play sounds for (GLIDESLOPE ACTIVE), (LOCALIZER ALIVE), (GLIDESLOPE ALIVE), and (GLIDESLOPE CAPTURED) and for them to play just one time.Thanks in advanceLKL

Try adding (L:snd_2,enum) 1 == if{ 0 (>L:snd_2,enum) }That should turn it off

Bert

Or this:(A:HSI CDI NEEDLE VALID, bool) 1 ==(L:snd_2_hasbeenplayed, bool) 0 == &&if{1 (> L:snd_2, enum)1 (> L:snd_2_hasbeenplayed, bool)}(A:HSI CDI NEEDLE VALID, bool) 0 ==if{0 (> L:snd_2_hasbeenplayed, bool)}

System: i7-10700K, 32GB RAM, RTX4070 12GB, 1 x 1TB SSD, 2 x 2TB SSD, 1x 2TB HDD, Win10 64bit Home, Meta Quest 3

  • Moderator

I'll just mention that there's a forum just down a few levels dedicated to such questions about aircraft, panel and gauge design... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author
Try adding(L:snd_2,enum) 1 == if{ 0 (>L:snd_2,enum) }That should turn it off
I tried your suggestion but (L:snd_2,enum) 1 == if{ 0 (>L:snd_2,enum) } will not produce any sound. I have to use as shown below in order to have sound. Here is part of my code<Element><Select> <Value> (L:GAState,number) 2 == I come into this gauge from another gauge and snd1_86 is my actual sound in my sounds.ini file if{ (A:HSI CDI NEEDLE VALID,bool) if{ 1 (>L:snd1_86,enum -or- 1 (>L:snd1_86,enum (==> will give constant repeats of the sound until the condition goes away. I tried every condition using your example but still no fix. Tried to use wothanfja16 suggestion but with no sucess. I will keep trying) </Value> </Select></Element>SUMMARY: I don't get any sounds, unless I use the 2 above and preceeded with the following==> if{ 1 (>L or 1 (>L:Thanks

Edited by LKL

I said "adding", not substituting.. your code will start the sound,the additional line will turn it off.(A:HSI CDI NEEDLE VALID, bool) 1 ==(L:snd_2_hasbeenplayed, number) 0 == andif{ 1 (> L:snd_2, enum)(L:snd_2_hasbeenplayed, number) 1 + (> L:snd_2_hasbeenplayed, number)}(A:HSI CDI NEEDLE VALID, bool) 0 == (L:snd_2_hasbeenplayed, number) 0 > andif{ 0 (> L:snd_2_hasbeenplayed, bool) }(L:snd_2_hasbeenplayed, number) 10 == if{ 0 (>L:snd_2,enum) }This will play the sound for 10 cycles of the gauge - you can choose this larger or smaller...this is assuming that 1 turns the sound on and 0 turns the sound off.

Edited by Bert Pieke

Bert

  • Moderator

Actually Bert, the 1 only triggers the sound to play once. There's no need to turn it off at all. It's enough to simply quit sending a 1 to the sound trigger! :Nerd:Your solution will still work of course, but the entry for stopping the sound is unnecessary and will simply be ignored.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

OK - thanks for clearing that up!In that case:(A:HSI CDI NEEDLE VALID, bool) 1 ==(L:snd_2_hasbeenplayed, bool) 0 == andif{ 1 (> L:snd_2, enum)1 (> L:snd_2_hasbeenplayed, bool) }(A:HSI CDI NEEDLE VALID, bool) 0 == (L:snd_2_hasbeenplayed, bool) andif{ 0 (> L:snd_2_hasbeenplayed, bool) }

Edited by Bert Pieke

Bert

  • Author
I'll just mention that there's a forum just down a few levels dedicated to such questions about aircraft, panel and gauge design... :(
Your post above:I don't see the word "GAUGE" in the forum. I just see==>'MSFS Aircraft and Panel Design Forum'Maybe it should read as==> Designing panels and gauges for aircraft in the MSFS series?Just a suggestion.I did re-post it in that forum with hopefully a better explanation on what I was trying to accomplish ThanksLKL

Edited by LKL

  • Author
I have a gauge to detect the events, but I need to know how to play the sound -ONLY- ONE time. The event stays up for a while, so it keeps repeating the sound.For instance using part of my gauge below to detect when the Glideslope Becomes active, usually about 24 miles from touchdown when it detects the NAV1 (ILS) frequency.--if{(A:HSI CDI NEEDLE VALID,bool)if{1 (>L:snd_2,enum)Big picture is I'm just trying to play sounds for (GLIDESLOPE ACTIVE), (LOCALIZER ALIVE), (GLIDESLOPE ALIVE), and (GLIDESLOPE CAPTURED) and for them to play just one time.Thanks in advanceLKL
RE-POSTED IN THE PANELS FORUM

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.