Você está na página 1de 27

3jCabin-sounds 1.

13 - Documentation

3jCabin-sounds 1.13
A FlyWithLua plugin for X-Plane 10
by Jörn-Jören Jörensön
3j@raeuber.com

Features:
+ easily define sound sets (per plane and/or default)
+ perfect for announcements of captain, P.A., boarding music etc.
+ highly configurable
+ auto-plays sounds by free programmable triggers
+ nice user interface, detailed settings windows
+ settings are saved to preferences file

1/27
3jCabin-sounds 1.13 - Documentation

Contents
1 What is 3jCabin-sounds?................................................................................................................................................ 4
2 Requirements................................................................................................................................................................. 4
2.1 X-Plane version............................................................................................................................................................ 4
2.2 FlyWithLua.................................................................................................................................................................. 4
2.3 Library 3jLib1............................................................................................................................................................... 4
3 Installation of plugin....................................................................................................................................................... 5
4 Installation of sound sets............................................................................................................................................... 5
4.1 Default sound set........................................................................................................................................................ 5
4.2 Aircraft sound set........................................................................................................................................................ 5
5 Usage............................................................................................................................................................................. 6
6 Configuration................................................................................................................................................................. 6
6.1 Configuration page SOUND SET................................................................................................................................... 6
6.2 Configuration page WINDOW...................................................................................................................................... 7
6.3 Configuration page SWITCH........................................................................................................................................ 8
6.4 Configuration page TIRGGERS..................................................................................................................................... 8
7 Keyboard / joystick commands....................................................................................................................................... 8
8 Building sound sets........................................................................................................................................................ 9
8.1 How to name the sound files?..................................................................................................................................... 9
8.1.1 List of tags.............................................................................................................................................................. 10
8.1.1.1 BUT (button)........................................................................................................................................................ 10
8.1.1.2 COL (color)........................................................................................................................................................... 10
8.1.1.3 CAT (category)..................................................................................................................................................... 10
8.1.1.4 VOL (volume)....................................................................................................................................................... 11
8.1.1.5 VOLV (volume variation)...................................................................................................................................... 11
8.1.1.6 PIT (pitch)............................................................................................................................................................ 11
8.1.1.7 PITV (pitch variation)........................................................................................................................................... 11
8.1.1.8 LOOP (play sound in a loop)................................................................................................................................ 12
8.1.1.9 LEN (set the length of the sound manually)......................................................................................................... 12
8.1.1.10 AIRL (airline)...................................................................................................................................................... 12
8.1.1.11 SGRP (solo group).............................................................................................................................................. 13
8.1.1.12 TRG (trigger)...................................................................................................................................................... 14
8.1.1.13 DEL (delay)........................................................................................................................................................ 14
8.2 How to define triggers............................................................................................................................................... 15
8.2.1 Play trigger ("TRG-play" or "TRG").......................................................................................................................... 15
8.2.2 Stop trigger ("TRG-stop")........................................................................................................................................ 15
8.2.3 Off trigger ("TRG-off")............................................................................................................................................ 16
8.2.4 On trigger ("TRG-on")............................................................................................................................................. 17
8.2.5 Kill trigger ("TRG-kill")............................................................................................................................................ 17
8.2.6 Possible combinations of trigger types................................................................................................................... 18
8.2.7 Trigger conditions with parameters........................................................................................................................ 18
8.2.8 Combining and inverting conditions....................................................................................................................... 19
8.2.8.1 and...................................................................................................................................................................... 19
8.2.8.2 or......................................................................................................................................................................... 19
8.2.8.3 not....................................................................................................................................................................... 19
8.2.9 Complete list of trigger conditions......................................................................................................................... 20
8.2.9.1 LOAD................................................................................................................................................................... 20
8.2.9.2 TRUE.................................................................................................................................................................... 20

2/27
3jCabin-sounds 1.13 - Documentation

