PDA

View Full Version : Don't laugh need to make choo choo train sound with prop



mikediv
12-23-2009, 07:50 AM
Hi guys I need some help I wired up a project for my wife she has this stupid electric train that goes around the Xmas tree, Its actually kind of cute I used a prop chip and wired up some blinking lights and stuff but she wants it to make the choo choo sound I built the circuit
with a pizeo using prop pin P0 and the Parallax Pizzeo but I have no idea how to get it to make that sound I used a PWM object and tried to tweak it but the sound is scary and really painful to the ears lol can anyone help me out it does not have to be fancy just go Choo Choo every few minutes Thank you and Happy Holidays to everyone

Oldbitcollector (Jeff)
12-23-2009, 08:04 AM
You could cheat just a little and use Rayman's wav player from the OBEX.
You might even get the sound to fit into memory. *maybe*

Just Google for a suitable wav and a copy of Audacity and you'll be in business.

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

Phil Pilgrim (PhiPi)
12-23-2009, 08:53 AM
I'll bet Chip's vocal tract object could emulate a "chuff-chuff-chuff" sound really well.

-Phil

mikediv
12-23-2009, 09:03 AM
As always thanks guys, I am not trying to be lazy but I could use a bit more detail lol ??? Phil where can I get Chips code and OldBit that's actually a very good idea I did see a little bit about Ray's player but is it a big deal to construct?? What I have guys is a prop proto board
it was no big deal to hook up the LEDS and Pizzeo but its just a Parallax Proto board not the demo I did wire up Video on Pins P12-P14 and the Audio I copied the Parallax Prop Demo board circuit but I do not have an SD card I could connect one if given the details OldBit wouldn't I need an SD card for Ray' Player ???? Thanks guys its really important to her and after 14 years to be honest I just do what I am told lol

Phil Pilgrim (PhiPi)
12-23-2009, 09:14 AM
Mike,

Chip's code is in the OBEX: obex.parallax.com/objects/72/ (http://obex.parallax.com/objects/72/)

-Phil

Oldbitcollector (Jeff)
12-23-2009, 09:41 AM
Here's some links for what I had in mind..


Ray's wav players (I'd use the 8bit version for this)
obex.parallax.com/objects/324/ (http://obex.parallax.com/objects/324/)

Audacity (Best way to convert your wav to the proper filetype.)
audacity.sourceforge.net/ (http://audacity.sourceforge.net/)

and of course a good source or two for train sounds. (thanks Google)
www.grsites.com/archive/sounds/category/29/?offset=0 (http://www.grsites.com/archive/sounds/category/29/?offset=0)

If you use a small enough sound, you should be able to make it fit in memory.

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

w8an
12-23-2009, 10:39 AM
My first thought was also of the vocal tract. In fact, there is a program that "breathes". Bet you could speed up the breathing and it'd sound like a steam engine puffing.

For the whistle, just run over to the local toy store and get one of those wooden train whistles you blow into. Put a small PC cooling fan at the end and fire up the fan every few moments.

Steve

Baggers
12-23-2009, 04:23 PM
What about or SIDCog? I've no idea what values to send it, but I'm sure Ahle2 should be able to assist :D the SID chip used to make some great sounds on the C64 games, so should be able to do a decent train sound effect.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

·

Ariba
12-23-2009, 07:46 PM
I was curious how easy this would be to make, so I tried it.
Here is the result, only 30 Spin lines of code!

Andy

Ahle2
12-23-2009, 10:33 PM
Here is a train sound emulation using SIDcog ;)
With the ability to set engine speed and timing between whistles.

JonnyMac
12-24-2009, 12:16 AM
Okay, Ahle2, that's just cool -- am going to have to find docs on your SIDcog so that I can put it to use next Halloween!

Fxc2hh
12-24-2009, 12:29 AM
Nothing is as realistic as recording a real steam train with bells and whistles:

http://www.strasburgrailroad.com/

mikediv
12-24-2009, 01:09 AM
Wow what can I Say, you guys are awesome man thank you all very much. I got side tracked last night cleaning the house I have a big Italian family and I am the oldest son so we always do a Xmas eve party at my house. I will post some pictures of the schematic and final project so you guys can see it. The train is actually pretty cool it goes around the base of the Xmas tree and little kids love it. My wife has to get every decoration you can find after Xmas. The train has to additional cars and the detail is really good, The only thing it was missing was blinking lights and sound, Evidently you can buy lights and the cho cho train sound but get this, 4 white LEDs to the extra cars $110.00 the sound device $125.00 looking in the catalog the LEDs are just that LEDs and sound board has a plug that goes into the train main car which is 12V I can not tell what's on the board from the picture but its tiny with a little piezzo speaker I suspect its like the greeting cards that play songs but for $125 bucks I could use a prop demo board and have the thing drive me to work for heaven sake LOL

Well thank you all for the help I will post some pictures tonight happy holidays guys.
Mike.

Baggers
12-24-2009, 01:22 AM
Look forward to the pics :) I told you Ahle2 and his SIDcog would come up with something good for you :)

Nice 1 Ahle2, it sounds great!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

·

Ahle2
12-24-2009, 04:48 AM
Baggers said...
Look forward to the pics :) I told you Ahle2 and his SIDcog would come up with something good for you :)
Nice 1 Ahle2, it sounds great!

Thanks Baggers!
It turned out a lot better than I initially expected for a fast little hack.
Of course I couldn't let you down(or mikedev for that matter) when you suggested to use SIDcog.

And I almost forgot...
Merry christmas to you mikediv and everybody else.

Baggers
12-24-2009, 04:52 AM
No probs Ahle2 :) I knew you'd enjoy the challenge, besides things like that is what the SID was made for :)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

·

Ahle2
12-24-2009, 08:19 PM
Here is a much better sounding version ;)

Drone
12-24-2009, 09:10 PM
@mikdiv,

Have a look at this little KX1400 audio playback peripheral chip (about $2 USD in unit qty, $49 for full dev-kit) from Keterex. Not sure if it can do a choo-choo sound though. Maybe not enough bandwidth. Anyway, Parallax (or Sparkfun) should make a little breakout board for this puppy - nice:

www.keterex.com/kx1400.php (http://www.keterex.com/kx1400.php)

Regards, David

nohab
12-25-2009, 09:17 PM
This is very interesting!
I haven't played around with the sound parts of the Prop yet, can anyone tell me how to try TrainWave and/or TrainSound?
I have a Protoboard, can I connect a pin directly to a PC-speaker or something similar?

In my "to-do-project list" there is a wish for a·simulation of the bells at a railway crossing.
My idea is to sample the bells into a wav-file. Use Audacity to create two wav files, with slightly lower/higher tones then the original.
Play the wav-file with the higher tone until the train reaches the crossing, then switch to the lower-tone wav-file. Hopefulle this will sound like the Doppler-effect when passing a crossing.

Is it doable?
Any thoughts/ideas/suggestions?

Ahle2
12-25-2009, 09:38 PM
Have a look at PropDemoDschem.pdf (http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/PropDemoDschem.pdf)

Just duplicate the circuit connected on pin 10 and pin 11.(You don't need the amplifier though)

nohab
12-25-2009, 10:41 PM
Thanks for rapid answer!

So you mean that the connection to INL and INR, after the 1uF capacitor, is instead connected to the PC-speaker?

Ahle2
12-25-2009, 11:19 PM
Ariba suggested this cirucit!
Connect it directly to your PC speaker and enjoy.



Pin ───────┳──────── Left out
470Ω 10nF
Pin ───────┼─┳────── Right out
470Ω │10nF
 

StefanL38
12-26-2009, 03:00 PM
Hi Ahle,

that's a really good idea to add sound to the toys.

My son got a carrera car-racing set for christmas.

Now: I DON'T want you to sit there for hours and fiddling around on sound details.

ONLY if you have some C64 SID pressettings HANDY about racing cars can you post them?

Or maybe a link to a good source for C64 sounds?

best regards

Stefan

nohab
12-26-2009, 07:55 PM
Thanks Ahle2 and Ariba, works just perfect!

Oldbitcollector (Jeff)
12-27-2009, 12:04 AM
@nohab

Just in case that circuit didn't translate on your browser.. (Didn't see it correctly here.)

Grab a copy of the Propeller Cookbook from here:
ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf (http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beg inner.pdf)

There are a bunch of "Getting Started" Propeller circuits including the audio stuff. :)

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

nohab
12-27-2009, 06:17 AM
Thanks OBC, I have read the Cookbook earlier, for some silly reason I forgot about the audio part in it...

The circuit wasn't translated 100% correct by the browser for me either, but together with the reference to the demo board schematic, I understood it as a 470ohm resistor in series and a 10nF cap connected to ground. I tested and it worked just fine.

The cookbook mentions slighty different values for resistor and cap(s) but also a note that the caps can be omitted, so I guess that there is not just one correct solution but many.

Fred Hawkins
12-27-2009, 06:45 PM
Just cut and paste the funny browser circuit display to the Prop IDE to see it in its original glory. It takes me about 1/15th as long as making this post.

Ahle2
12-27-2009, 09:22 PM
JonnyMac said...
Okay, Ahle2, that's just cool -- am going to have to find docs on your SIDcog so that I can put it to use next Halloween!

Thanks.
I will make a "getting started" documentation and upload it to the SIDcog thread... it may take a while though, because it isn't a priority at the moment.


StefanL38 said...
Hi Ahle,

that's a really good idea to add sound to the toys.
My son got a carrera car-racing set for christmas.
Now: I DON'T want you to sit there for hours and fiddling around on sound details.
ONLY if you have some C64 SID pressettings HANDY about racing cars can you post them?
Or maybe a link to a good source for C64 sounds?
best regards

Stefan

I don't have any "pressets" sounding like a racing car.
To be honest I don't think SIDcog whould do a very good job at sounding like a racing car.
I will give it a try, but I will not sit for hours http://forums.parallax.com/images/smilies/wink.gif

Oldbitcollector (Jeff)
12-27-2009, 11:58 PM
Hey Ahle2, You could save yourself a lot of time by basing your instructional on the original C64
User's Manual on the SID chip. Shouldn't be that difficult to adjust the following instructions...

www.lemon64.com/manual/manual/8_1.html (http://www.lemon64.com/manual/manual/8_1.html)

Change the BASIC code to SPIN, removing the requirements for POKEing the addresses. :)

I'm betting Commodore won't mind.. :)


Edit: Heck, if FemtoBASIC supported DATA statements we could add the POKE commands and
have a C64 compatible SID in Femto..

must...not...give...in... other...projects...to.........finish..!

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

Post Edited (Oldbitcollector) : 12/27/2009 5:04:38 PM GMT

cgracey
12-28-2009, 02:48 AM
Ken had this neat train whistle which was actually four whistles in one unit, and it made that lonesome train sound that we all know (at least in the USA). I looked at that sound on the spectrum analyzer I made for the speech synthesis work·and it turned out to be a C-minor-7th chord. In other words: C + Eb + G + Bb. If you could make four narrow-band resonators and excite them with white noise, you could replicate those four whistles quite nicely. The resonators in VocalTract.spin are too wide-band for that use, but you could definitely do the chug-chug sounds with it. Who knows, maybe you could set the F1-F4 resonators to those four notes and get something passable.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


Chip Gracey
Parallax, Inc.

JonnyMac
12-28-2009, 03:15 AM
Oldbitcollector said...
Hey Ahle2, You could save yourself a lot of time by basing your instructional on the original C64
User's Manual on the SID chip. Shouldn't be that difficult to adjust the following instructions...

www.lemon64.com/manual/manual/8_1.html (http://www.lemon64.com/manual/manual/8_1.html)

Change the BASIC code to SPIN, removing the requirements for POKEing the addresses. :)

I'm betting Commodore won't mind.. :)

<snip>

OBC


I actually started doing that last night -- attached is a conversion of Example 1 from that manual. This file is a deliberately-direct translation so that I could get things working; once I did I started using other methods in SIDcog to make the program "cleaner."

Ahle2
12-28-2009, 08:28 AM
It would be nice to see SIDcog incorporated in a basic interpreter running on the propeller. Then you could use peeks and pokes exactly the same way as on the C64 to play sounds.


Oldbitcollector said...
Hey Ahle2, You could save yourself a lot of time by basing your instructional on the original C64
User's Manual on the SID chip. Shouldn't be that difficult to adjust the following instructions...
OBC

