<commit_before>/* global _,$,Tone */
Tone.Transport.setBpm(120);
// Tone.Transport.setLoopEnd("1:0");
// Tone.Transport.loop = true;

// Tone.Transport.setTransportTime("4:0:0");

WO.recording = false;

WO.playSong = function(song){
    // debugger;
    _.each(song.models, function(track){
        // console.log("track->", track);
        var notes = track.get('notes');
        var instrument = track.get('instrument');
        _.each(notes, function(note){
            // console.log("note->", note);
            if ( note[2] === 0.00 || note[2] === "0.00"){
                Tone.Transport.setTimeout(function(time){
                    instrument.triggerRelease(note[1]);
                }, note[0]);
            }else{
                Tone.Transport.setTimeout(function(time){
                    instrument.triggerAttack(note[1]);
                }, note[0]);
            }
        });
    });
    
    Tone.Transport.start();
};

WO.recordNotes = function(note, time, velocity){
    notes.push([time, note, velocity]);
    console.log(notes);
};

$('#rewind').on('click', function(){
    Tone.Transport.setTransportTime("0:0:0");
    $('#transportTime').text(Tone.Transport.getTransportTime());
})
<commit_msg>hard code recording to WO.track for testing<commit_after>/* global _,$,Tone */
Tone.Transport.setBpm(120);
// Tone.Transport.setLoopEnd("1:0");
// Tone.Transport.loop = true;

// Tone.Transport.setTransportTime("4:0:0");

WO.recording = false;

WO.playSong = function(song){
    // debugger;
    _.each(song.models, function(track){
        // console.log("track->", track);
        var notes = track.get('notes');
        var instrument = track.get('instrument');
        _.each(notes, function(note){
            // console.log("note->", note);
            if ( note[2] === 0.00 || note[2] === "0.00"){
                Tone.Transport.setTimeout(function(time){
                    instrument.triggerRelease(note[1]);
                }, note[0]);
            }else{
                Tone.Transport.setTimeout(function(time){
                    instrument.triggerAttack(note[1]);
                }, note[0]);
            }
        });
    });
    
    Tone.Transport.start();
};

WO.recordNotes = function(note, time, velocity){
    //hard code for track 1
    var notes = WO.track.get('notes');
    notes.push([time, note, velocity]);
    // console.log(notes);
};

$('#rewind').on('click', function(){
    Tone.Transport.setTransportTime("0:0:0");
    $('#transportTime').text(Tone.Transport.getTransportTime());
})

{'fraction_non_alphanumeric': 0.1888801261829653, 'fraction_numerical': 0.018533123028391166, 'mean_word_length': 2.346965699208443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4474967', 'n_tokens_mistral': 804, 'n_tokens_neox': 776, 'n_words': 118}