ElectricMotorcycleForum.com

Tech => Parts, Mods And Hacks => Topic started by: mikeisted on April 27, 2015, 02:56:29 PM

Title: Sound Generator
Post by: mikeisted on April 27, 2015, 02:56:29 PM
Hi All

I am going to build sound generator for my Zero S ZF9 and thought I'd throw the discussion open to see what others thought might be useful features.

I've tried unsuccessfully to contact SoundRacer and so I'm going to put something together myself.  Whilst harder work, it gives the opportunity to do other things as well as replicate ICE engine noises.

Thoughts right now are around:
- Sound needs to reflect speed of bike (pitch? volume? linear? exponential etc?);
- Easy to localise, especially at low speeds when around pedestrians;
- Choose from hi-tec effects and/or classic ICE sounds;
- Must sound good and enhance enjoyment of riding;
- Simple to install (just connect to 12V supply) and no (or only optional/fun) setting up and customising.

All thoughts and advice welcome!

Cheers





Title: Re: Sound Generator
Post by: Justin Andrews on April 27, 2015, 03:01:18 PM
Well for starters, I'd look at using granular synthesis to generate your engine audio.
Title: Re: Sound Generator
Post by: Lecram on April 27, 2015, 04:11:39 PM
Something like this?  8)

https://www.youtube.com/watch?v=qqpcBpSsj1A (https://www.youtube.com/watch?v=qqpcBpSsj1A)
Title: Re: Sound Generator
Post by: steven_first on April 27, 2015, 06:06:54 PM
Something like this?  8)

https://www.youtube.com/watch?v=qqpcBpSsj1A (https://www.youtube.com/watch?v=qqpcBpSsj1A)

Damn...beat me to it!
Title: Re: Sound Generator
Post by: Doctorbass on April 28, 2015, 10:52:14 AM
I have bought the EVSM-2 from soundracer with succes. It work well.

Just try contacting the guy on FB ;)

Doc
Title: Re: Sound Generator
Post by: tyskmoped on April 28, 2015, 11:29:02 AM
Do you have any video Doctorbass? Greets
Title: Re: Sound Generator
Post by: mikeisted on April 28, 2015, 08:13:15 PM
Hi DoctorBass

Good suggestion, but I'm already well down the route now - have built and tested the synth circuits - now scouting amp/speaker combinations for all-weather use

Hope to have something up and running by the end of the week and will then play with sound combinations for fun.

Cheers




Title: Re: Sound Generator
Post by: mikeisted on April 28, 2015, 08:31:34 PM
Justin - granular synthesis looks fun and I'll investigate how to include it. 

Thanks for the advice!


Title: Re: Sound Generator
Post by: MotoRyder on April 29, 2015, 10:41:59 PM
How 'bout sound synthesis of "loud barking dogs" to deter all the little yappers in neighborhoods fron running alongside and nipping at the heels of cyclists. 
Hit the Sound Button and a streaming sound of angry barking dogs coming from the cycle would definitely be an "ear-opener".   :o
Title: Re: Sound Generator
Post by: mikeisted on April 30, 2015, 01:46:13 AM
So far, granular synth included as input along with a tai fighter and a doberman.... Should be good!
Title: Re: Sound Generator
Post by: mikeisted on April 30, 2015, 01:48:28 AM
Just thought - doberman likely to turn into a Pekinese as bike speeds up... Could be embarrassing.:/
Title: Re: Sound Generator
Post by: Doug S on April 30, 2015, 01:53:35 AM
Just thought - doberman likely to turn into a Pekinese as bike speeds up... Could be embarrassing.:/

Other way around. As the bike is coming toward you, it's a chihuahua. When it's going away, it gets bigger.
Title: Re: Sound Generator
Post by: mikeisted on May 01, 2015, 05:09:15 PM
Quick update - synth circuitry has been built and is entirely software configurable.  I'm just scratching the surface of what it can do and sticking to playing with some granular synth sounds in the first instance.  Thanks for the suggestion, Justin.

Still waiting for 20W amp and mylar speakers, so may not be able to install this weekend. :-\

I've attached a sound file (hope it uploads ok) of one sound I am working with at the moment.  The idea is to have a bass component which is independent of speed, and a treble component which is proportional to the speed.  The treble component is also delivered in 'chirps' and mixed with a little pink noise to aid localisation of the sound.

Speed and acceleration (which modulates bass tones) is taken from built-in GPS.

On my Zero ZF9, there's a big space under the seat, so for ease I'm building an all-in-one mono unit right now.  Next step will be to place the speakers behind the belly pan on each side of the battery and sort mounting/waterproofing there.  That would take full advantage of the 20W stereo amp on board.

