ElectricMotorcycleForum.com

  • November 26, 2024, 03:46:18 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: 1 [2]

Author Topic: Sound Generator  (Read 5980 times)

mikeisted

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Sound Generator
« Reply #15 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.

Logged

Burton

  • Hero Member
  • *****
  • Posts: 1059
    • View Profile
Re: Sound Generator
« Reply #16 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 :)
Logged
All content I have created here http://bit.ly/1NX4KP9

mikeisted

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Sound Generator
« Reply #17 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



Logged

Doug S

  • Hero Member
  • *****
  • Posts: 1631
    • View Profile
Re: Sound Generator
« Reply #18 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.
Logged
There's no better alarm clock than sunlight on asphalt.

mikeisted

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Sound Generator
« Reply #19 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?
Logged

mikeisted

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Sound Generator
« Reply #20 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?



Logged

mikeisted

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Sound Generator
« Reply #21 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.
Logged

clockfort

  • Newbie
  • *
  • Posts: 41
  • 2015 Zero SR; Silicon Valley USA
    • View Profile
Re: Sound Generator
« Reply #22 on: May 19, 2015, 12:41:30 PM »

Really wanted something like:
Logged

steven_first

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: Sound Generator
« Reply #23 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.
Logged

mikeisted

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Sound Generator
« Reply #24 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?
Logged

steven_first

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: Sound Generator
« Reply #25 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.
Logged

mikeisted

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Sound Generator
« Reply #26 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.
Logged

steven_first

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: Sound Generator
« Reply #27 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!
Logged

SoundMusic

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Sound Generator
« Reply #28 on: June 17, 2015, 05:45:26 AM »

Logged
Pages: 1 [2]