# BUG: AudioProcessorParameter::isDiscrete() returns false for int parameters

**URL:** <https://forum.juce.com/t/bug-audioprocessorparameter-isdiscrete-returns-false-for-int-parameters/52627>\
**Category:** General JUCE discussion\
**Created:** [August 17, 2022, 8:10am UTC](https://forum.juce.com/t/bug-audioprocessorparameter-isdiscrete-returns-false-for-int-parameters/52627 "2022-08-17T08:10:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PixelPacker](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pixelpacker/32/9869_2.png) [@PixelPacker](https://forum.juce.com/u/PixelPacker)\
**Post date:** [August 17, 2022, 8:10am UTC](https://forum.juce.com/t/bug-audioprocessorparameter-isdiscrete-returns-false-for-int-parameters/52627/1 "2022-08-17T08:10:28Z")

</div>

## The Problem:

The documentation of `AudioProcessorParameter::isDiscrete()` states:

```c++
/** Returns whether the parameter uses discrete values, based on the result of
        getNumSteps, or allows the host to select values continuously. */

```

[Source: juce\_AudioProcessorParameter.h:179](https://github.com/juce-framework/JUCE/blob/master/modules/juce_audio_processors/processors/juce_AudioProcessorParameter.h#L179)

However the implementationdoesn’t do that:

```c++
bool AudioProcessorParameter::isDiscrete() const { return false; }

```

[Source: juce\_AudioProcessor.cpp:1600](https://github.com/juce-framework/JUCE/blob/master/modules/juce_audio_processors/processors/juce_AudioProcessor.cpp#L1600)

Also neither AudioParameterInt, AudioParameterFloat nor RangedAudioParameter override this method. It’s currently only overriden for AudioParameterBool and AudioParameterChoice.

## The Solution ?:

Now it would be easy enough to change the implementation to:

```c++
bool AudioProcessorParameter::isDiscrete() const { return getNumSteps() != AudioProcessor::getDefaultNumParameterSteps(); }

```

or

```c++
bool AudioProcessorParameter::isDiscrete() const { return getNumSteps() < 100 /*or whatever*/ ; }

```

So that it actually matches the documentation.

## The Question:

This brings to mind the following quote:

> When code and comments disagree, both are probably wrong.  
> – Norm Schryer

So which one is correct? The comment, the code or neither? What’s the all-DAW proof solution ?

Thanks!