I'd also like to start playing with some sound samples (yes, and the Doberman!) for fun.  For myself, I'm less interested in ICE sounds right now but will get around to that later I think.  It seems to me there are more interesting things to be done first (e.g. fitting a magnetometer and adjusting the sound for bike lean).


Title: Re: Sound Generator
Post by: Burton on May 01, 2015, 06:46:01 PM
This thread needs pictures ... in fact, there should have at least been 2 per update ;)

Are you using off the shelf components or making your own circuits and soldering them onto a project board?

Would love to get a list of what you are using and how they are interconnected.

I am more interested in synthetic sounds over trying to replicate ICE sounds. I have thought about just miking the belt side of the motor (as it is the nosiest) and amplifying the native sound since to me it sounds pretty cool.

I haven't started to do research into components yet but I do mic the other side of the motor for vloging purposes.
Title: Re: Sound Generator
Post by: mikeisted on May 03, 2015, 05:10:48 AM
Sure thing Burton.  I'll post some pictures over the next few days as I go from breadboard to solder the prototype.
Title: Re: Sound Generator
Post by: mikeisted on May 05, 2015, 05:19:24 PM

So here's a work-in-progress snapshot of where I am right now.

The audio is generated using a Teensy 3.1 and Teensy Audio Board, both available from pjrc.com.  They are stacked (audio board on top) on the left of the breadboard.

On the right is the 20W Class D Amplifier from Adafruit.

The Teensy is powered from the amplifier (which will be connected to the 12V accessory connector on the Zero), via the 5V regulator visible at the top. For now, a 9V battery is supplying the amp.

The volume of the amp is software controlled using the I2C port (yellow/white/grn jumpers), but is also capable of being analogue controlled with a potentiometer.

Connected to the Teensy via UART is a standard gps unit, available from many radio control/UAV stores, such as HobbyKing.  It supplies the bike speed, which is then used to control aspects of the sound (volume, waveform frequencies etc.) .  For desktop testing, the blue potentiometer is connected to an analogue pin on the Teensy (A0) as a proxy for the speed.

There is a bunch of documentation on-line for all these components, together with an excellent tool for the audio board which allows combinations of sound effects to be built using a GUI.  My own software is very fluid right now, but I'm happy to share it on request.

Everything listed so far works great.  The problem at the moment is the speaker, which is the 8W mylar speaker (image attached) from Maplin here in the UK.  I think it's going to be too quiet.  I checked it was the speaker by connecting some decent Tannoy speakers to the amp, which was much more satisfactory! 

I'll continue with the current all-in-one unit for now - it will at least allow the GPS 'system' to be tested.  But I suspect it will be necessary to progress to a system with external speakers thereafter.

Burton - hope that's more useful.  I'll keep this thread posted on developments.

Title: Re: Sound Generator
Post by: Burton on May 05, 2015, 10:30:09 PM
Are there any other builds using the Teensy you are basing your design off of?

I have only ever played with the adafruit but only briefly.

Being someone who has played many instruments in the past, someone who has "created" sounds with synths, and a developer I have a pretty good idea of what I would like to create but have never dived into the "maker space" side of things :)
Title: Re: Sound Generator
Post by: mikeisted on May 06, 2015, 12:10:19 AM

So it's a little neater now it's mounted on stripboard.

I've decided to go straight for the external speaker solution, with electronics in a smaller enclosure.

Burton - my experience is the other way round - quite a lot of build but new to synthesisers.  I have been very impressed by the flexibility of the Teensy audio board - if you go to the web-based drag-and-drop effects tool, you may get some impression of what it can do without having to build anything at all.

It's at http://www.pjrc.com/teensy/gui/

So far I have just played with standard waveform inputs, modulation, flange and envelopes.  I am learning how to include my own samples so that I can create grains for a 'hashed' granular synthesiser.

I would be very interested in any thoughts you have on the synth side!

I may add a few more pots to allow for easier playing around with some of the effects before I put the lid on.

Cheers

Mike



Title: Re: Sound Generator
Post by: Doug S on May 06, 2015, 12:56:44 AM
Wow, mikeisted, you're taking me back to the home-brew stereo days that most of us EEs went through! I think you're right, you're badly under-speakered right now.

A few thoughts and/or suggestions: First, keep in mind that a bare speaker cone in free air sounds MUCH worse than when it's mounted in a proper enclosure, so you may not be quite as under-speakered as you think right now. The bass response of an unenclosed speaker cone is essentially nonexistent, and the midrange is not much better. At long wavelengths (low frequencies) the air can just run around the speaker cone to equalize front and back sound pressure levels, killing the audio; obviously an enclosure prevents that from happening.

