Digitrax SoundFX Programming Explained

This is an overview about programming Digitrax SoundFX decoders. After reviewing the existing sound project examples, one comes to realize the only limit to their functions, other than memory size, is our own imagination. It is possible to program any function key to perform an action, even depending on whether the loco is idle, moving forward, or in reverse.

I’ve taken an existing sound project sample file, from the yahoo support group
http://groups.yahoo.com/group/digitraxsound/, and modified it for use in my AC4400 which does the following:

Pressing F2 when the loco is idle and in forward, results in two toots.
Pressing F2 when the loco is idle and in reverse, results in 3 toots.
F2 Horn works normally when the loco is moving.
F7 is the grade crossing horn with ringing bell, the bell stops when F7 is pressed again.
F10, F11, F12 are used for cab chatter - voice instructions recorded from rail traffic heard thru a scanner.
The horn sound I used was obtained from the internet.

Part 1 - The Basics

Hardware Requirements:

A computer with a serial port.
A Serial to USB converter, if your pc doesn’t have a serial port (Startech USB to RS-232 Serial DB9 adapter works, with the correct driver).
Digitrax PR2 Programmer.
Digitrax PS12 12v power supply, you may have a 12v 300ma one onhand for some other device which could be used.
A piece of track.
Digitrax decoder - I used an SDH104K1A+FN04K1 Combo installed in an HO Kato AC4400.

Software Requirements:

MS Windows, XP or Vista work well.
SoundLoader software downloaded for free from the Digitrax website along with any of the existing sample sound projects in the SoundDepot www.digitrax.com/sounddepot.php . To create ones own sounds, download and install the free version of WAVEPAD from www.nch.com.au/wavepad/ .

No problems were encountered installing any of the software mentioned in this note. The PR2 requires a serial port on the pc or

Thanks a lot. I’ve just ordered an SFX0416 for a trolley project. Someone did post a trolley project at Digitrax, so I’ve got the files, and my LHS says I can use their PR-2. (I’m wondering if that serial port requirement will be a problem, though. He hasn’t hooked up his PR-2 yet.)

[tup]

Good explination about programming the SFX, but Im afraid it is beyond most of the users on here.

One thing that needs to be said, the 2 programs needed to assemble the .sdf files are NOT public domain and can ONLY be attained by emailing AJ at Digitrax. Sharing of these files is NOT permitted and is clearly stated when AJ sent me the files over a year ago.

The SFX has limitless possibilities and I have been pushing them on these forums for years now. Glad to see another has followed suit.

Let me know if you can figure out how to program actual notches.

David B

Awesome Post!!! And timely. I just received my PR2 in the mail today. I am also an embedded system programmer, and I won’t be able to resist messing with the SDF file.

I installed my PR2 and it’s software on an old Windows ME computer. I seems to work fine, so Windows XP is not a strict requirement.

Jim

Dave,

Thanks for the compliment about my note. I have good news for you, there is no longer any need to maintain secrecy about the two Include files. The note I received a few days ago from AJ did not say anything about that and I have basically repeated everything he did mention in my note above.

If I were to share those files with someone, I would forward AJ’s entire note so they can read all his comments. This would save AJ precious time I’d rather he spend with product development.

I’m not concerned with how many users of this forum get any use from my note, I believe that spreading this knowledge around will benefit the product. For the few who decide to try programming these decoders, my note may help to advise them of what lies ahead and save them a few hours finding software, installing and using it.

Unfortunately I’m not interested in notching.

Don

I live in Calgary as well. Perhaps we can get together and try and figure out AJs programming language together…let me know in a PM.

I am working on actual notches…it is possible, but there are some bugs to work out.

David B

Once you guys figure this out, please keep me in the loop. I am a software guy, so new programming languages, etc don’t scare me in the least.

I have some special uses I would like to make of the Soundbug, but I would need to know how to program sounds to throttle notches.

You can email me via this forum and we can take it from there.

