How to use effect loop sound in style code OS7

‘’’
#ifdef CONFIG_TOP
#include “proffieboard_v2_config.h”
#define NUM_BLADES 3
#define NUM_BUTTONS 1
#define VOLUME 1900
const unsigned int maxLedsPerStrip = 144;
#define CLASH_THRESHOLD_G 3.0
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define ENABLE_ALL_EDIT_OPTIONS
#define ENABLE_SERIAL
#define FETT263_EDIT_MODE_MENU
#define MOTION_TIMEOUT 60 * 15 * 1000 // keeps motion chip active for 15 minutes while blade is Off
#define IDLE_OFF_TIME 60 * 15 * 1000
#define COLOR_CHANGE_DIRECT
#define DISABLE_DIAGNOSTIC_COMMANDS
#define DISABLE_BASIC_PARSER_STYLES
#define NO_REPEAT_RANDOM
#define FETT263_THRUST_ON // enables Thrust On Ignition
#define FETT263_THRUST_ON_NO_BM
#define FETT263_SWING_ON // enables Swing On Ignition
#define FETT263_SWING_ON_NO_BM
#define FETT263_SWING_ON_SPEED 350
#define FETT263_TWIST_ON // enables Twist On Ignition
#define FETT263_TWIST_ON_NO_BM
#define FETT263_TWIST_OFF // enables Twist Off Retraction
#define FETT263_BM_CLASH_DETECT 7
//#define FETT263_MULTI_PHASE
//#define FETT263_DUAL_MODE_SOUND
#define FETT263_CLASH_STRENGTH_SOUND
#define FETT263_MAX_CLASH 16
#define FETT263_SAY_COLOR_LIST
#define FETT263_SAY_COLOR_LIST_CC
#define FETT263_SAY_BATTERY_VOLTS
#define FETT263_QUOTE_PLAYER_START_ON
#define FETT263_MOTION_WAKE_POWER_BUTTON
#define FETT263_FORCE_PUSH_ALWAYS_ON
#define FETT263_SAVE_GESTURE_OFF
//#define KEEP_SAVEFILES_WHEN_PROGRAMMING//only use after final upload via arduino
#define FETT263_SPECIAL_ABILITIES
#define FETT263_DISABLE_CHANGE_FONT
#define FETT263_DISABLE_CHANGE_STYLE
#define FETT263_DISABLE_COPY_PRESET
#define SAVE_STATE

#endif

TransitionLoopL<TrConcat<TrWipe<200>,RandomBlinkL<Int<30000>,White>,TrJoin<TrDelayX<Scale<SlowNoise<Int<3000>>,Int<300>,Int<3000>>>,TrWipe<200>>>>>,

‘’’
Hi what are the steps to alter this code with the new OS7 EFFECT_LOOP_SOUND to get a looped sound with the syle code, also where does the wav file go on sd card?
I know very little about coding, any help appreciated

I don’t think that’s a thing.
What are you trying to do?

Sorry NoSloppy its one of the new Transition sounds where it loops a sound with the style code

EFFECT_SOUND_LOOP :link:

(OS 7.0+) Toggles an optonal sound effect loop ON/OFF from within a style via TrDoEffect.

Yeah, I didn’t find it as you’d typed LOOP_SOUND, not SOUND_LOOP.

Seems like you’d use it in a blade style to toggle the playback of a sound named trloop.wav on and off each time you do it.
So as part of a transition layer, you’d include something like:
TrDoEffect<TrInstant,EFFECT_SOUND_LOOP>

Great! thanks for that NoSloppy :grin:

EFFECT_SOUND_LOOP also needs support from the prop to actually do something, the Fett263 is the only prop that does something with this effect right now.

Thanks profezzorn, installed the latest OS7 version

What is it you’re trying to accomplish?

EFFECT_SOUND_LOOP probably won’t work very well with the above style as you’d be turning it on and off with each pass. EFFECT_SOUND_LOOP is intended for a “state” change that you want to have run on a loop for a period of time until you toggle that “state” off, it’s used like a user-defined Lockup state in coordination with a control and visual effect.

If you just have a sound you want to play within that transition you’d use EFFECT_TRANSITION_SOUND.

If you can explain what you’re looking to do it will be easier to direct you.

Both require my prop to run.

Hi Fett! the code is from your thunder and lightning style, i was trying to loop a sound like you did in one of your videos.
It sortof worked but when you switch off the saber the sound loop continues.
Wow thanks for the help, you are a legend😁

Yeah, you’re not using EFFECT_SOUND_LOOP correctly then and you actually want EFFECT_TRANSITION_SOUND anyway :wink:

At the point in the transition where you want the sound to play just wrap TrDoEffect around it like so:

TrDoEffect<CURRENT_TRANSITION,EFFECT_TRANSITION_SOUND>

Then add tr.wav to your font.

The TransitionLoop<> will loop the effect and replay the sound at that exact point in the transition on each pass.

1 Like

Awesome thanks so much for your help Fett!

You’re welcome