# Struggling with parameters other than floats

**URL:** <https://qa.fmod.com/t/struggling-with-parameters-other-than-floats/22917>\
**Category:** FMOD Engine\
**Created:** [May 8, 2025, 9:59am UTC](https://qa.fmod.com/t/struggling-with-parameters-other-than-floats/22917 "2025-05-08T09:59:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![noahthompson111](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@noahthompson111](https://qa.fmod.com/u/noahthompson111)\
**Post date:** [May 8, 2025, 9:59am UTC](https://qa.fmod.com/t/struggling-with-parameters-other-than-floats/22917/1 "2025-05-08T09:59:39Z")

</div>

Hi all,  
I am working on a plugin and its all working well but I wanted to use an integer parameter instead of a float and using ceiling on it so i can have the fun strings in the ui for each mode and more responsive behavior. I can’t seem to figure out how to use it correctly though, I’m getting it to build and display the different strings from a const char\* array, but when doing the usual m\_target\_parameter changes it doesnt seem to change on the dial movement. Changing the default uses it well, so I know it has to do something with the m\_target and m\_current paramaterization. Any help would be awesome!! Thank u :3  
Here are some key snippets from my code

const int FMOD\_GRAIN\_PARAM\_GRAIN\_PLAYBACK\_SPREAD\_MIN = 0;  
const int FMOD\_GRAIN\_PARAM\_GRAIN\_PLAYBACK\_SPREAD\_MAX = 2;  
const int FMOD\_GRAIN\_PARAM\_GRAIN\_PLAYBACK\_SPREAD\_DEFAULT = 0;

const char\* spreadToggle[3] = { “off”, “on”, “test”};  
//in DSPdescription  
FMOD\_DSP\_INIT\_PARAMDESC\_INT(p\_playback\_spread, “rate spread”, “”, “playback rate randomization”, FMOD\_GRAIN\_PARAM\_GRAIN\_PLAYBACK\_SPREAD\_MIN, FMOD\_GRAIN\_PARAM\_GRAIN\_PLAYBACK\_SPREAD\_MAX, FMOD\_GRAIN\_PARAM\_GRAIN\_PLAYBACK\_SPREAD\_DEFAULT, true, spreadToggle);

//public in grainstate class  
void setRateSpread(int);  
int rateSpread() const {  
return m\_target\_playback\_spread;  
}

//private in grainstate class

int m\_target\_playback\_spread;  
int m\_current\_playback\_spread;

//in grainstate()  
m\_target\_playback\_spread(FMOD\_GRAIN\_PARAM\_GRAIN\_PLAYBACK\_SPREAD\_DEFAULT),

//in reset  
m\_current\_playback\_spread = m\_target\_playback\_spread;

void FMODGrainState::setRateSpread(int spread) {  
m\_current\_playback\_spread = spread;  
m\_ramp\_samples\_left = FMOD\_GRAIN\_RAMPCOUNT;  
}

//in FMOD\_Noise\_dspsetparamint()  
case FMOD\_GRAIN\_PARAM\_GRAIN\_PLAYBACK\_SPREAD:  
state-\>setRateSpread(value);  
return FMOD\_OK;

//in FMOD\_Noise\_dspgetparamint()  
case FMOD\_GRAIN\_PARAM\_GRAIN\_PLAYBACK\_SPREAD:  
\*value = state-\>rateSpread();  
return FMOD\_OK;

\*edit : for reference i have a bunch of other float parameters that go through more or less the same thing and work fine

---

<div class="post-metadata">

**Author:** ![noahthompson111](https://avatars.discourse-cdn.com/v4/letter/n/e47774/32.png) [@noahthompson111](https://qa.fmod.com/u/noahthompson111)\
**Post date:** [May 8, 2025, 7:40pm UTC](https://qa.fmod.com/t/struggling-with-parameters-other-than-floats/22917/2 "2025-05-08T19:40:17Z")

</div>

sorry for the clogging i figured it out , really silly mistake on my part i kept overlooking.
