login

online now

We have 135 guests and no members online

search

 
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: How to produce new sounds, like light saber sound?

How to produce new sounds, like light saber sound? 4 years 7 months ago #383

I really would like the lightsaber that I built from an Arduino to sound like a light saber. I have an accelerometer, so I can vary whatever knob you give me in a sound effects function in order to make that hum sound that changes pitch as the lightsaber is swung around.

But I'm afraid that all I can do is just use the sample sounds that come with the GinSing. I have no idea how I would take one of those sounds and modify it, or to create a sound effect from scratch. I have tried to use the software, but there were too many buttons and sliders that I didn't know what I was doing.

Please help! Thanks!
The administrator has disabled public write access.

Re: How to produce new sounds, like light saber sound? 4 years 7 months ago #384

One thing that might make it much simpler is to start with one of the preset sound effects ( and the sample code ), and then use the tweaker to see what sliders you can tweak for the realtime controls.

One of the sample programs ( _presetmode ) cycles through each of the effects in order, playing each one for one second. You can modify the delay() call in this loop to make each play longer to see which one is closest to what you are looking for. Once you have the "baseline" effect, you can modify the code to play only that one. I have included the constants ( in GinSingDefs.h ) below to give you the explicit preset ID to use. For example, this code will trigger the PowerLines effect. You can replace the code in _presetmode() to remove the look and just trigger this effect:



preset->load ( 0 , PowerLines ); // load the selected preset on bank 0
preset->trigger ( 0 ); // trigger the preset on bank 0


So this modification to the sample program setup() function would have the sound effect started and ready for realtime tweaking via the loop() function. The loop() function would presumably read the input data and then use that to modify the effect as needed. Here are the effect IDs to choose from ( note the integer value is what is used in the test loop ):



enum GSPreset
{
SpaceWarp = 0 ,
Waba = 1 ,
RandomThoughts = 2 ,
Gong = 3 ,
Pwang = 4 ,
Wow = 5 ,
Rananana = 6 ,
Twarty = 7 ,
Telly = 8 ,
Pulsator = 9 ,
Bound = 10 ,
TipToe = 11 ,
Spokes = 12 ,
Chopper = 13 ,
Phazer = 14 ,
PowerLines = 15,
HeavyMetal1 = 16 ,
HeavyMetal2 = 17 ,
ACMotor = 18 ,
YaYa = 19 ,
March = 20 ,
NoiseChatter = 21,
BlipChatter = 22 ,
Carney = 23 ,
EarthQuake = 24 ,
MindProbe = 25 ,
Siren = 26 ,
Squaba = 27,
SteamLoco = 28 ,
FreqMod = 29 ,
AmpMod = 30
};



If you then load this preset into the Tweaker, you can hear the same effect. You can then experiment with changing the values to see what kind of variation you want. When you find something interesting, note the code in the window that shows you what to add to your Arduino loop() code. You can actually just do a "paste" function in the Arduino IDE and the code will be copied there. The only thing left would be to associate the value in the code to the input you want from the Arduino.
Last Edit: 4 years 7 months ago by administrator.
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 0.142 seconds