Example #1
0
/*
 Parameters:
 ////////////
 Azimuth
 Elevation
 Shape
 Width
 Height
 Gain
 Window
*/
void Ambix_directional_loudnessAudioProcessor::setParameter (int index, float newValue)
{

    int filter_id = (int)floor(index/PARAMS_PER_FILTER);

    if (filter_id < NUM_FILTERS) // safety..
    {
        _param_changed = true;

        switch (index%PARAMS_PER_FILTER) {

        case 0:
            center_sph(filter_id, 0) = newValue;
            break;

        case 1:
            center_sph(filter_id, 1) = newValue;
            break;

        case 2:
            shape(filter_id) = (newValue <= 0.5f ? 0 : 1.f);
            break;

        case 3:
            width(filter_id) = newValue;
            break;

        case 4:
            height(filter_id) = newValue;
            break;

        case 5:
            gain(filter_id) = newValue;
            break;

        case 6:
            window(filter_id) = newValue > 0.5f ? true : false;
            break;

        case 7:
            transition(filter_id) = newValue;
            break;

        default:
            _param_changed = false;
            break;
        }

    }

    sendChangeMessage();
}
Example #2
0
float Ambix_directional_loudnessAudioProcessor::getParameter (int index)
{
    int filter_id = (int)floor(index/PARAMS_PER_FILTER);
    
    if (filter_id >= NUM_FILTERS) // safety..
        return 0.f;
    
    switch (index%PARAMS_PER_FILTER) {
            
        case 0:
            return (float)center_sph(filter_id, 0);
            break;
            
        case 1:
            return (float)center_sph(filter_id, 1);
            break;
            
        case 2:
            return shape(filter_id);
            break;
            
        case 3:
            return width(filter_id);
            
        case 4:
            return height(filter_id);
            
            
        case 5:
            return gain(filter_id);
            
            
        case 6:
            return window(filter_id);
            
            
        case 7:
            return transition(filter_id);


        default:
            return 0.0f;
    }
}
Example #3
0
const String Ambix_directional_loudnessAudioProcessor::getParameterText (int index)
{
    String text;
    
    int filter_id = (int)floor(index/PARAMS_PER_FILTER);
    
    if (filter_id >= NUM_FILTERS) // safety..
        return String::empty;
    
    switch (index%PARAMS_PER_FILTER) {
           
        case 0:
            text = String((center_sph(filter_id, 0) - 0.5)*360).substring(0, 5);
            text << " deg";
            break;
            
        case 1:
            text = String((center_sph(filter_id, 1) - 0.5)*360).substring(0, 5);
            text << " deg";
            break;
            
        case 2:
            if (shape(filter_id) <= 0.5)
                text = "circular";
            else
                text = "rectangular";
            break;
            
        case 3:
            text = String(width(filter_id)*180).substring(0, 5);
            text << " deg";
            break;
            
        case 4:
            text = String(height(filter_id)*180).substring(0, 5);
            text << " deg";
            break;
            
        case 5:
            text = String(ParamToDB(gain(filter_id))).substring(0, 5);
            text << " dB";
            break;
            
        case 6:
            if (window(filter_id) <= 0.5)
                text = "no";
            else
                text = "yes";
            break;
            
        case 7:
            text = String(transition(filter_id)).substring(0, 5);
            text << "";
            break;
            
        default:
            return "";
    }
    
    return text;
}