# Blaster Sounds

**URL:** <https://crucible.hubbe.net/t/blaster-sounds/123>\
**Category:** ProffieOS\
**Created:** [March 23, 2021, 5:06pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123 "2021-03-23T17:06:33Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![savall21](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/savall21/32/306_2.png) [@savall21](https://crucible.hubbe.net/u/savall21)\
**Post date:** [March 23, 2021, 5:06pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/1 "2021-03-23T17:06:33Z")

</div>

I’m using a config if found in the forums for a blaster but I’m not getting any sound when I trigger fire. I think I just don’t understand how the fire action is tied to the wav files. I have BlasterCore v5 fonts copied onto the SD card. How do you configure what files are played for the fire action?

Config:  
#ifdef CONFIG\_TOP  
#include “proffieboard\_v2\_config.h”  
#define NUM\_BLADES 2  
#define NUM\_BUTTONS 2  
#define VOLUME 2000  
const unsigned int maxLedsPerStrip = 144;  
#define CLASH\_THRESHOLD\_G 1.0  
#define ENABLE\_AUDIO  
#define ENABLE\_WS2811  
#define ENABLE\_SD  
#define DELAYED\_OFF  
#define ENABLE\_BLASTER\_AUTO  
#define INCLUDE\_SSD1306 to CONFIG\_TOP  
#endif

#ifdef CONFIG\_PROP  
#include “…/props/blaster.h”  
#endif

#ifdef CONFIG\_PRESETS  
Preset presets[] = {  
// Default basic blast color with red audio flicker on blast  
{“bank4”,“tracks/march.wav”,  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
},

{“bank1”,“tracks/credits.wav”,  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
},  
{“bank2”,“tracks/swars.wav”,  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
},  
{“bank3”,“tracks/fates.wav”,  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
},  
{“bank5”,“tracks/credits.wav”,  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
},  
{“bank6”,“tracks/swars.wav”,  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
StylePtr\<Lockup\<BlastFadeout\<BlastFadeout\<Black,AudioFlicker\<Black,Red\>,250,EFFECT\_FIRE\>,AudioFlicker\<Black,Blue\>,1500,EFFECT\_STUN\>,AudioFlicker\<Black,Red\>\>\>(),  
},  
};  
template  
struct CreeXPE2DRedTemplate {  
static constexpr float MaxAmps = 1.0;  
static constexpr float MaxVolts = 2.5;  
static constexpr float P2Amps = 0.35;  
static constexpr float P2Volts = 2.1;  
static constexpr float R = milliohms / 1000.0;  
static const int Red = 255;  
static const int Green = 0;  
static const int Blue = 0;  
};  
template  
struct CreeXPE2DRed2Template {  
static constexpr float MaxAmps = 1.0;  
static constexpr float MaxVolts = 2.5;  
static constexpr float P2Amps = 0.35;  
static constexpr float P2Volts = 2.1;  
static constexpr float R = milliohms / 1000.0;  
static const int Red = 0;  
static const int Green = 255;  
static const int Blue = 0;  
};  
template  
struct CreeXPE2RBlueTemplate {  
static constexpr float MaxAmps = 1.0;  
static constexpr float MaxVolts = 3.4;  
static constexpr float P2Amps = 0.35;  
static constexpr float P2Volts = 3.1;  
static constexpr float R = milliohms / 1000.0;  
static const int Red = 0;  
static const int Green = 0;  
static const int Blue = 255;  
};  
BladeConfig blades[] = {  
{ 0, SimpleBladePtr\<CreeXPE2DRedTemplate\<1200\>, CreeXPE2DRed2Template\<1200\>,CreeXPE2BlueTemplate\<300\>, NoLED\>(),  
WS2811BladePtr\<14, WS2811\_800kHz | WS2811\_GRB, blade2Pin, PowerPINS\>(),  
CONFIGARRAY(presets) },  
};  
#endif  
#ifdef CONFIG\_BUTTONS  
Button FireButton(BUTTON\_FIRE, powerButtonPin, “fire”);  
Button ModeButton(BUTTON\_MODE\_SELECT, auxPin, “modeselect”);  
#endif

#ifdef CONFIG\_BOTTOM  
SSD1306Template\<128, uint64\_t\> display(0x3C);  
#endif

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [March 23, 2021, 5:22pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/2 "2021-03-23T17:22:07Z")

</div>

Are the blaster wav files in the “bank4” directory?  
Is your speaker even working? Do you hear any sounds?  
If you use the “effects” command in the serial monitor, what do you see?  
Other commands to try: “dir bank4”, “pwd” and “beep”

---

<div class="post-metadata">

**Author:** ![savall21](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/savall21/32/306_2.png) [@savall21](https://crucible.hubbe.net/u/savall21)\
**Post date:** [March 23, 2021, 5:34pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/3 "2021-03-23T17:34:51Z")

</div>

Yes, speaker is working  
Yes, blaster wav files are in the “bank4” director  
beep plays the the close encounters tones  
dir bank4 lists the files in bank4  
pwd lists bank4

Again, I think I just don’t understand what triggers the sounds. This config sets one of the buttons to execute “fire”. Does it matter my files are names blast (blast1.wav, blast2.wav, etc)?

---

<div class="post-metadata">

**Author:** ![savall21](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/savall21/32/306_2.png) [@savall21](https://crucible.hubbe.net/u/savall21)\
**Post date:** [March 23, 2021, 5:35pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/4 "2021-03-23T17:35:50Z")

</div>

Also, when I had it setup as a lightsaber with motion and the default sound files it worked fine.

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [March 23, 2021, 6:05pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/5 "2021-03-23T18:05:11Z")

</div>

It would be helpful if you cut-n-paste what “dir bank4” and “effects” show actually show.

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [March 23, 2021, 6:06pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/6 "2021-03-23T18:06:20Z")

</div>

You are using ProffieOS from github right? It’s possible that I broke something in the blaster prop there…

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [March 23, 2021, 6:08pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/7 "2021-03-23T18:08:37Z")

</div>

Also, what does the serial monitor say when you press the fire button?

---

<div class="post-metadata">

**Author:** ![savall21](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/savall21/32/306_2.png) [@savall21](https://crucible.hubbe.net/u/savall21)\
**Post date:** [March 23, 2021, 6:24pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/8 "2021-03-23T18:24:15Z")

</div>

Yes, these are master files I pulled from GitHub

when I type “fire” in serial monitor:  
14:22:00.428 → EVENT: Up-Shortclick ON millis=88191  
14:22:00.428 → EVENT: Up-Shortclick ON millis=88191

“dir bank4”:  
14:23:23.730 → . 0  
14:23:23.730 → … 0  
14:23:23.730 → auxray.txt 235  
14:23:23.730 → blast1.wav 55654  
14:23:23.730 → blast2.wav 48420  
14:23:23.730 → blast3.wav 56746  
14:23:23.730 → blast4.wav 58274  
14:23:23.730 → blast5.wav 55654  
14:23:23.730 → blast6.wav 48420  
14:23:23.730 → blast7.wav 56746  
14:23:23.730 → blast8.wav 58274  
14:23:23.730 → clipin.wav 78122  
14:23:23.730 → clipout.wav 78122  
14:23:23.730 → config.txt 390  
14:23:23.730 → empty.wav 18800  
14:23:23.730 → font.wav 83364  
14:23:23.730 → full.wav 51836  
14:23:23.730 → jam.wav 24900  
14:23:23.730 → leds.txt 686  
14:23:23.730 → mode1.wav 18800  
14:23:23.730 → mode2.wav 22924  
14:23:23.730 → plioff.wav 22924  
14:23:23.730 → plion.wav 22924  
14:23:23.730 → range1.wav 9030  
14:23:23.730 → range2.wav 8722  
14:23:23.730 → range3.wav 8722  
14:23:23.730 → range4.wav 8722  
14:23:23.730 → range5.wav 8722  
14:23:23.730 → range6.wav 8722  
14:23:23.730 → ray.txt 238  
14:23:23.730 → reload.wav 40424  
14:23:23.730 → stun.wav 48216  
14:23:23.730 → unjam.wav 78122  
14:23:23.730 → on.bmp 20544  
14:23:23.730 → blast.wav 58274  
14:23:23.730 → boot(orig).wav 228884  
14:23:23.730 → boot.wav 58274  
14:23:23.764 → fire.wav 58274  
14:23:23.764 → Done listing files.

---

<div class="post-metadata">

**Author:** ![Synplicity](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/synplicity/32/1170_2.png) [@Synplicity](https://crucible.hubbe.net/u/Synplicity)\
**Post date:** [March 23, 2021, 7:30pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/9 "2021-03-23T19:30:50Z")

</div>

When you click the fire button/trigger it will play whatever file is in that style.  
There are 3 different styles of firing on your blaster. Kill,Auto,Stun I forget what the default start is but I know I went into the blaster.h prop and changed it to Kill.

Kill is blast1, blast2, etc… . Stun is stun1, stun2, etc… , and Auto is auto1, quto2, etc…

Also adjusted the switch triggers as the mode switch always had conflicts with the functions. I forget who shared these as they made a big difference with the Aux button actions.

I noticed that you added the display template. I assume you don’t have a display and that can be removed.

---

<div class="post-metadata">

**Author:** ![savall21](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/savall21/32/306_2.png) [@savall21](https://crucible.hubbe.net/u/savall21)\
**Post date:** [March 23, 2021, 7:33pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/10 "2021-03-23T19:33:51Z")

</div>

Thanks. Actually, I do have a display. This is all for a DL-44 blaster build. The screen is working well. I’m just trying to get the sounds configured like a blaster. The sounds don’t play when I trigger fire.

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [March 23, 2021, 7:53pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/11 "2021-03-23T19:53:41Z")

</div>

Unfortunately, the “fire” command triggers a “short click” event on the fire button, but the prop file doesn’t do anything with “short click” events, so the “fire” command doesn’t work.  
The prop uses the “pressed” and “released” actions instead, which currently means that you have to actually push the button to get it to work.

---

<div class="post-metadata">

**Author:** ![savall21](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/savall21/32/306_2.png) [@savall21](https://crucible.hubbe.net/u/savall21)\
**Post date:** [March 23, 2021, 8:01pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/12 "2021-03-23T20:01:00Z")

</div>

Ahhhhh…I was starting to wonder about that. Ok, so can’t test this virtually. I’ll wire up some buttons to test with. Thanks!

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [March 23, 2021, 8:05pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/13 "2021-03-23T20:05:16Z")

</div>

Or you could add:

```
  case EVENTID(BUTTON_FIRE, EVENT_CLICK_SHORT, MODE_ON):

```

here:

> <https://github.com/profezzorn/ProffieOS/blob/ecdccfe51adfff55f62c5cfc959d19f862e32f7c/props/blaster.h#L258>

---

<div class="post-metadata">

**Author:** ![savall21](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/savall21/32/306_2.png) [@savall21](https://crucible.hubbe.net/u/savall21)\
**Post date:** [March 23, 2021, 8:09pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/14 "2021-03-23T20:09:01Z")

</div>

Thanks! I’ll try that.

---

<div class="post-metadata">

**Author:** ![savall21](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/savall21/32/306_2.png) [@savall21](https://crucible.hubbe.net/u/savall21)\
**Post date:** [March 23, 2021, 10:51pm UTC](https://crucible.hubbe.net/t/blaster-sounds/123/15 "2021-03-23T22:51:39Z")

</div>

That still didn’t work. Either with the file mod or physically hitting the switch. I’m still tryin to understand. What tells the software which file to play when it registers fire?

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [March 24, 2021, 12:39am UTC](https://crucible.hubbe.net/t/blaster-sounds/123/16 "2021-03-24T00:39:15Z")

</div>

There are several layers.

1. The button mapping specifies what event is sent when you press the button.
2. The prop takes those events and figures out what to do. It then sends an EFFECT to saberbase which distributes that effect to the system.
3. blades, hybrid\_font and/or other parts of the system then reacts to the event by playing sounds. In this case, the effect-to-sound mapping happens further down in the blaster prop file.

So when you press the switch, what do you see in the serial monitor?

---

<div class="post-metadata">

**Author:** ![savall21](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/savall21/32/306_2.png) [@savall21](https://crucible.hubbe.net/u/savall21)\
**Post date:** [March 24, 2021, 1:09am UTC](https://crucible.hubbe.net/t/blaster-sounds/123/17 "2021-03-24T01:09:24Z")

</div>

Thanks for the detail. I think I figured out part of the problem. The BlasterCore font calls the files blast.wav instead of blst.wav. Once I changed the name I started to hear sounds when I triggered.

blaster.h has a lot of different effects (stun, reload, etc) how do I know what to name the associated sound font files?

---

<div class="post-metadata">

**Author:** ![profezzorn](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/profezzorn/32/8_2.png) [@profezzorn](https://crucible.hubbe.net/u/profezzorn)\
**Post date:** [March 24, 2021, 1:17am UTC](https://crucible.hubbe.net/t/blaster-sounds/123/18 "2021-03-24T01:17:33Z")

</div>

That doesn’t make any sense.  
The blaster prop uses the “blast” name for fire effects, not “blst”.

---

<div class="post-metadata">

**Author:** ![savall21](https://crucible.hubbe.net/user_avatar/crucible.hubbe.net/savall21/32/306_2.png) [@savall21](https://crucible.hubbe.net/u/savall21)\
**Post date:** [March 24, 2021, 2:35am UTC](https://crucible.hubbe.net/t/blaster-sounds/123/19 "2021-03-24T02:35:38Z")

</div>

You are right. I had it named both ways in the directory. It’s all working now.
