Use teensy to create engine sound generator

Status
Not open for further replies.

pks8

Member
Hi all,

I am now working on a sound project which needs to use teensy 3.2 to create some "noise" for the quiet electrical engine.

This project has a few requirements :

1. standby, wake-up, sleep modes
2. sound types control (able to switch among different kinds of engine sound)
3. idling, forward, reversing three phases
4. in forward phase, when start to accelerate, the engine sound will increase its volume and frequency like a real car engine sound performance
5. brake sound

In the last two weeks, I tried to study teensy 3.2 and started programming. Requirement 1, 2, 3, 5 all can work already. However, I don't know how to solve requirement 4 since I didn't figure out how to change source audio frequency. In the previous demonstration, I changed the source audio to waveform to represent engine sound so that the frequency can be easily changed. In my own opinion, the waveform sound is quite similar to engine sound but it seems my supervisor was not so satisfied with it.

Is there any function in teensy 3.2 to change the audio frequency or anyone can give some suggestions to hit the requirement 4? Does there have similar teensy projects for me to study?

Thank you !!
 
Is this generating the audio from various oscillators/instruments or is it playing pre recorded clips? If you are synthesizing it is relatively straight forward to step things up or down but if you are playing prerecorded engine noises then you you are trying to change things so the clip runs faster while not changing pitch, which I do not believe is possible out of the box - the google term is normally pitch shift, though you would also be changing the playback speed.
 
Thanks for your reply! I expected there would have a reply notification so didn't notice that someone replied my post.
Based on the requirements, I am supposed to play the prerecorded engine audio files stored inside SD card. I am using an analog knob to represent the speed signal from CAN bus. While the speed is increasing, the sound volume is increasing and become very sharp like a real engine performance. Currently I cannot figure out how to use this analog knob to control audio files.
 
Is this generating the audio from various oscillators/instruments or is it playing pre recorded clips? If you are synthesizing it is relatively straight forward to step things up or down but if you are playing prerecorded engine noises then you you are trying to change things so the clip runs faster while not changing pitch, which I do not believe is possible out of the box - the google term is normally pitch shift, though you would also be changing the playback speed.

Thanks for your reply! I expected there would have a reply notification so didn't notice that someone replied my post.
Based on the requirements, I am supposed to play the prerecorded engine audio files stored inside SD card. I am using an analog knob to represent the speed signal from CAN bus. While the speed is increasing, the sound volume is increasing and become very sharp like a real engine performance. Currently I cannot figure out how to use this analog knob to control audio files.
 
Perhaps you can simply play the same small files repetitively, and reduce the time between playing to make the faster sound?

Maybe play 2 or 3 simultaneously and mix them together?

If the sound samples are small, it might be simplest to convert them to .c & .h files with wav2sketch and just put them into your program. Playing is much more efficient that way. Click File > Examples > Audio > SamplePlayer for example code, or check on Part 2-3 of the tutorial, starting on page 14, or just watch that part of the video if you'd rather see me & Alysia demo it.
 
Perhaps you can simply play the same small files repetitively, and reduce the time between playing to make the faster sound?

Maybe play 2 or 3 simultaneously and mix them together?

If the sound samples are small, it might be simplest to convert them to .c & .h files with wav2sketch and just put them into your program. Playing is much more efficient that way. Click File > Examples > Audio > SamplePlayer for example code, or check on Part 2-3 of the tutorial, starting on page 14, or just watch that part of the video if you'd rather see me & Alysia demo it.

Thanks for your suggestion! I will definitely try out the example.
You workshop video with Alysia is very useful and informative, it gave me a great help during my last two weeks teensy study.
 
Status
Not open for further replies.
Back
Top