<commit_before>package nl.mprog.pianoapp;

import android.os.CountDownTimer;
import android.util.Log;

import java.util.ArrayList;


// generates values corresponding to the shape of a triangular wave
public class LowFrequencyOscillator
{
    float pitchStep, currentPitch, lowerBound, upperBound;
    Note currentNote;
    ArrayList<Note> noteList;
    private String phase = "down";
    final static int STEPS = 100;
    Long timeRate, timeStep;
    private boolean playing = false;
    LFOTimer downwardTimer, upwardTimer;

    public LowFrequencyOscillator()
    {
        Log.d("LFO", "Created");
    }


    // set amplitude of generated wave
    public void setIntensity(float lower, float upper)
    {
        lowerBound = lower;
        upperBound = upper;
        currentPitch = upperBound - lowerBound;
        pitchStep = (currentPitch)/STEPS;
        Log.d("LFO", "Intensity" + pitchStep);
        Log.d("LFO", "Pitch" + currentPitch);
    }

    // set rate of generated wave
    public void setRate(long rate)
    {
        timeRate = rate;
        timeStep = rate/STEPS;
    }


    public void startVibrato(Note note)
    {
        Log.d("LFO", "Vibrato start");
        noteList.add(note);
        downWard();
    }


    public void stopVibrato(Note note)
    {
        Log.d("LFO", "Vibrato stop");
        noteList.remove(note);

        // stop running LFO when no notes are playing
        if (noteList.isEmpty())
        {
            stopDown();
            stopUp();
        }
    }

    public void stopDown()
    {
        downwardTimer.cancel();
    }

    public void stopUp()<commit_msg>fixed vibrato<commit_after>package nl.mprog.pianoapp;

import android.os.CountDownTimer;
import android.util.Log;

import java.util.ArrayList;


// generates values corresponding to the shape of a triangular wave
public class LowFrequencyOscillator
{
    float pitchStep, currentPitch, lowerBound, upperBound;
    Note currentNote;
    ArrayList<Note> noteList = new ArrayList<>();
    private String phase = "down";
    final static int STEPS = 100;
    Long timeRate, timeStep;
    private boolean playing = false;
    LFOTimer downwardTimer, upwardTimer;

    public LowFrequencyOscillator()
    {
        Log.d("LFO", "Created");
    }


    // set amplitude of generated wave
    public void setIntensity(float lower, float upper)
    {
        lowerBound = lower;
        upperBound = upper;
        currentPitch = upperBound - lowerBound;
        pitchStep = (currentPitch)/STEPS;
        Log.d("LFO", "Intensity" + pitchStep);
        Log.d("LFO", "Pitch" + currentPitch);
    }

    // set rate of generated wave
    public void setRate(long rate)
    {
        timeRate = rate;
        timeStep = rate/STEPS;
    }


    public void startVibrato(Note note)
    {
        Log.d("LFO", "Vibrato start");
        noteList.add(note);
        Log.d("LFO", "Size of list = " + noteList.size());

        //start generating LFO values only if it's the first note
        if (noteList.size() == 1)
        {
            downWard();
        }

    }


    public void stopVibrato(Note note)
    {
        Log.d("LFO", "Vibrato stop");
        noteList.remove(note);

        // stop running LFO when no notes are playing
        if (noteList.isEmpty())
        {
            stopDown();
            stopUp();
        }
    }

    public void stopDown()
    {
        downwardTimer.cancel();
    }

    public void stopUp()
{'fraction_non_alphanumeric': 0.1037489102005231, 'fraction_numerical': 0.002034292356873002, 'mean_word_length': 2.2288930581613506, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6616361', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1005, 'n_words': 276}