Search The Inn

Sunday, January 12, 2025

Alternate Automatic Horn Signals Design for ESU v5 Decoders

Automatic horn signals with ESU v5 decoders was first covered in this discussion. Recently, another option was presented to this author on the groups.io forum that is a different way of looking at the design of the sound slot file. It has its pros and cons as does everything but it is still an intriguing design. One of the differences between the two designs is that the new one depends on the Share1 variable value generated in the prime mover sound slot instead of  the Requested Speed value generated by a throttle. Compare figure 1 and figure 2.


Figure 1 New auto horn design


Figure 2 Original auto horn design

Another difference is that the new design has the sound files in States not Containers as the original design does. Refer to the original discussion for the difference. Comparing the States to the Containers leads us to a discussion of the Pros and Cons of the new design.

Pros
The new design takes only one sound slot since the forward, reverse and stop signals are all contained in the one sound slot file. The original design requires two sound slots since the stop signal is separate from the others.

Due to this, mapping the sound slot file to function keys is simplified. 

Cons
There are a couple of issues with the new design. 

First, the dependence on the Share1 variable causes a dependency out of your control. If the ESU engineers ever change that value in the prime mover sound slot,  adjustments and reloading will have to be done. However, the likelihood of this ever happening is very, very low. So this is a low value con.

Second, the new design calls the sound States one time for both the forward double blast and the reverse triple blast. That means you will have to create a new .wav file for each using an application such as Audacity that manipulates sound files in order to have two blasts for the forward signal and three for the reverse (it would be possible to add additional States for the additional blasts rather than create new .wav files but that is up to the individual). 
The original design already has multiple calls to States in the Containers. So no changes there.

Third, as a consequence of creating new .wav files there is a problem introduced. If you didn't notice when you imported the new design into your sound file you probably have a memory problem now. Look at the upper left corner of the LokProgrammer software. See figure 3.


Figure 3 Error indication

Hmmm... an error indication. Where did that come from? Now take a look at the lower right window of the sound pane where the included .wav files are displayed. See figure 4.


Figure 4 The memory issue

When the new sound slot file was imported it brought the new State .wav files with it. Which is exactly what it should do. Due to the size of these new .wav files more memory is required than is available. The only way to fix this is to delete other .wav file from the sound file that are not in use until you get the Current Capacity less than the Maximum Capacity

Here's the real problem. You will probably have to do this to every sound file you add the new horn design to! While this is not a hugh problem, it can be a pain. It should be mentioned that if you do as suggested above and add additional States in lieu of creating the new .wav files then this should not be a problem.

As you can see, while this is an efficient design from the sound slot and function mapping perspective there are a couple of issues you will have to deal with. 

Your call!

The file is available for download here.


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 

Thursday, January 9, 2025

Thanks To Everyone For Your Support

The title is a little strange for a model railroad blog but it is sent out in the most heart felt way.  This blog was started in March of 2018, as an experiment, to see if news,  help and ideas could be provided in a centralized place for those who wanted it. 

This past year (2024) provided a milestone. In October the Hostlers Model Railroad Club of Ogden Utah, of which this author is a member, attended the annual show in Idaho Falls, Idaho. Set up was Friday and the show opened that afternoon. After checking into the hotel this author set up his computer and (knowing it was going to happen soon) checked on the blog statistics. There it was! 100,001 reads of this blog! It was a long time coming but worth the ride.

Here are some statistics since then on 9 JAN 2025:

  • Reads - 109,288 - 9,288 more than that October day!
  • Today - 126
  • Yesterday - 129
  • This month - 1219
  • Last month - 3826

It is absolutely self sustaining now and this author is grateful for everyone who supports the work and he will continue to do everything he can to provide useful information.

Thanks to all of you who have found this work useful!


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 

Thursday, December 19, 2024

Digitrax Christmas & New Year Holidays 2024

Digitrax will be closed the week between Christmas and New Year's Day so we can enjoy time with our families and friends.  We wish everyone a Wonderful Holiday Season, a Merry Christmas and a Happy New Year!  We will close at 5:00PM CT on Tuesday December 24, 2024 and reopen on Thursday January 2, 2024.


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  

Friday, December 6, 2024

LokSound 5 Change Horn On-The-Fly Via Function Key

As any DCC and Sound model railroader knows, you program your decoder by changing CVs (configuration variables) to have the sound you want to hear when you press a particular function. That's the way it has been since sound decoders became a thing. If you want to change a particular horn on an engine you have to either reprogram it (change the CV contents) on a programming track or do what is called Program On The Main (POM). On most club layouts POM is often frowned upon.