That being said, however, anybody who played in band in high school can tell you that sound just disappears outside, so you're going to need a LOT of sound to be even audible on the bike, especially if you want to be heard by people in cars around you. High power is very helpful, of course, and your 20W amp isn't bad at all. But it's also important to have a very efficient speaker, so when you're looking around, be sure to pass over any speakers with mediocre efficiency ratings. And remember that the most efficient speaker enclosures of all almost invariably include an exponential horn, which match the acoustical impedance of the speaker cone (high) with the impedance of the free air you're radiating into (very low), to minimize losses.
Title: Re: Sound Generator
Post by: mikeisted on May 06, 2015, 02:38:03 AM
Thanks Doug.  That all makes good sense. I think Doctorbass said he was successfully using a Soundracer unit of similar power.  I wonder what speakers he was using?  Doctorbass, perhaps you would be kind enough to let us know?

Clearly I'll need to do some work thinking about the best way to mount the speakers.  Maybe some kind of 3d printed cabinet to fit behind the belly pan?
Title: Re: Sound Generator
Post by: mikeisted on May 06, 2015, 07:59:08 PM

Nearly finished now...

It's a bit of a squeeze, but everything fits into a box of size 110x60x35mm (excluding mounting tabs at each end).  The GPS sits in the top of the cover, as can be seen.

All worked well first time (which was a nice surprise), except no GPS signal.  Discovered I had managed to reverse the TX/RX lines from the breadboard version. So you can spot the grn/yel wires on the GPS connector now reversed from yesterday.

Power plugs in with a regular power jack so the whole thing can be easily removed, and the USB port is externally accessible as well for easy reprogramming in situ.

With the GPS working, I have switched over from dialling speed using the pot to detecting actual speed and acceleration using the GPS.

I took it out for a test spin in the car, with the system connected to the Aux input on the car stereo - just like SoundRacer.  All went well, so with the hardware largely finished, there's more time to think about the sound generation itself.

Doug - thanks for the advice on speakers.  I'm not sure I want it to function at all at speed as the primary use is to alert pedestrians to the bike.  I'm considering auto-muting the whole thing above, say, 30mph or even less.  So that means a huge set of speakers may not be necessary.  I took on board your comments and 'boxed up' the 8W Mylar speaker, which made a very significant difference.  I'm going to put it under the seat for now.

Burton - I have not based this on any previous designs.  I've just taken a modular approach with off the shelf items.  However if you (or anyone else) would like a closer look, I'll take some more pictures to show the circuit board etc.  And again, the code is changing, but I'll post a working copy on request.

Lastly, I'm wondering if some kind of handlebar control may be useful.  So for example to mute, control gain or set off the barking dogs sound track previously suggested!  Does anyone know of any way of adding handlebar switches safely?



Title: Re: Sound Generator
Post by: mikeisted on May 07, 2015, 04:19:23 PM
For info, I've posted this along with close up circuit images and the code at:
https://mikeisted.wordpress.com/2015/05/07/electric-vehiclerobot-sound-synthesiser/

Cheers.
Title: Re: Sound Generator
Post by: clockfort on May 19, 2015, 12:41:30 PM
Really wanted something like:
https://www.youtube.com/watch?v=n17B_uFF4cA (https://www.youtube.com/watch?v=n17B_uFF4cA)
Title: Re: Sound Generator
Post by: steven_first on May 19, 2015, 06:52:55 PM
This is exactly what I want to do except with the "Braap" noise.  If anyone else has interest I may have the skills to make something up that could be programmed to make these kind of noises.
Title: Re: Sound Generator
Post by: mikeisted on May 21, 2015, 03:39:10 AM
That's very funny.  Seems like it's just playing some sound samples, or am I missing something?
Title: Re: Sound Generator
Post by: steven_first on May 21, 2015, 07:55:59 PM
I was cruising the intronet last night listing to various sounds in movies trying to come up with some sweet sounds.  I checked out the tron light cycles (old ones sound sweet), the car from The Wraith, etc BUT I think the perfect sound for one of these bikes would be some variant of a Shepard tone like this https://www.youtube.com/watch?v=BzNzgsAE4F0. (https://www.youtube.com/watch?v=BzNzgsAE4F0.)
Title: Re: Sound Generator
Post by: mikeisted on May 24, 2015, 11:24:47 AM
These are great, Stephen_first. I'm going to have to do some more on this as I think the generator on my blog is quite capable of doing it.  However, it won't be for a little while yet as I have my head down on my Masters UAV project for now.
Title: Re: Sound Generator
Post by: steven_first on May 27, 2015, 06:43:57 AM
Well let me know if you want any help on either project as I know a fair amount about both of those things!
Title: Re: Sound Generator
Post by: SoundMusic on June 17, 2015, 05:45:26 AM
MYBELL: The 1st Customizable Digital Bike Bell and Lights

https://www.kickstarter.com/projects/1537964498/mybell-the-1st-customizable-digital-horn-and-light (https://www.kickstarter.com/projects/1537964498/mybell-the-1st-customizable-digital-horn-and-light)