What do you mean OBC?
I pretty much know the SID-chip inside out and the examples in the in the user manual are on a very low level.
Based on my knowledge of the SID-chip and analog subractive sound synthesis in general, I doubt that it's possible to make it output a decent racing car sound.
Without cheating with samples of course. http://forums.parallax.com/images/smilies/nono.gif
Thanks for the tip anyway http://forums.parallax.com/images/smilies/wink.gif

@JonnyMac
Nice conversion.

@Chip Gracey
Your VocalTract emulation is awesome i must admit. :)

If I run two SIDcogs at once... one to the left and one to the right... I will have 6 channels to play around with.
It will be possible to make a C-minor-7th chord and having two channels for additional noice+resonance.
I'll give it a try.

Oldbitcollector (Jeff)
12-28-2009, 09:25 AM
Ahle2 said...

What do you mean OBC?
I pretty much know the SID-chip inside out and the examples in the in the user manual are on a very low level.



It's true and thus might be helpful for those using SIDcog without prior knowledge of
the SID chip or C64 in general.

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

Ahle2
12-28-2009, 06:21 PM
Oldbitcollector said...

Ahle2 said...

What do you mean OBC?
I pretty much know the SID-chip inside out and the examples in the in the user manual are on a very low level.


It's true and thus might be helpful for those using SIDcog without prior knowledge of
the SID chip or C64 in general.
OBC


I'm sorry OBC.
http://forums.parallax.com/images/smilies/blush.gif http://forums.parallax.com/images/smilies/blush.gif http://forums.parallax.com/images/smilies/blush.gif http://forums.parallax.com/images/smilies/blush.gif http://forums.parallax.com/images/smilies/blush.gif
I misunderstood your previous reply..
I didn't understand that you meant that it would help me in the making of a "getting started" documentation.

Actually I thought that you replied to me when I said "it might not be easy to make the SID sound like a racing car".
And that you tried to get me to read the documentation so I could understand how to make such a sound http://forums.parallax.com/images/smilies/blush.gif http://forums.parallax.com/images/smilies/blush.gif
Of course the examples and documentations in the user manual are excellent for beginners.

Here is a TrainSound emulation sounding like the "king of train whistle" used in the USA.
It has a 5 voice whistle sounding like a G-major 6th choord (GBDEG).

Post Edited (Ahle2) : 12/28/2009 8:47:57 PM GMT

Oldbitcollector (Jeff)
12-30-2009, 12:11 PM
No worries! I'm pleased that SIDcog is getting some well deserved daylight!

Chapter 10 of the Commodore sight and sound book is also awesome reference
for someone getting started with SID stuff. I'm hoping I can dig up an online
copy to share.

OBC

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?

Visit the: The Propeller Pages (http://www.warrantyvoid.us/tiki-index.php?page=Propeller) @ Warranty Void.

JonnyMac
12-31-2009, 12:04 AM
@OBC: Please do; I've been looking for any SID programming references that I can find.

T&E Engineer
12-31-2009, 12:19 AM
Aah. This reminds me of the TI SN76477 complex sound generator chip that Radio Shack used to sell. I remember making all kinds of sound effects of which a bomb dropping and explosion was my favorite. Take a look at this link on the LAST page (section 14) for a Steam Engine and Whistle Synthesizer. It uses a 555 timer chip for the whistle and the "choo choo" sounds are from the SN76477 chip.



http://docs.bgmicro.com/pdf/ics76477a.pdf

·or the newer smaller SN76488 version with built in audio amp: http://www.paulswan.me/arcade/datasheets/SN76488.pdf


Post Edited (T&E Engineer) : 12/30/2009 5:27:04 PM GMT

mikediv
12-31-2009, 12:41 AM
Wow I owe some apologies I promised to post pics and finish project but I just never found the time .. It worked perfectly I can not thank everyone enough The train was a big hit with the kids and everyone loved the sound ,, you can see in photos I used 8 Duracell AA batteries and the kids just killed them dead. Thank you all again you guys are my heroes..Ariba and Ahle2 I can not thank you guys enough for the code Ahle2 I ended up using your code and just tweaking it a tad to match the speaker I had There are actually 2 amp stages that I used I ended up using pin 11 and 12 of the prop so I would have one channel going to each amp sort like a stereo sound I can post a sound clip if you guys want to hear it it was excellent . I will have to do a second post with the rest of schematics the website only allows 5 pictures per post

Post Edited (mikediv) : 12/30/2009 5:47:53 PM GMT

Ahle2
12-31-2009, 01:38 AM
@T&E Engineer
The "TI SN76477" was actually the sound chip of the original "Space Invader" arcade game. (wiki)
Compared to the SID(or SIDcog for that matter) it's very limited and isn't suitable for music creation, but it can generate some cool retro sound FX.
It had one feature that was quite cool for the time. It was the first PSG that featured any kind of FM synthesis.... even before the Yamaha chips that became so popular in the 80s.

@mikediv
Glad it worked out so well.
Now I demand a YouTube clip of it in action ;)