8.2.9.3 PARKED................................................................................................................................................................ 20
8.2.9.4 START_UP............................................................................................................................................................ 20
8.2.9.5 TAXI_START.......................................................................................................................................................... 20
8.2.9.6 START.................................................................................................................................................................. 20
8.2.9.7 TAKEOFF.............................................................................................................................................................. 20
8.2.9.8 CLIMB.................................................................................................................................................................. 21
8.2.9.9 CRUISE................................................................................................................................................................. 21
8.2.9.10 DESCENT............................................................................................................................................................ 21
8.2.9.11 FLYING............................................................................................................................................................... 21
8.2.9.12 APPROACH........................................................................................................................................................ 21
8.2.9.13 LANDING........................................................................................................................................................... 21
8.2.9.14 GO_AROUND..................................................................................................................................................... 21
8.2.9.15 BRAKING............................................................................................................................................................ 21
8.2.9.16 TAXI_PARK......................................................................................................................................................... 21
8.2.9.17 ON_GROUND.................................................................................................................................................... 21
8.2.9.18 AIRBORNE......................................................................................................................................................... 22
8.2.9.19 STOPPED............................................................................................................................................................ 22
8.2.9.20 MOVING............................................................................................................................................................ 22
8.2.9.21 DOORS_OPEN.................................................................................................................................................... 22
8.2.9.22 ENGINES_ON..................................................................................................................................................... 22
8.2.9.23 FLAPS................................................................................................................................................................. 22
8.2.9.24 GEAR_DOWN.................................................................................................................................................... 22
8.2.9.25 GROUND_SPD................................................................................................................................................... 22
8.2.9.26 AIR_SPD............................................................................................................................................................. 23
8.2.9.27 AIR_SPD_VS....................................................................................................................................................... 23
8.2.9.28 AIR_SPD_VS0..................................................................................................................................................... 23
8.2.9.29 AIR_SPD_VNE.................................................................................................................................................... 23
8.2.9.30 AIR_SPD_VFE..................................................................................................................................................... 23
8.2.9.31 AIR_SPD_VLE..................................................................................................................................................... 23
8.2.9.32 AGL.................................................................................................................................................................... 23
8.2.9.33 ELEVATION......................................................................................................................................................... 24
8.2.9.34 CRZ_ALT............................................................................................................................................................. 24
8.2.9.35 ROLL_ANG......................................................................................................................................................... 24
8.2.9.36 PITCH_ANG........................................................................................................................................................ 24
8.2.9.37 G_FORCE........................................................................................................................................................... 24
8.2.9.38 TURBUL............................................................................................................................................................. 24
8.2.9.39 SEATBELTS......................................................................................................................................................... 24
8.2.9.40 NO_SMOKING................................................................................................................................................... 24
8.2.9.41 BEACON_LIGHT................................................................................................................................................. 25
8.2.9.42 LANDING_LIGHT................................................................................................................................................ 25
8.2.9.43 NAV_LIGHT........................................................................................................................................................ 25
8.2.9.44 STROBE_LIGHT.................................................................................................................................................. 25
8.2.9.45 TAXI_LIGHT........................................................................................................................................................ 25
8.2.10 Trigger reference.................................................................................................................................................. 26
8.2.11 Triggers and solo groups....................................................................................................................................... 26
8.2.12 Triggers window................................................................................................................................................... 27

3/27
3jCabin-sounds 1.13 - Documentation

1 What is 3jCabin-sounds?

A FlyWithLua plugin that lets you build your own sound sets for your planes. You can use it for
announcements, crew, passengers, background sounds, music or whatever you can think of.

You have manual sounds that are played by pressing a button. These are perfect for announcements of
captain or crew, boarding music, etc.

You can also have automatic sounds, that are triggered by events (e.g. take-off, landing, g-forces,
random, ...). These are pefect for passengers or background sounds. For example, let passengers
applaude after landing (tourist charters) or hear them panic when flying harsh maneuvers.

2 Requirements

2.1 X-Plane version

I have tested the plugin with X-Plane 10.45, 10.50 and 10.51. Other versions of X-Plane 10 are likely to
work too, but it is not guaranteed.

It could even work with X-Plane 11, but I can not say that at all.

2.2 FlyWithLua

3jCabin-sounds is a lua-script and needs the plugin FlyWithLua installed. See the files section of
www.x-plane.org for details, download and installation instructions, if you don't have it already.
http://forums.x-plane.org/index.php?/files/file/17468-flywithlua-for-xp9-and-xp10/

The script was tested with FlyWithLua 2.4.3 but it should work with other (esp. higher) versions too.

FlyWithLua is a great plugin by X-Friese, which makes it very easy to extend X-Plane with small scripts.

2.3 Library 3jLib1

The plugin requires my library 3jLib1 (version 1.2 or higher). Please download the newest version from
www.x-plane.org
http://forums.x-plane.org/index.php?/files/file/34720-3jlib1-ui-extension-library-for-flywithlua/

Put the file 3jLib.lua in the modules(!) folder of FlyWithLua:

X-Plane 10/Resources/plugins/FlyWithLua/Modules/

4/27
3jCabin-sounds 1.13 - Documentation

3 Installation of plugin

Copy the file 3jCabin-sounds.lua you have downloaded from x-plane.org in the scripts folder of
FlyWithLua:

X-Plane 10/Resources/plugins/FlyWithLua/Scripts/

4 Installation of sound sets

A sound set is a folder named 3jCabin-sounds that has sound files (and maybe subfolders) in it.

On the download page of the plugin there are a few demo sound sets, take them as a start. Some other
users have uploaded sounds and sound sets for this plugin, please search x-plane.org for "3jCabin-
sounds" to find them.

Copy one of the demo sound sets (the complete folder 3jCabin-sounds) to the FWL scripts folder:

X-Plane 10/Resources/plugins/FlyWithLua/Scripts/

4.1 Default sound set

The sound set in the FlyWithLua scripts folder

X-Plane 10/Resources/plugins/FlyWithLua/Scripts/3jCabin-sounds

is the default sound set. The plugin loads this set, when there is no sound set in the folder of the current
aircraft.

4.2 Aircraft sound set

If you want a sound set for a specific aircraft, you have to put the 3jCabin-sounds folder in the folder
of the aircraft, for example:

X-Plane 10/Aircraft/Heavy Metal/B747-400 United/3jCabin-sounds

or

X-Plane 10/Aircraft/General Aviation/Cessna 172SP/3jCabin-sounds

Please notice that some of your settings (like general volume of the sound set) are saved in the sound
set folder. So you can have different settings for different sets/aircrafts.

5/27
3jCabin-sounds 1.13 - Documentation

5 Usage

