,x) = abs(x - a) < 0.5;
    };

//----------------------------------Penta-------------------------------
// Pentatonic scale with degree to midi and degree to Hz conversion
// USAGE: Penta(60).degree2midi(3) ==> 67 midikey
//        Penta(60).degree2Hz(4)   ==> 440 Hz
//-----------------------------------------------------------------------

Penta(key) = environment {

    A4Hz = 440; 

    degree2midi(0) = key+0;
    degree2midi(1) = key+2;
    degree2midi(2) = key+4;
    degree2midi(3) = key+7;
    degree