BR
12-22-2011, 12:12 AM
Its that time of year again. Thought others might like to use this so I'm posting what I've done.

This is a modified version of Ahle2's previous post...uses a mouse to control the whistle and the train speed. Also have keyboard control of sound volume and tv_text output, though these are optional and not needed to make the demo run. I also modified the train and whistle sounds to suit my taste. It is set up to run on a demo board

I'd really like to add a bell sound and use the right mouse key to toggle it on and off. Spent some time trying to figure out how to make SIDcog produce a bell sound, but didn't get very far. If anybody has advice on how to generate bell sounds with SIDcog (or a starting point), let me know...I'd like to add this feature.

Enjoy, and Merry Christmas.

BR

87875

Paul
12-22-2011, 02:01 PM
I'd really like to add a bell sound and use the right mouse key to toggle it on and off. Spent some time trying to figure out how to make SIDcog produce a bell sound, but didn't get very far. If anybody has advice on how to generate bell sounds with SIDcog (or a starting point), let me know...I'd like to add this feature.


I made some awesome bell sounds with a twin-T filter and an oscillator http://en.wikipedia.org/wiki/RC_oscillator but that was thirty years ago. Should work on a separate port.

Merry Christmas,
Paul

Ahle2
12-22-2011, 07:35 PM
@BR
Most C64 games that had "bell sounds" used the ring modulator feature.
Make a call to "enableRingmod(bool, bool, bool)" to enable one channel to ringmodulate another channel.
Oscillator synchronization might also give interesting results. (enableSynchronization(bool, bool, bool))

Btw, download the latest version of SIDcog from the OBEX; Not only does it sound better, but it has also got some nice descriptive comments for all methods.

I will try this out later tonight!

/Johannes

Ahle2
12-22-2011, 07:43 PM
Here is an example of a bell made with ring modulation.

From 0:28 and onwards


http://www.youtube.com/watch?v=aVctoM6UZA0

BR
12-23-2011, 04:13 AM
Johannes, thanks for the advice. It has been fun playing around with SIDcog trying to figure out the bell sound. Attached is my second attempt...still not very good, but better than my first attempt at least.

I experimented with the ringmod and synchronization features, but honestly I couldn't tell that they did anything. I think I must not be using them right.

Is there an easy way to experiment with sidCOG sounds without having to re-download every time a parameter is changed? I'm thinking of a simple setup that perhaps uses Parallax serial terminal to dump all parameters to screen and keyboard input to modify the parameters on the fly.

EDIT: this version is OBSOLETE...see post #46 below.

Ahle2
12-23-2011, 07:23 AM
"Is there an easy way to experiment with sidCOG"

Yes indeed.... have a look at SIDcog serial player (http://forums.parallax.com/showthread.php?130658).

* Connect a Propeller chip with the SIDcog slave running.
* Launch the Windows GUI (I can compile it for Linux or MacOs as well)
* Click on the settings tab and enter the correct COM port and Baud rate (115200)
* Click on the "Direct control" tab to play around with all available parameters of SIDcog.

Btw, download and use the latest version of SIDcog on the slave.

(Don't forget to download some christmas sid tunes to play in the SID player tab!! :) )

/Johannes

BR
12-25-2011, 03:45 AM
Here's my latest attempt, just in time for Christmas. I added a bell sound, but it is very anemic and needs work. Also cleaned up the code a bit to make it more manageable.

There are still many things that could be improved, but my toddler (who is a Thomas fan) loves it as it is...and there's always next year. Hope others can enjoy it, too.

Merry Christmas.