Add tones, including a launch countdown sequence.
This commit is contained in:
parent
9623a4a869
commit
2601db8fd4
|
@ -1,6 +1,7 @@
|
||||||
RunOncePath("lib/throttle").
|
RunOncePath("lib/throttle").
|
||||||
RunOncePath("lib/navigation").
|
RunOncePath("lib/navigation").
|
||||||
RunOncePath("lib/navball").
|
RunOncePath("lib/navball").
|
||||||
|
RunOncePath("lib/sound").
|
||||||
|
|
||||||
// Calculate the direction to lock during ascent.
|
// Calculate the direction to lock during ascent.
|
||||||
function getClampedDir {
|
function getClampedDir {
|
||||||
|
@ -43,9 +44,10 @@ function Launch {
|
||||||
|
|
||||||
// Countdowns are cute.
|
// Countdowns are cute.
|
||||||
print "Initiating automated launch sequence.".
|
print "Initiating automated launch sequence.".
|
||||||
|
PlayCountdown().
|
||||||
from { local x is 5. } until x = 0 step { set x to x - 1. } do {
|
from { local x is 5. } until x = 0 step { set x to x - 1. } do {
|
||||||
print "..." + x.
|
print "..." + x.
|
||||||
wait 0.5.
|
wait 1.0.
|
||||||
}
|
}
|
||||||
|
|
||||||
// staging logic. Stage as many times as needed until we finish ascent.
|
// staging logic. Stage as many times as needed until we finish ascent.
|
||||||
|
|
32
lib/sound.ks
Normal file
32
lib/sound.ks
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
|
||||||
|
// An informational tone.
|
||||||
|
function InfoTone {
|
||||||
|
local v is GetVoice(0).
|
||||||
|
set v:VOLUME to 0.75.
|
||||||
|
set v:WAVE to "sine".
|
||||||
|
set v:ATTACK to 0.1.
|
||||||
|
set v:DECAY to 0.05.
|
||||||
|
set v:SUSTAIN to 0.7.
|
||||||
|
set v:RELEASE to 0.25.
|
||||||
|
|
||||||
|
v:Play(Note("C4", 1, 0.75)).
|
||||||
|
}
|
||||||
|
|
||||||
|
function PlayCountdown {
|
||||||
|
local v is GetVoice(0).
|
||||||
|
set v:VOLUME to 0.9.
|
||||||
|
set v:WAVE to "sine".
|
||||||
|
set v:ATTACK to 0.05.
|
||||||
|
set v:DECAY to 0.001.
|
||||||
|
set v:SUSTAIN to 0.7.
|
||||||
|
set v:RELEASE to 0.05.
|
||||||
|
|
||||||
|
local notes is List(
|
||||||
|
Note("E4", 1, 0.25),
|
||||||
|
Note("E4", 1, 0.25),
|
||||||
|
Note("E4", 1, 0.25),
|
||||||
|
Note("E4", 1, 0.25),
|
||||||
|
Note("B5", 1, 0.45)
|
||||||
|
).
|
||||||
|
v:Play(notes).
|
||||||
|
}
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
RunOncePath("/lib/systems").
|
RunOncePath("/lib/systems").
|
||||||
RunOncePath("/lib/ui").
|
RunOncePath("/lib/ui").
|
||||||
|
RunOncePath("/lib/sound").
|
||||||
|
|
||||||
ClearGuis().
|
ClearGuis().
|
||||||
|
|
||||||
|
@ -38,6 +39,9 @@ function preLaunch {
|
||||||
// turn on generator and fuel flow
|
// turn on generator and fuel flow
|
||||||
enableLaunchpadFlow().
|
enableLaunchpadFlow().
|
||||||
|
|
||||||
|
InfoTone().
|
||||||
|
wait 2.
|
||||||
|
|
||||||
local duration is options["Spool-up Time"]:TEXT:ToNumber().
|
local duration is options["Spool-up Time"]:TEXT:ToNumber().
|
||||||
lock THROTTLE to 0.
|
lock THROTTLE to 0.
|
||||||
stage.
|
stage.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user