If it helps, there are some files on the yahoo digitraxsound group which deal with notching. Also, the factory installed SD38-2 project seems to me that it uses notching or something similar.

The RS32 project on the digitrax site, on the other hand, does not seem to have any notching capability. The engine sounds in that one get louder when the throttle is advanced, but there is no change in frequency. I have not heard an RS32 for myself, but I would suspect some increase in engine speed with the throttle setting, no?

I’d like to get a copy of the macro definition include files and AJ’s notes. Is it still preferred that I request those directly from him? I didn’t figure I was quite up to speed enough to bug AJ yet.

Jim

Those files are ‘limited’ in what they actually do.

In terms of the SD38-2 project file, it just pitches up notch 1 to get notch 2, notch 3…etc. Real notches sound different.

David B

Well, we need to crawl before we run, or I do anyway. My first challenge is to figure out why the factory default SD38-2 sound project supports CV11 (which can be set to 6 to turn the sound off 6 seconds after the engine speed is set to 0 or 0 to keep the sound on indefineatly) but the RS32 sound project from the Digitrax web site does not seem to. Off into the depths of the sound files I go … [4:-)]

If I figure it out, I’ll let y’all know.

Jim

Well, here’s what I found out:

First of all, the soundbug DOES support CV11=0 for infinite sound timeout. It does not seem to like being programmed in OPS mode with my PowerCab. On the programming track, the PowerCab is quite happy to read and write CVs, even though the soundbug is not plugged into a decoder, and hence has no function or motor loads. I set CV11=0, and now the engine sounds keep running while the speed is set to 0. There is no way to force the shutdown sequence the way the timeout does that I’ve found yet.

Now, I loaded up the .SPJ file in JMRI LocoNet and viewed the embedded .SDF file. I had some help from the commented .ASM file from a sample, and I found the following snippet in the SDF file as decoded by LocoNet:

INITIATE_SOUND TRIG_SND_ACTV11,NOT_TRIG
LOAD_MODIFIER MTYPE_GAIN,IMMED_GAIN_MODIFY,SCV_FREEFORM,SCALE_6
PLAY 28,no_loop,loop_STD
PLAY 33,no_loop,loop_STD
PLAY 0,no_loop,loop_STD
LOAD_MODIFIER MTYPE_WORK_IMMED,FMATH_AND+WORK_STATUS_BITS,WKSB_ANALOG_MASK+WKSB_DIRNOW_MASK+WKSB_ACEL_MASK+WKSB_SPDDELTA_MASK+WKSB_MATH_MASK,0
BRANCH_TO 18; from base of 0

I believe the TRIG_SND_ACTV11,NOT_TRIG is an event which is activated when the decoder software determines the activity timer, as controlled by CV11, times out. In this case, it plays a few sounds associated with engine shutdown, and the BRANCH_TO 18; from base of 0 mutes the sound.

Going back to the statement above where I said there is no manual shutdown method that I could find, I believe it would be possible to map an unused function key, or even one set for a grade

I’m making progress…

I have downloaded and installed JMRI 2.0, which includes LocoTools. LocoTools includes some LocoNet tools, including a tool which allows one to open a .SPJ sound project file, and fiddle with sound wave files like soundloader. It also can display the contents of the embedded .SDF sound definition file. This can be copied and pasted into an editor.

I have downloaded and installed MPLAB IDE 8.0, which allows assembler files like those available on the digitraxsound Yahoo group to be assembled into .HEX files which can be imported into a sound project file. One needs the magic macro definition files to get the assembly to work. I did manage to get an error free assembly and a .HEX file which appears to match the contents of the .SPJ file when viewed with a hex editor.

On the first try, I was not able to assemble the SDF file output of the LocoNet SPJ editor. The raw output itself is lacking the header information where the processor is defined, cblock definitions, macro includes, etc. - basically everything before the “SKEME_START”. Beyond that, there may be some stuff missing at the bottom of the file. I’ll work more on it later.

Jim