After installation of plugin and sound set (see above), run X-Plane. Move the mouse to the bottom
center of the screen, a button to open the sounds window appears. Click on it, the sounds window will
open. (You can also apply a key or controller button to open it.)

The sounds window

When there are manual (button)


sounds in the loaded sound set,
you will see them in the sounds
window. Click on a sound button
and the sound will be played.

Another click stops the sound.

When the button is flashing the


sound "waits" to be played.

6 Configuration

Click on the small "!"-button on the top right of the sounds window to open the settings window.

The settings window

Here you can edit settings for the current sound set (volume and pitch) and global settings (look, size
and position of the sounds window, size and position of the "open sounds window switch").

The settings window has 4 pages, click on the buttons on the top to step through them.

To edit numeric values click on "<" and


">" buttons to decrease/increase value or
on the slider to set value directly. When
the mouse is over the value box or slider,
you can change the value with the mouse
wheel. Clicking on the value box sets to
default.

6.1 Configuration page SOUND SET

On this page there are all settings that belong to the current sound set. The preferences file holding
these settings will be save in the "3jCabin-sounds" folder of the loaded sound set. So, when you copy the
sound set, all it's configurations will be copied too.

6/27
3jCabin-sounds 1.13 - Documentation

Airline
When the sound set has sounds for specific airlines, a select button for the airline appears. Click on it to
select an airline and all sounds for other airlines will disappear and be inactive. Select 'All' if you want all
sounds active. See 8.1.1.10 AIRL (airline).

Volume
Select global volume for all sounds of the plugin.

Pitch
Below 100 plays all sounds slower (lower pitched), above 100 faster (higher pitched).

Random pitch vari.


Controls how much the pitch of all sounds varies by random (0 = no variation, 100 = maximum). When
above 0, at load (new plane, new airport, reloading plugins) the random pitch is set for all sounds. So,
the pitch will usually not vary in-flight.
Tip: Use this function to simulate different speakers (captain, P.a., ...) on different flights. (Even Mickey
Mouse and Barry White, if you go to high with the variation...)

Trigger cruise alt. [ft]


The cruise level in feet. This is needed, if a triggers is set on reaching flight state "cruise". If you have
that, set the flight level here after planning the flight. See 8.2.9.9 CRUISE.

6.2 Configuration page WINDOW

Auto close
When active, the sounds window closes
automatically when you click on a sound
button.

Position
Set the position of the sounds window.

Buttons in a row
How many buttons are displayed
horizontally, controls the width of the
sounds window.

Horizontal padding
When the sounds window is postioned on the left or right edge of the screen, this is how far/close it is to
the edge. (How many pixels.)

Vertical padding
When the sounds window is postioned on the top or bottom edge of the screen, this is how far/close it is
to the edge. (How many pixels.)

Color
The general colour of the sounds window.

Transparency
Transparency of the window background.

7/27
3jCabin-sounds 1.13 - Documentation

6.3 Configuration page SWITCH

The 'switch' is a little box on the screen. Clicking on it opens/closes the sounds window.

Show switch
Controls when the switch box is visible.
Select between 'always', 'mouse' (when
mouse is over it) or 'never'.

Position
Set the position of the switch.

Switch width
Width of the switch in pixels.

Switch height
Height of the switch in pixels.

Transparency
Transparency of the switch.

6.4 Configuration page TIRGGERS

Triggers precision
Controls at which interval the triggers are
checked. Recommended to set it too "HI",
should be reduced only, when very many
triggers are active and you feel this gives X-
Plane a performance hit.

Show flight state


When "programming" triggers, activate this
option to see what flight state the plugin has
determined. The current flight state will be displayed on the switch box then.

Triggers window
Opens the triggers window. The triggers window helps you with programming triggers. See 8.2.12
Triggers window.

7 Keyboard / joystick commands

You can use X-Plane's keyboard / joystick assignments to control the following functions:

FlyWithLua/3jCabin-sounds/toggle_panel -> Open/close the sounds window


FlyWithLua/3jCabin-sounds/open_settings -> Open settings window

8/27
3jCabin-sounds 1.13 - Documentation

8 Building sound sets

You can build your own sound sets. A sound set for 3jCabin-sounds is a collection of sound files (wave
format .wav) inside a folder named '3jCabin-sounds'. The names of the sound files tell the plugin how to
play the sounds.

8.1 How to name the sound files?

Think of the file names as a collection of parts, separated by "." dots, for example like this:

{anything}.BUT {button label}.COL {color}.VOL {volume}.LOOP.wav

The first part {anything} is completely free, it only controls the order of the buttons (if the sound is a
button "BUT ..." sound). It is recommended to use numbers for easy ordering.

The last part must always be .wav, because only wave files can be played.

In between there can be 1 or more parts. Every part starts with a tag. A tag is 3-letter or 4-letter code
that tells the plugin how the sound should be played. In this example there are the tags "BUT" (sound
can be played by clicking a button), "COL" (color of button), "VOL" (volume of the sound) and "LOOP"
(play sound in a loop).

Some tags can be followed by 1 or more parameters, divided by blank/space " " characters.

Upper case or lower case does not matter. I recommend writing the tags (and triggers) in upper case
and the parameters in lower case, to make it easier to read. But that's up to you.

9/27
3jCabin-sounds 1.13 - Documentation

8.1.1 List of tags

