void MantaAudioUnitController::updatePadColor(int row, int column)
{
    if (padMap.count(row * 8 + column) == 0)
    {
        setPadLedState(row, column, Manta::Off);
        setPadColor(row, column, ofColor::white);
    }
    else if (padMap[row * 8 + column]->toggle)
    {
        ofColor synthColor = synths[padMap[row * 8 + column]->synthName]->getColor();
        if (padMap[row * 8 + column]->parameter == padMap[row * 8 + column]->min)
        {
            setPadColor(row, column, ofColor(synthColor, 100));
            setPadLedState(row, column, Manta::Off);
        }
        else
        {
            setPadColor(row, column, synthColor);
            setPadLedState(row, column, Manta::Red);
        }
    }
    else
    {
        ofColor synthColor = synths[padMap[row * 8 + column]->synthName]->getColor();
        setPadLedState(row, column, Manta::Red);
        setPadColor(row, column, synthColor);
    }
}
Esempio n. 2
0
void MantaController::markAllPads(bool mark)
{
    setLedManual(true);
    for (int r=0; r<6; r++)
    {
        for (int c=0; c<8; c++) {
            setPadLedState(r, c, mark ? Manta::Red : Manta::Off);
        }
    }
    setLedManual(false);
}
void MantaAudioUnitController::setMidiMapping(int idx, AudioUnitInstrument * synth)
{
    int row = floor(idx / 8);
    int col = idx % 8;
    int degree = (2 * row - (int)(row / 2) + col) % 7;
    int octave1 = octave + floor((2 * row - floor(row / 2) + col) / 7);
    midiMap[idx].synth = synth;
    midiMap[idx].note = getNoteAtScaleDegree(key, degree, mode, octave1);
    setPadColor(row, col, synth->getColor());
    if (toSetMidiLedColor) {
        setPadLedState(row, col, Manta::Red);
    }
}
void MantaAudioUnitController::clearMidiMapping()
{
    for (int r = 0; r < 6; r++)
    {
        for (int c = 0; c < 8; c++)
        {
            if (midiMap.count(r * 8 + c) > 0)
            {
                setPadColor(r, c, ofColor::white);
                setPadLedState(r, c, Manta::Off);
            }
        }
    }
    midiMap.clear();
}
Esempio n. 5
0
void MantaController::markPad(int row, int col, bool mark)
{
    setLedManual(true);
    setPadLedState(row, col, mark ? Manta::Red : Manta::Off);
    setLedManual(false);
}