Am 01.12.2019 um 14:24 schrieb Phil in gorgeous Young Harris via Groups.Io:
If I understand this right, you want to be able to start/stop the engine
by a throttle function key, e.g. F8. You can do this in config.xml:
<trigger name="ENGINE_STARTSTOP" type="THROTTLE">
<event-name>F8</event-name>
<target-name>ENGINE</target-name>
<action>NOTHING</action>
</trigger>
This must be declared in the tag sound-event name="ENGINE".
Klaus, thanks for this snippet-it works.? I have no idea how the program links this to the Start/Stop action though, and if there is any way to preclude the action if the speed is not zero.
There is no link. When I implemented ENGINE_STARTSTOP, I didn't see a simple solution with config.xml. So I programmed a mechanism for function keys.
I have to think about a solution precluding the STOP action at speed > 0. I tend towards a yes-no-option. So there's no solution at the moment.
However, the gain parameter is not doing what I think it should do.? I sampled some other sounds to get a better bell, and cannot lower the relative volume without changing the level in the sound file (which in frustration, I finally did).? In my Config file, I have this snippet (notice the 0.1 gain that I thought would make it very soft):
<sound name="BELL" type="configurable">
<start-file>sounds/Common/Bell-Start.wav</start-file>
<mid-file>sounds/Common/Bell-Middle.wav</mid-file>
<end-file>sounds/Common/Bell-End.wav</end-file>
<start-sound-duration>136</start-sound-duration>
<gain>0.1</gain>
</sound>
I had wondered: Can there be a negative gain?? Maybe that is my problem: could the gain be 0.0 for no change, positive for louder, and negative for quieter?? As a test, I tried a gain of -2.0, but no change, so I tried -6.0, no change.? So I must be doing something wrong in my code.
"gain" can take values from 0.0 to 1.0. If the sound file has a medium volume, this should be sufficient. The Bell sound is e.g. recorded very loudly. I changed the file with Audacity to a medium volume (Effect > Amplify > Amplification (DB): -8). That made it work well.
I understand that such an adaptation can be frustrating. But the experience is growing very fast. For tests I leave the VSD file as a ZIP file. VSD can also read that and it saves a few clicks.
Klaus