A complete list of all tags to put in the sound file names (and subfolder names).

8.1.1.1 BUT (button)

There will be a button for this sound, labeled with the text following "BUT ".

Example:

.BUT Boarding music. -> generates a button labled "Boarding music"

For compatibility with previous versions, the tag "BT" is also possible instead of "BUT".

The "BUT" tag is not allowed in the names subfolders!


(You don't want all sounds in your subfolder to have the same button label.)

8.1.1.2 COL (color)

Button color (if sound has a button, otherwise useless).

Example:

.COL red. -> a red button

Possible values are "blue", "cyan", "green", "yellowgreen", "yellow", "orange", "red", "pink", "magenta",
"violet", "black", "grey" or "white"

8.1.1.3 CAT (category)

Category for buttons, to group buttons together in the sounds window.

Usually you should use one subfolder for every category and give this tag to the subfolder. Then, put all
button sounds for this category in this subfolder.

Example:

.CAT Pre-Flight. -> Category "Pre-Flight"

10/27
3jCabin-sounds 1.13 - Documentation

8.1.1.4 VOL (volume)

Individual volume of the sound, must be followed by a whole number between 0 and 100.

Example:

.VOL 50. -> set sound to 50% volume

.VOL 100. -> set sound to 100% volume (maximum)

TIP: Use this if some sounds in your sound set are too loud or too soft, compared to the other ones.

8.1.1.5 VOLV (volume variation)

Individual volume variation of the sound, must be followed by a number between 0 and 100.

Example:

.VOLV 50. -> Sound's volume will vary randomly from -25% to +25% every time it is played

.VOLV 100. -> Sound's volume will vary randomly from -50% to +50%

TIP: Use this for ambient sounds (passenger noise) for example, to give a little variation to it.

8.1.1.6 PIT (pitch)

Individual pitch of the sound, must be followed by a number between 50 and 200.

Example:

.PIT 50. -> set sound pitch to 50% (sound is played in half speed, 1 octave lower)

.PIT 200. -> set sound pitch to 200% (sound is played in double speed, 1 octave higher)

.PIT 101. -> set sound pitch to 101% (sound is played 1 % faster, a little higher)

8.1.1.7 PITV (pitch variation)

Individual pitch variation of the sound, must be followed by a number between 0 and 100.

Example:

.PITV 20. -> Sound's pitch will vary randomly from -10% to +10% every time it is played

.PITV 100. -> Sound's pitch will vary randomly from -50% to +50% (definitely too much!)

TIP: Use this for ambient sounds (passenger noise) for example, to give a little variation to it.

11/27
3jCabin-sounds 1.13 - Documentation

8.1.1.8 LOOP (play sound in a loop)

When the sound starts it will play endlessly in a loop, until it is stopped by button or trigger.

8.1.1.9 LEN (set the length of the sound manually)

Set the length of the sound (in seconds) manually. If the plugin can not determine the length of the wav
file, or somehow calculates a wrong length.

You can only use whole numbers! When the sound is for example 5.4 seconds long, simply write 6.

Example:

.LEN 7. -> set the length to 7 seconds

Usually you do not need this!

The "LEN" tag is not allowed in the names subfolders!

8.1.1.10 AIRL (airline)

Assign the sound to a specific "airline".

You might have a sound set with some airline specific sounds (boarding music, safty instructions, ...) and
lots of captain's announcements that are valid for all airlines. Let's say you have 3 boarding music files
and let's call them "01.BUT B-Music KLM.wav", "01.BUT B-Music AF.wav" and "01.BUT B-Music LH.wav".

Of course you don't want to hear sounds from different airlines on one flight. So, wouldn't it be cool to
select the airline at the beginning of the flight and then only see and hear the matching sounds?

Add "AIRL" tags, by naming the sounds like this, for example:

01.BUT B-Music KLM.AIRL KLM.wav -> Sound is assigned to airline "KLM"

01.BUT B-Music AF.AIRL Air France.wav -> Sound is assigned to airline "Air France"

01.BUT B-Music LH.AIRL Lufthansa.wav -> Sound is assigned to airline "Lufthansa"

Now, if you open the settings window (press "!" on the top right of the sounds window), you will see an
airline button on the very top, supposedly labeled "All" (showing all airlines is default). Click on this
button and select one of the airlines that are defined by "AIRL" tags in your sound set, and you will now
see and hear only buttons/sounds that assigned to the selected airline. Sounds that are not assigned to
any airline, will show up always, of course.

The currently selected airline is displayed on the top of the sounds window. It will be saved the the
preferences file ("3jCabin-sounds.prf") in the aircraft(!) folder, that means, when you load an aircraft the
last selected airline will be pre-selected.

12/27
3jCabin-sounds 1.13 - Documentation

8.1.1.11 SGRP (solo group)

This assigns the sound to a 'solo group'. What is a solo group? The sounds that are assigned to the same
solo group will not overlay (play the same time). Only one sound will be played solo of all sounds in a
solo group.

Example: You maybe have 5 sounds with captain announcements and 2 sounds with boarding music. Of
course, you never want to hear 2 announcements the same time. And you really don't want to hear
more than 1 music parallel. But you may want to hear some announcements, while the boarding music
softly plays in the background. This can be easily achieved with solo groups:

Add .SGRP speak. to every announcement sound. ("speak" is a freely chosen name of the solo group,
you could use "announcement", "capt", "1" or whatever you like. It is only important, that every
announcement sound has the same solo group name.)

Then add .SGRP music. (or "mus", "2" or whatever) to every music sound file.

Now, you have built 2 solo groups "speak" and "music" and you might hear an announcement while the
music is playing, but you won't hear 2 announcements or 2 different songs the same time. Ok, but why?

Every time before a sound with a solo group is played (by button or by trigger), the plugin checks if any
other sound with the same solo group is playing right now. If so, there are 3 ways to avoid them both
playing:

1. stop Stop the old sound and play the new one. (This is default!)

2. skip Let the old sound play on and simply don't play the new one.

3. wait Let the new sound wait until the old one has finished and play it then.

You can chose between those 3 by using the tags SGRP-stop, SGRP-skip or SGRP-wait instead of
SGRP.

Example:

.SGRP-stop speak. -> Other sounds of solo group "speak" are stopped when this sound is played
(default, using "SGRP speak" does the same)

.SGRP-skip speak. -> This sound is not played, when another sound of solo group "speak" already
plays

.SGRP-wait speak. -> This sound will be played first, when other sounds of solo group "speak" have
finished playing

One note to solo group "wait": If there are more than 2 sounds in the same solo group, then a real queue
of sounds can build up. All will be played one after the other, in the order they were triggered (or
activated by button).

13/27
3jCabin-sounds 1.13 - Documentation

8.1.1.12 TRG (trigger)

Add a trigger to the sound (to let it play automatically when special events happen). Must be followed by
the trigger condition and maybe 1 or more parameters (depending on condition).

Example:

.TRG TAKEOFF. -> play sound after take-off

.TRG LANDING. -> play sound after landing

See the "How to define triggers" section below for details!

The "TRG" tag is not allowed in the names subfolders!

8.1.1.13 DEL (delay)

Set delay time for following trigger(s) or button. Must be followed by 1 parameter (whole number, 0 or
higher), specifying the delay time in seconds. If a second parameter is present, the delay time will vary
randomly between the 2 values.

Example:

.DEL 0. -> play sound immediately (default)

.DEL 5. -> wait 5 seconds, before sound is played

.DEL 30 60. -> wait between 30 and 60 seconds

Please notice: For the "DEL" tag, the order of tags is important! It sets the delay for the following(!) TRG
and BUT tag(s). So you can have different delays for button and triggers in 1 sound. But you have to put
the DEL tag(s) before the trigger(s) and button tags.

Example:

xx.DEL 120.TRG TAKEOFF.DEL 30 60.TRG LANDING.wav

-> 1. trigger (condition TAKEOFF) has a delay of 120 seconds


-> 2. trigger (condition LANDING) has a random delay between 30 and 60 seconds

xx.DEL 4.BUT Test.DEL 20 25.TRG TAKEOFF.TRG AGL 20000.DEL 0.TRG LANDING.wav

-> button (label "Test") has a delay of 4 seconds


-> 1. trigger (condition TAKEOFF) has a random delay between 20 and 25 seconds
-> 2. trigger (condition AGL 20000) has also a random delay between 20 and 25 seconds (delay was not
changed)
-> 3. trigger (condition LANDING) plays sound immediately (delay 0)

14/27
3jCabin-sounds 1.13 - Documentation

8.2 How to define triggers

Triggers can be applied to sounds, to let sounds play automatically. You can add 1 or more triggers to a
sound.

Every trigger has a condition. When the trigger condition is fulfilled, the trigger "fires" (does something).

There are 3 basic types of triggers, they differ in what they do when they fire:

1. "play trigger": play a sound

2. "stop trigger": stop a sound (if playing)

3. "on trigger", "off trigger", "kill trigger": change the "trigger state" of the sound

(Some of these trigger types can even be combined in 1 trigger, you will learn more about that later.)

8.2.1 Play trigger ("TRG-play" or "TRG")

We start with an easy example: A play trigger.

You have a .wav file with boarding music and want the music to play when the cabin doors are open.
Let's assume the music file is called "boarding music.wav". Rename it to

boarding music.LOOP.TRG DOORS_OPEN.wav

(instead of "boarding music", you can choose whatever you like.)

Now the plugin knows, the sound should be played as a loop (to let it play endlessly).

It also generates a play trigger with the condition DOORS_OPEN. That means, the sound will start as
soon as the cabin doors are opened and play until it has finished.

Well, great! But, it's a loop sound, it will play forever. That might be a little annyoing, especially on
continental flights...

8.2.2 Stop trigger ("TRG-stop")

So, what we need is: A stop trigger.

We add .TRG-stop TAXI_START. to the name of our music wav file. Something like this:

boarding music.LOOP.TRG DOORS_OPEN.TRG-stop TAXI_START.wav

"TRG-stop" tells the plugin it is a stop trigger: When it's condition is fulfilled, the sound will be stopped.

BTW, if you like it systematic you can also write "TRG-play" for the play trigger we added first:

boarding music.LOOP.TRG-play DOORS_OPEN.TRG-stop TAXI_START.wav

15/27
3jCabin-sounds 1.13 - Documentation

"Play" is default behaviour of triggers, so "TRG" or "TRG-play" is the same!

BTW BTW, the order of triggers in the file name is not relevant, but I would recommend to keep a
somehow logic progression.

8.2.3 Off trigger ("TRG-off")

Example to explain the sound's trigger states: On trigger.

Now, for example, imagine you have a captain's "we've reached cruise level" speech file, "capt crz
lvl.wav" and you want it to play automatically.

Rename it to:

capt crz lvl.TRG-play CRUISE.wav

(or capt crz lvl.TRG CRUISE.wav, I'll write "TRG-play" from now on.)

So we have a play trigger that fires when the flight state is "CRUISE". (Trigger conditions and flight state
will be explained below.)

But there is a problem: The conditon "CRUISE" is true (fulfilled) all the time the flight is in cruise state.
Therefore, as soon as the sound has finished playing, the trigger will fire and play the sound again. This
will go on, until the flight state has changed (most likely it will change to "DESCENT").

What can we do? Add an "off trigger".

Simply add .TRG-off CRUISE.

capt crz lvl.TRG-play CRUISE.TRG-off CRUISE.wav

When flight state changes to "CRUISE", both triggers will fire (from left to right, in this case the order
does matter!).

First the play trigger starts the sound.

Then, in the same moment the off trigger sets the "trigger state" of the sound to "off". When the
sound's trigger state is "off", the play trigger is deactivated. That means, the sound will only be played
once. (Because the moment the play trigger is fired it gets deactivated and so will not fire again.)

It is strongly recommended to do this combination of play trigger and off trigger in one single trigger. I
did it with 2 triggers here only, to make it as clear as possible what happens.

As this play / off trigger combination is very helpful, you can (and should!) do it like this:

capt crz lvl.TRG-play-off CRUISE.wav

So you get the same function in one trigger. That's easier, shorter and better regarding performance.

You can regard "TRG-play-off" as a "play once" trigger, if you like.

16/27
3jCabin-sounds 1.13 - Documentation

8.2.4 On trigger ("TRG-on")

But, now imagine you do a flight with an intermediate stop. This flight will have 2 cruise phases. But we
have a "play once" trigger ("TRG-play-off"), we won't hear the "we've reached cruise level" speech on
the second part of the flight. Not perfect...

For cases like this, you have an "on trigger".

Name the file:

capt crz lvl.TRG-on TAKEOFF.TRG-play-off CRUISE.wav

We added an "on trigger" with condition "TAKEOFF". So, during take-off the sound's trigger state is set to
"on". (It is already "on" by default when the flight starts, but it doesn't do no harm to set to "on" again.)

Then, when reached cruise state, the sound is played and the sound's trigger state is set to "off", the
sound will not play again now. Then you land for your intermediate stop, taxi, etc. and start again to your
next destination. When taking off, the trigger state of the sound is set "on" and all starts over again. (And
again and again if you like...)

Two important things about trigger states:

1. The trigger state belongs to the SOUND not the trigger! So a sound can have multiple triggers that all
set the sound's same trigger state.

To make it clear, all triggers of sound A affect the same trigger state of sound A and all triggers of sound
B affect the same trigger state of sound B, but triggers of sound A will never affect sound B and vice
versa!

2. Every time the plugin loads/reloads all trigger states are set to default ("on"). The plugin reloads,
when:

• X-Plane restarts

• Aircraft changed, airport changed, new situation is loaded etc.

• When menu "Plugins->FlyWithLua->reload all lua script files" is clicked

8.2.5 Kill trigger ("TRG-kill")

To explain the "kill trigger", another example. You have a sound file with after landing applause and want
that to be played after the landing. From all you already know, you would name the file something like
this:

applause.TRG-on TAKEOFF.TRG-play-off LANDING.wav

It will work as expected, passengers applaud a few seconds after touchdown. But, wouldn't it be cool, if
they only applaud when the flight and the landing were smooth?

Add a kill trigger .TRG-kill G_FORCE 200. to the sound file name.

17/27
3jCabin-sounds 1.13 - Documentation

When this trigger fires, it "kills" all triggers of the sound. The sound will not be triggered anymore, until
you reload (reload aircraft, location, etc.).

Trigger condition "G_FORCE 200" fires, when g-forces are over 200% G. So, when there were strong
forces during flight or touch down, no applause will be played after landing.

8.2.6 Possible combinations of trigger types

TRG-play (or TRG) -> play sound

TRG-play-off -> play sound and set sound's trigger state to "off" (play sound once)

TRG-stop -> stop sound

TRG-stop-off -> stop sound and set sound's trigger state to "off"

TRG-stop-kill -> stop sound and set sound's trigger state to "killed"

TRG-on -> set sound's trigger state to "on"

TRG-off -> set sound's trigger state to "off"

TRG-kill -> set sound's trigger state to "killed"

8.2.7 Trigger conditions with parameters

Some trigger conditions can have 1 or 2 numeric parameters. These parameters are separated by
blanks/spaces " ".

Usually the first parameter is a minimum (min) and the second a maximum (max).

When there is only a min parameter, condition is true, when the value to compare is above or euqal the
min parameter.
When min and max parameters are present, condition is true if the value is between min and max.

For example condition "AGL" (above ground level):

.TRG AGL 1000. -> fires, when the aircraft is 1000 feet(!) or higher above the ground.

.TRG AGL 5000 6000. -> fires, when the aircraft is between 5000 ft and 6000 ft above ground.

18/27
3jCabin-sounds 1.13 - Documentation

8.2.8 Combining and inverting conditions

8.2.8.1 and

Sometimes you may want 2 or more conditons to be fulfilled, to let a trigger fire. You can do this by
writing the condition separated by " and ":

.TRG TAKEOFF and GROUND_SPD 200. -> fires when ground speed is over 200 kts during takeoff

.TRG LANDING and AIR_SPD 150 and FLAPS. -> while landing, air speed over 150 kts and flaps
down

8.2.8.2 or

If you want a sound to be played at one or another condition, simply use 2 triggers:

.TRG-play G_FORCE 300.TRG-play AIRBORNE and DOORS_OPEN.

-> play sound when g-forces are over 300%G or doors are opened while aircraft is off the ground. (If you
have a sound file with passenger panic, for example.)

8.2.8.3 not

You can invert conditions by writing "NOT " before them:

.TRG not ENGINES_ON. -> fires when engines are off ("not on")

And you can combine "not" and "and", however you like:

.TRG not AGL 500 and not GEAR_DOWN. -> when below 500 ft above ground and landing gear up
(for a warning message for example)

BTW: .TRG AGL 0 500 and not GEAR_DOWN. would do the same ("AGL 0 500" means above
ground level between 0 ft and 500 ft.)

19/27
3jCabin-sounds 1.13 - Documentation

8.2.9 Complete list of trigger conditions

"{min}" and "{max}" are placeholders for numeric min/max values. You can use whole numbers only.

8.2.9.1 LOAD

.TRG LOAD. -> fires when plugin loads (when X-Plane reloads the plane/location/situation or
FlyWithLua gets reloaded)

Use this, if you want to set the trigger state of a sound to "off" at start up: .TRG-off LOAD.

8.2.9.2 TRUE

TRUE fires all the time.

Use this, usually combined with delay (tag "DEL"), to play a sound repeatedly once in a while.

Example:

.DEL 60.TRG-play TRUE. -> plays sound every 60 seconds

.DEL 30 240.TRG-play TRUE. -> plays sound randomly every 30 seconds to 4 minutes

8.2.9.3 PARKED

.TRG PARKED. -> plane is parked (on ground, not moving and engines off)

8.2.9.4 START_UP

.TRG START_UP. -> plane on ground, not moving, engines on

8.2.9.5 TAXI_START

.TRG TAXI_START. -> plane on ground, engines on, moving

8.2.9.6 START

.TRG START. -> plane on ground, moving faster than 30kts

8.2.9.7 TAKEOFF

.TRG TAKEOFF. -> plane takes off

20/27
3jCabin-sounds 1.13 - Documentation

8.2.9.8 CLIMB

.TRG CLIMB. -> plane has taken off and above 500m or flaps up

8.2.9.9 CRUISE

.TRG CRUISE. -> plane has reached cruise level (cruise lvl can be configured in settings window)

8.2.9.10 DESCENT

.TRG DESCENT. -> plane is below 90% cruise level

8.2.9.11 FLYING

.TRG FLYING. -> combination of "CLIMB" or "CRUISE" or "DESCENT"

8.2.9.12 APPROACH

.TRG APPROACH. -> flaps down or below 250m AGL

8.2.9.13 LANDING

.TRG LANDING. -> AGL below 50m

8.2.9.14 GO_AROUND

.TRG GO_AROUND. -> was already landing, but now above 100m AGL again

8.2.9.15 BRAKING

.TRG BRAKING. -> was landing and has touched down

8.2.9.16 TAXI_PARK

.TRG TAXI_PARK. -> braking and ground speed below 28kts

8.2.9.17 ON_GROUND

.TRG ON_GROUND. -> aircraft is on ground

21/27
3jCabin-sounds 1.13 - Documentation

8.2.9.18 AIRBORNE

.TRG AIRBORNE. -> in the air

8.2.9.19 STOPPED

.TRG STOPPED. -> not moving

8.2.9.20 MOVING

.TRG MOVING. -> moving

8.2.9.21 DOORS_OPEN

.TRG DOORS_OPEN. -> doors are opened

8.2.9.22 ENGINES_ON

.TRG ENGINES_ON. -> engines are on

8.2.9.23 FLAPS

.TRG FLAPS. -> flaps are not completely up

.TRG FLAPS {min}. -> flaps are {min} % down

.TRG FLAPS {min} {max}. -> flaps are between {min} % and {max} % down

8.2.9.24 GEAR_DOWN

.TRG GEAR_DOWN. -> gear lever is down

8.2.9.25 GROUND_SPD

.TRG GROUND_SPD {min}. -> ground speed over {min} kts

.TRG GROUND_SPD {min} {max}. -> ground speed between {min} kts and {max} kts

22/27
3jCabin-sounds 1.13 - Documentation

8.2.9.26 AIR_SPD

.TRG AIR_SPD {min}. -> air speed over {min} kts

.TRG AIR_SPD {min} {max}. -> air speed between {min} kts and {max} kts

8.2.9.27 AIR_SPD_VS

.TRG AIR_SPD_VS {min}. -> air speed over {min} % of Vs (stall speed)

.TRG AIR_SPD_VS {min} {max}. -> air speed between {min} % and {max} % of Vs

8.2.9.28 AIR_SPD_VS0

.TRG AIR_SPD_VS0 {min}. -> air speed over {min} % of Vs0 (stall speed in landing configuration)

.TRG AIR_SPD_VS0 {min} {max}. -> air speed between {min} % and {max} % of Vs0

8.2.9.29 AIR_SPD_VNE

.TRG AIR_SPD_VNE {min}. -> air speed over {min} % of Vne (never exceed speed)

.TRG AIR_SPD_VNE {min} {max}. -> air speed between {min} % and {max} % of Vne

8.2.9.30 AIR_SPD_VFE

.TRG AIR_SPD_VFE {min}. -> air speed over {min} % of Vfe (maximum flap speed)

.TRG AIR_SPD_VFE {min} {max}. -> air speed between {min} % and {max} % of Vfe

8.2.9.31 AIR_SPD_VLE

.TRG AIR_SPD_VLE {min}. -> air speed over {min} % of Vle (max. speed with gear down)

.TRG AIR_SPD_VLE {min} {max}. -> air speed between {min} % and {max} % of Vle

8.2.9.32 AGL

.TRG AGL {min}. -> above ground level over {min} feet

.TRG AGL {min} {max}. -> above ground level between {min} ft and {max} ft

23/27
3jCabin-sounds 1.13 - Documentation

8.2.9.33 ELEVATION

.TRG ELEVATION {min}. -> elevation over {min} feet

.TRG ELEVATION {min} {max}. -> elevation between {min} ft and {max} ft

8.2.9.34 CRZ_ALT

.TRG CRZ_ALT. -> current elevation at cruise altitude or higher (cruise altitude
can be configured in settings window)

8.2.9.35 ROLL_ANG

.TRG ROLL_ANG {min}. -> roll angle above {min} degrees

.TRG ROLL_ANG {min} {max}. -> roll angle between {min} degrees and {max} degrees

8.2.9.36 PITCH_ANG

.TRG PITCH_ANG {min}. -> pitch angle above {min} degrees

.TRG PITCH_ANG {min} {max}. -> pitch angle between {min} degrees and {max} degrees

8.2.9.37 G_FORCE

.TRG G_FORCE {min}. -> g-forces over {min} % of G

.TRG G_FORCE {min} {max}. -> g-forces between {min} % of G and {max} % of G

8.2.9.38 TURBUL

.TRG TURBUL {min}. -> turbulence over {min}

.TRG TURBUL {min} {max}. -> turbulence between {min} and {max}

8.2.9.39 SEATBELTS

.TRG SEATBELTS. -> fasten seat belts signs on

8.2.9.40 NO_SMOKING

.TRG NO_SMOKING. -> no smoking signs on

24/27
3jCabin-sounds 1.13 - Documentation

8.2.9.41 BEACON_LIGHT

.TRG BEACON_LIGHT. -> beacon light on

8.2.9.42 LANDING_LIGHT

.TRG LANDING_LIGHT. -> landing lights on

8.2.9.43 NAV_LIGHT

.TRG NAV_LIGHT. -> nav lights on

8.2.9.44 STROBE_LIGHT

.TRG STROBE_LIGHT. -> strobe lights on

8.2.9.45 TAXI_LIGHT

.TRG TAXI_LIGHT. -> taxi lights on

25/27
3jCabin-sounds 1.13 - Documentation

8.2.10 Trigger reference

For those who like it more abstract, the syntax of triggers in short.

Everything in "[]" is optional

{xxx} is a placeholder for what is described by xxx

Trigger syntax:

TRG[-{type}] [not] {condition_1} [{parameter_1} [{parameter_2}]]


[and [not] {condition_2} [{parameter_1} [{parameter_2}]]]
[and [not] {condition_3} ...] ... ...

{type} can be play (default), play-off, stop, stop-off, stop-kill, on, off or kill

{condition_n} can be any condition found in "Complete list of trigger conditions"

{parameter_n} numeric value (whole number) to compare with

8.2.11 Triggers and solo groups

You can combine triggers and solo groups. When the sound is triggered by a "play trigger", it will behave
exactly as described in the description of the "SGRP" tag.

26/27
3jCabin-sounds 1.13 - Documentation

8.2.12 Triggers window

When making triggers, it is sometimes a little hard to test them and understand why they do not work
(or why they work). For that purpose I have included the triggers window.

Open the sounds window and click on the "!" on the top right to open the settings window. In the
settings window click on "TRIGGERS" on the top right to switch to the triggers page. Then click on
"Triggers window: OPEN".

The triggers window is always displayed on the top of the screen.

It shows all sounds that have triggers, one in a row.

On the left there is a button for the sound, click on it to play the sound.

Then you see 3 small buttons that show the trigger state of the sound. Click on them to change the
trigger state, e.g. for testing.

Right to the trigger states there is a button for every trigger of the sound. These buttons indicate the
state of the trigger:
lit -> trigger condition(s) fulfilled in the moment (trigger fires)
flashing -> trigger is in delay, waiting for it's delay time to pass (and then will fire)
dark -> trigger condition(s) are not fulfilled in the moment

Click on a trigger button to activate it. The moment you click on it, the trigger will behave exactly like it's
condition(s) were fulfilled.

Tip: Play with all the buttons in the triggers window! It is quite easy then to understand how sounds,
trigger state and triggers work together!

27/27

Você também pode gostar