Enter the LokSound v5 sound decoder. It has the ability to change horns on the fly by repeatedly pressing a user assigned function key. Actually, you can change several different sounds this way but this discussion will demonstrate changing horns. We will use the S0523 sound file for this exercise.

Once you have the sound file loaded click on the decoder pane on the left and then click on the Sound Slot Settings sheet. In the right window you now have the SoundCV Configuration with the Sound Slot Configuration below. Notice that SoundCV 9 is labeled Horn. This is the CV we will be manipulating. See figure 1.

Figure 1 SoundCV Configuration

SoundCVs were added to allow the user to make changes to certain sounds and not have to rewrite the entire sound file to the decoder. You just Write Decoder Data from the menu. They also are accessible when programming in the Sound Pane when working with sound slots and that is the key to this exercise. If you've never programmed with the LokProgrammer the author highly recommends you complete this exercise first. It will show you how to create a sound slot which is what this exercise is going to accomplish.

Let's start by changing to the sound pane and then double click on sound slot 2 because it's empty. Under Sound Slot properties name this slot Horn Select (or whatever you want). Next click on State twice and arrange them as shown in Figure 2. Next add four Transitions and arrange them as also shown in figure 2. This is the basic layout. If you haven't completed the exercise mentioned above you won't understand how to or what you're doing here.

Figure 2 The basic layout

Conditions and Actions
These are what guides the logic. Click on the transition between Mute and State. In Conditions select Function and set it equal to true. In Actions select user1 and set it equal to 0. Now click on the upper transition between State and State(2). In Conditions select Function and set it equal to false. In Actions select timer1 and set it equal to 5. This is the start of the double click loop that will change the value in SoundCV 9.You Should now have figure 3.


Figure 3 First Conditions and Actions

Now for the lower transition. Select it and in Conditions select Function and set it equal to true. In Actions select User1 then "+" and set the value to 1. This is shown in figure 4.
Figure 4 Closing the Loop

These two states allow you to double click the selected function button repeatedly and the value of u1 will increment by one everytime. Now for the exit condition of the sound slot. Click on the bottom transition of State(2). In Conditions add 2 different ones. First, Select Function and set it equal to false then select Timer1 and set it equal to 0. In Actions select SoundCV9 and type in user1 for the value. This is probably a bug in LokProgrammer's software because you get no dropdown for any SoundCV selection but it will accept a typed in value. Results are shown in figure 5. Lastly, turn on looping in both states since exit conditions are not allowed in non-looping sound states.


Figure 5 The Exit Conditions

Finally go to the Decoder Pane, Function Mapping sheet and assign your Horn Select sound slot to an empty function key.
The author recommends you save this to your template files and then run it in the simulator. Double clicking the assigned function key will increase the user1 variable value for every click except for the first double click. This allows resetting the horn to the beginning value. When you stop clicking, the value is assigned to the SoundCV9 variable thereby changing the selected horn.

Recommendations
When you look at the horn packs for engines some of them contain a lot of horns.

Starting Point
Let's say we like horn #10 of a 16 horn pack. So you want it to start there when you increase the user1 value. Change the initial transition from user1 = 0 to user1 = 10. However, this will prevent being able to select any of the first 9 horns.

Safety Factor
In the lower transition to the left of state(2) it may be advisable to put a second condition of user1 < x where x is some number greater than 1. As is, double clicks will just continue to increase the value until the user stops clicking. If you go beyond the last horn in the pack, who knows? The x should be 1 less than the maximum value you want because u1+1 will increase the value on exit.

Rearrangement
You could rearrange the order of horns in the horn pack but that would be a ton of  work.

This is a simplified version of changing horns inspired from an exercise by Apoorva, the Indian Rail Modeler. He has a YouTube video on this here.

The author is sure you can come up with other things to make this better. Most of all 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 

Sunday, November 24, 2024

LokSound Momentary Function Keys For Power Cab

A member of the groups.io forum emailed the author and included an interesting sound slot file that simulates a momentary button for the Power cab. He wanted to know if it could be put on the Hostlers Inn blog for use by the readers that also have Power Cabs. He could not remember for certain but he believed that Dave Heap was the one who originally came up with this. It is fairly simple and it does work. See figure 1.


Figure 1 The momentary Function

All the user has to do is create a sound slot file (a tutorial for doing this is located here) and recreate figure 1 in that sound slot. Once completed, copy the function file to your LokSound Templates folder for future use. Assigning that sound slot to a function button on the Function Mapping sheet gives that button the functionality.

Figure 2 shows the Action Container. This is where the actual sound is accessed. In this case it is solely a simple bell ring that demonstrates sound placement.


Figure 2 The Action container

This could be as complicated as the Grade Crossing Signal that was discussed here

This is another exercise in utilizing user variables along with creating simulated momentary buttons for the Power Cab.


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