Search The Inn

Tuesday, June 17, 2025

ESU Automatic Horns With No Movement Until Done Sounding

Even with the plethora of Horn sound slot file tutorials on this blog, the most common request this author receives is to change them so the engine does not move until the horn is finished playing (that's prototypical). Apoorva (The IndianRail Modeler) and I have been working on this together and with his help and input on both the stop signal and some selections within sound files that the author was unfamiliar with, we have it working. This is one of the more complicated projects presented in this blog but it works and it's a relief to have it working. The core of this project lies in the Starting Delay sound slot usually slot #26 shown in figure 1.
Figure 1 Sound Slot #26 Starting Delay

It is recommended that you run this with the simulator to see how it actually works. The Start, Reverse and Stop horn sounds will be added directly into this slot but there are several things you have to know for it to work properly. They will be discussed. The stumper for the author was getting the Stop signal to function. He was all over the place and none of the tries worked. Then Apoorva demonstrated how easy it was. The author just never looked at it this way.

Let's start with the completed project (figure 2) and we'll break it down into parts as we go.

Figure 2 The completed project

We'll start with the Forward and Reverse signals. First, be certain that with the original Starting delay slot in the Sound Slot properties you have the Unlimited checkbox checked and there is a constant variable of Speed 1 = 0.

The Forward Signal
Add a container named Forward Signal between the two Drivelock states. The entry conditions are Requested Speed > Speed 1 and Reverse = false. The exit actions are tmr1 = SV13. So we are setting timer 1 to the value in SoundCV 13. SoundCV 13 can be viewed on the Sound Slot settings sheet of the Decoder pane. In most (if not all) sound files 13 is a default value. The contents of the Forward Signal container are shown in figure 3.

Figure 3 The Forward Signal

Notice how timer 2 controls not only the length of time the horn sounds (in 1/4 secs. so 2=.5 secs) but also the length of time of the pause between horn blasts (in this case a hard coded value of 6, change it if you like). The select value is entered and changed on the Sound slot settings sheet of the decoder pane (it's the Sound configuration variable). The statement in the comment about mapping all horn states to sound slot #3 is in the author's opinion a stroke of genius by Apoorva. This is done in the State Properties as shown in figure 4.
Figure 4 Tying another sound slot to this one

What this does is tie the horn to sound slot 3 so in the event you change the selected horn by changing SoundCV 9, all of the horn states in this sound slot change with it. You don't have to do anything extra!

The Reverse Signal
More of the same here except the entry conditions have the Reverse = false changed to Reverse = true. See figure 5.


Figure 5 The reverse signal

The Stop Signal
Now for the item that caused the author a lot of grief. We'll not get into that but the fact is if the engine got as far as the Drivelock Timer Before Release then it moved and sounded the horn so now you have to sound the stop signal when spd=0. We also have to take into account the Function mapping being still in effect. So to differentiate these two we'll implement a user variable. A value of 1 means the function is still active so when spd=0, sound the stop horn. Shown in figure 6.


Figure 6 The stop signal

Again, nothing new. Prior to the stop horn sounding there is a delay state that allows for a short delay until the stop horn actually sounds. It consists of playing the silence.wav file a number of times. Look at the state properties in figure 7.


Figure 7 The delay state properties

Adjust the delay by changing the Min and Max numbers equally up or down.

Summation
  • You do not have to worry about mapping this in the Function Mapping sheet of the Decoder pane. Since it is already mapped with 'Stop, F8, not F15' you're good there.
  • Do not uncheck the Starting Delay on the Driving characteristics sheet of the Decoder pane. That will prevent this sound slot file from working properly. If it is unchecked, check it.
  • The unlimited checkbox MUST be checked. A quote from Apoorva,
    "The unlimited check box signals to the decoder what to do if a soundslot is interrupted while it’s playing. Interruption could be due to loss of power, hierarchy when too many sounds are simultaneously playing or conditions within the soundslot. If the box is not checked, the user will need to toggle the function button to re-start the soundslot. If it is checked, the decoder will automatically restart the sound".
  • Every horn state must be mapped to sound slot 3 or whatever sound slot you have moved the horn pack to, if you have.
Recommendations
  • If, and for some sound files that's a big IF, you have an extra soundCV available use it to set and change the values where tmr2 is hard coded to a value of 6 as shown in figures 5 and 6. Say you have SoundCV 14 free. Set it to a value of 6 on the Sound settings sheet. Then change the appropriate transition action lines from tmr2 = 6 to tmr2 = SoundCV14. With this in place you just write decoder data when you change SoundCV 14 (less than 10 secs.).  As is, if you change this value you will have to re-burn the sound file (30 minutes!!).
  • As an experiment you could substitute the start, reverse and stop horn files that I detailed here in place of the ones in this article. The author would be interested to know if these work and if they work properly. There's no reason they shouldn't. The only issue with this is if you change the horn you will have to revisit the file and update the horns manually. Mapping the horns to the sound slot will not work in this case.
  • If the delay between the start horn finishing and the engine starting to move is more than you prefer, just reduce the value of SoundCV 13 on the Sound slot setting sheet.

I hope you learn a lot from this sound slot, THIS AUTHOR DID! It somewhat changes the way you think about how sound slots work and how to connect them to other slots and sounds.

Thanks Apoorva for pointing me in the right direction!

Good luck with this everyone but most importantly, have fun!


If you have an idea for a blog post here, let me know. If I can comment on it, I will or I'll see if someone else can and post it.

No comments:

Post a Comment