Пример #1
0
bool ControlParameter::operator==(const ControlParameter &control)
{
    return m_type == control.getType() &&
        m_controllerValue == control.getControllerValue() &&
        m_min == control.getMin() &&
        m_max == control.getMax();
}
Пример #2
0
// @return the active ruler's parameter situation, or NULL if none.
// Return is owned by caller.
// @author Tom Breton (Tehom)
SelectionSituation *
ControlRulerWidget::getSituation(void)
{
    ControllerEventsRuler *ruler = getActiveRuler();
    if (!ruler) { return 0; }
    EventSelection * selection = ruler->getEventSelection();
    if (!selection) { return 0; }
    ControlParameter * cp = ruler->getControlParameter();
    if (!cp) { return 0; }
    return
        new SelectionSituation(cp->getType(), selection);
}
Пример #3
0
ControlParameter::ControlParameter(const ControlParameter &control):
        XmlExportable(),
        m_name(control.getName()),
        m_type(control.getType()),
        m_description(control.getDescription()),
        m_min(control.getMin()),
        m_max(control.getMax()),
        m_default(control.getDefault()),
        m_controllerValue(control.getControllerValue()),
        m_colourIndex(control.getColourIndex()),
        m_ipbPosition(control.getIPBPosition())
{
}
Пример #4
0
void
MidiDevice::addControlToInstrument(const ControlParameter &con)
{
    if (!isVisibleControlParameter(con)) {
        return;
    }

    // Run through all of this devices instruments and add default controls and
    // values to them.
    InstrumentList insList = getAllInstruments();
    InstrumentList::iterator iIt = insList.begin();

    for(; iIt != insList.end(); ++iIt) {
        MidiByte conNumber = con.getControllerValue();
        MidiByte conValue = con.getDefault();
        (*iIt)->setControllerValue(conNumber, conValue);
    }    
}
Пример #5
0
void
MidiDevice::removeControlFromInstrument(const ControlParameter &con)
{
    InstrumentList insList = getAllInstruments();
    InstrumentList::iterator iIt = insList.begin();

    for(; iIt != insList.end(); ++iIt) {
        (*iIt)->removeStaticController(con.getControllerValue());
    }
}
//--------------------------------------------------------------
void AudioTonicBinaural::setup()
{
    Volume = -8.0;
    CarrierPitch = 54.0;
    CarrierOffset = 0.1;
    
    //TONIC AUDIO STUFF
    ControlParameter volume = synth.addParameter("volume", -8.f).displayName("Volume (dbFS)").min(-60.f).max(0.f);
    ControlParameter carrierPitch = synth.addParameter("carrierPitch", 54.f).displayName("Carrier Pitch").min(20.f).max(92.f);
    ControlParameter carrierOffset = synth.addParameter("carrierOffset", 0.1f).displayName("Carrier Offset").min(0.f).max(8.f);

    float smoothTime = 0.1;

    Generator rCarrierFreq = carrierPitch.smoothed(smoothTime);
    Generator rCarrierOffset = carrierOffset.smoothed(smoothTime);
    

    osc1 = SineWave().freq(rCarrierFreq) * SineWave().freq(rCarrierOffset)* ControlDbToLinear().input(volume).smoothed(smoothTime);
    synth.setOutputGen(osc1);

}
Пример #7
0
void
ControlRulerWidget::slotAddControlRuler(const ControlParameter &controlParameter)
{
    if (!m_viewSegment) return;

    ControlRuler *controlruler = new ControllerEventsRuler(m_viewSegment, m_scale, this, &controlParameter);
    controlruler->setXOffset(m_gutter);

    connect(controlruler, SIGNAL(dragScroll(timeT)),
            this, SLOT(slotDragScroll(timeT)));

    connect(controlruler, SIGNAL(rulerSelectionChanged(EventSelection *)),
            this, SLOT(slotChildRulerSelectionChanged(EventSelection *)));

    addRuler(controlruler,QString::fromStdString(controlParameter.getName()));
}
//--------------------------------------------------------------
void AudioTonic::setup()
{
    volume	= 0.0f;
//	volume	= 0.79f;

    //TONIC AUDIO STUFF
    ControlParameter volume = synth.addParameter("volume", -58.f).displayName("Volume (dbFS)").min(-60.f).max(0.f);
    ControlParameter carrierPitch = synth.addParameter("carrierPitch", 20.f).displayName("Carrier Pitch").min(20.f).max(32.f);
    ControlParameter carrierOffset = synth.addParameter("carrierOffset", 1.f).displayName("Carrier Offset").min(0.f).max(8.f);
    ControlParameter modIndex = synth.addParameter("modIndex", 0.25f).displayName("FM Amount").min(0.f).max(10.0f);
    ControlParameter modLfoAmt = synth.addParameter("modLfoAmt", 0.5f).displayName("Mod LFO Amount").min(0.f).max(4.f);
    ControlParameter modLfoSpeed = synth.addParameter("modLfoSpeed", 10.0f).displayName("Mod LFO Speed").min(0.f).max(20.f);
    ControlParameter ampLfoAmt = synth.addParameter("ampLfoAmt", 0.75f).displayName("Amp LFO Amount").min(0.f).max(1.f);
    ControlParameter ampLfoSpeed = synth.addParameter("ampLfoSpeed", 0.15f).displayName("Amp LFO Speed").min(0.f).max(20.f);

    Generator rCarrierFreq = ControlMidiToFreq().input(carrierPitch).smoothed();
    Generator rModFreq     = rCarrierFreq * 4.0f;

    float smoothTime = 0.1;

    osc1 = SineWave()
           .freq( rCarrierFreq
                  + (
                      SineWave().freq( rModFreq ) *
                      rModFreq *
                      (modIndex.smoothed(smoothTime) * (1.0f + SineWave().freq(modLfoSpeed.smoothed(smoothTime)) * modLfoAmt.smoothed(smoothTime) * 0.5f))
                  )
                ) * (1.0f + SineWave().freq(ampLfoSpeed.smoothed(smoothTime)) * ampLfoAmt.smoothed(smoothTime) + 0.25) * ControlDbToLinear().input(volume).smoothed(smoothTime);

    osc2 = SineWave()
           .freq( rCarrierFreq + carrierOffset.smoothed(smoothTime)
                  + (
                      SineWave().freq( rModFreq ) *
                      rModFreq *
                      (modIndex.smoothed(smoothTime) * (1.0f + SineWave().freq(modLfoSpeed.smoothed(smoothTime)) * modLfoAmt.smoothed(smoothTime) * 0.5f))
                  )
                ) * (1.0f + SineWave().freq(ampLfoSpeed.smoothed(smoothTime)) * ampLfoAmt.smoothed(smoothTime) + 0.25) * ControlDbToLinear().input(volume).smoothed(smoothTime);

    synth.setOutputGen(osc1 * osc2);

//   synth.getOutputGen();

//   synth.getParameters();
}
Пример #9
0
bool 
MidiDevice::isVisibleControlParameter(const ControlParameter &con) const
{
    return (con.getIPBPosition() > -1);
}
Пример #10
0
// Check to see if passed ControlParameter is unique.  Either the
// type must be unique or in the case of Controller::EventType the
// ControllerValue must be unique.
//
// Controllers (Control type)
//
//
bool 
MidiDevice::isUniqueControlParameter(const ControlParameter &con) const
{
    return
        findControlParameter(con.getType(), con.getControllerValue()) == 0;
}