// Path: pi-ezo/src/main/java/org/onebeartoe/media/piezo/ports/softtone/SoftTonePort.java
// public static final int PIEZO_PIN = 3;


import com.pi4j.wiringpi.Gpio;
import static com.pi4j.wiringpi.Gpio.delay;
import static com.pi4j.wiringpi.Gpio.delayMicroseconds;
import com.pi4j.wiringpi.SoftTone;
import static org.onebeartoe.media.piezo.ports.softtone.SoftTonePort.PIEZO_PIN;
int LTS_r[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4};
 
int melod[] = {e, e, e, c, e, g, G, c, G, E, A, B, Bb, A, G, e, g, a, f, g, e, c, d, B, c};
int ritmo[] = {6, 12, 12, 6, 12, 24, 24, 18, 18, 18, 12, 12, 6, 12, 8, 8, 8, 12, 6, 12, 12, 6, 6, 6, 12};

public Tocar()
{

}
void loop() 
{
// TODO: FIX THE 42
    for (int i=0; i<melod.length; i++) 
    {
        int tom = melod[i];
        int tempo = ritmo[i];
 
        long tvalue = tempo * vel;
 
        tocar(tom, tvalue);
 
        delayMicroseconds(1000); //pausa entre notas!
    }
    delay(1000);
}

public static void main(String[] args) throws InterruptedException
    {
        Gpio.wiringPiSetup();

// Path: pi-ezo/src/main/java/org/onebeartoe/media/piezo/ports/softtone/SoftTonePort.java
// public static final int PIEZO_PIN = 3;


// Path: pi-ezo/src/main/java/org/onebeartoe/media/piezo/ports/therandombit/Tocar.java
import com.pi4j.wiringpi.Gpio;
import static com.pi4j.wiringpi.Gpio.delay;
import static com.pi4j.wiringpi.Gpio.delayMicroseconds;
import com.pi4j.wiringpi.SoftTone;
import static org.onebeartoe.media.piezo.ports.softtone.SoftTonePort.PIEZO_PIN;

int LTS_r[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4};
 
int melod[] = {e, e, e, c, e, g, G, c, G, E, A, B, Bb, A, G, e, g, a, f, g, e, c, d, B, c};
int ritmo[] = {6, 12, 12, 6, 12, 24, 24, 18, 18, 18, 12, 12, 6, 12, 8, 8, 8, 12, 6, 12, 12, 6, 6, 6, 12};

public Tocar()
{

}
void loop() 
{
// TODO: FIX THE 42
    for (int i=0; i<melod.length; i++) 
    {
        int tom = melod[i];
        int tempo = ritmo[i];
 
        long tvalue = tempo * vel;
 
        tocar(tom, tvalue);
 
        delayMicroseconds(1000); //pausa entre notas!
    }
    delay(1000);
}

public static void main(String[] args) throws InterruptedException
    {
        Gpio.wiringPiSetup();

        SoftTone.softToneCreate(PIEZO_PIN);