arduino-audio-tools
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
audio_tools::SimulatedAudioPot Class Reference

Simple simulated audio pot volume control inspired by https://eepower.com/resistor-guide/resistor-types/potentiometer-taper/# We split up the input/output curve into 2 linear pieces with a slow and a fast raising part. The slow raising part goes from (0,0) to (x,y). The fast raising part goes from (x,y) to (1,1). More...

#include <VolumeControl.h>

Inheritance diagram for audio_tools::SimulatedAudioPot:
audio_tools::VolumeControl

Public Member Functions

 SimulatedAudioPot (float x=0.5, float y=0.1)
 
virtual float getVolumeFactor (float volume)
 determines a multiplication factor (0.0 to 1.0) from an input value (0.0 to 1.0). More...
 
virtual float getVolumeFactor (float volume)=0
 determines a multiplication factor (0.0 to 1.0) from an input value (0.0 to 1.0). More...
 

Protected Attributes

float x
 
float y
 

Additional Inherited Members

- Protected Member Functions inherited from audio_tools::VolumeControl
virtual float limit (float in)
 limits the output to the range of 0 to 1.0
 
float map (float x, float in_min, float in_max, float out_min, float out_max)
 similar to the Arduino map function - but using floats
 

Detailed Description

Simple simulated audio pot volume control inspired by https://eepower.com/resistor-guide/resistor-types/potentiometer-taper/# We split up the input/output curve into 2 linear pieces with a slow and a fast raising part. The slow raising part goes from (0,0) to (x,y). The fast raising part goes from (x,y) to (1,1).

Author
Phil Schatzmann

Member Function Documentation

◆ getVolumeFactor()

virtual float audio_tools::SimulatedAudioPot::getVolumeFactor ( float  volume)
inlinevirtual

determines a multiplication factor (0.0 to 1.0) from an input value (0.0 to 1.0).

Implements audio_tools::VolumeControl.


The documentation for this class was generated from the following file: