<commit_before>musicApp.controller('audioPlayController', function($scope, allNotes, $rootScope, stopMusic) {


    //calls all the play functions in note class
    $scope.padplay = function(pad){
        allNotes[pad].play();
    };
    
    $scope.killSwitch = function(){
      stopMusic();
    }

    
  /*//  Master Volume slider logic to adjust volume
    var slider = document.getElementById('volume');
    $scope.volume = .8;
    //HTML audio between 0 and 1 for 0 to 100%
    slider.noUiSlider.on('slide',function(){
        var volumeSlider = document.getElementById('volume');

        $scope.volume = 1 - volumeSlider.noUiSlider.get();
        for (i = 1; i <= 16; i++){
            var pad = 'pad' + i;
            allNotes[pad].setVolume($scope.volume);
        }
    });*/

});

//seperate controller for keyboard input
musicApp.controller('keyboardController', function($scope, allNotes, $rootScope, stopMusic, setVolume) {
    
    //set volume at 8
    $scope.volumeClass = 'volumeLevel8';
    $scope.volumeLevel = 8;
    
    //listens for shift to stop music
    window.addEventListener('keydown', function(event) {
      if (event.shiftKey) {
        stopMusic();
      }
    });
    
    
    //switch case for all possible keyboard presses
    //also listens for arrow keys
    window.addEventListener('keydown', function(event) {<commit_msg>Fixed scrolling with arrow keys<commit_after>musicApp.controller('audioPlayController', function($scope, allNotes, $rootScope, stopMusic) {


    //calls all the play functions in note class
    $scope.padplay = function(pad){
        allNotes[pad].play();
    };

    $scope.killSwitch = function(){
      stopMusic();
    }


  /*//  Master Volume slider logic to adjust volume
    var slider = document.getElementById('volume');
    $scope.volume = .8;
    //HTML audio between 0 and 1 for 0 to 100%
    slider.noUiSlider.on('slide',function(){
        var volumeSlider = document.getElementById('volume');

        $scope.volume = 1 - volumeSlider.noUiSlider.get();
        for (i = 1; i <= 16; i++){
            var pad = 'pad' + i;
            allNotes[pad].setVolume($scope.volume);
        }
    });*/

});

//seperate controller for keyboard input
musicApp.controller('keyboardController', function($scope, allNotes, $rootScope, stopMusic, setVolume) {

    //set volume at 8
    $scope.volumeClass = 'volumeLevel8';
    $scope.volumeLevel = 8;

    //listens for shift to stop music
    window.addEventListener('keydown', function(event) {
      if (event.shiftKey) {
        stopMusic();
      }
    });

    //Disable window scroll when arrow keys are pressed to adjust volume
    window.addEventListener("keydown", function(event) {
    // space and arrow keys
    if([38, 40].indexOf(event.keyCode) > -1) {
        event.preventDefault();
    }
}, false);

    //switch case for all possible keyboard presses
    //also listens for arrow keys
    window.addEventListener('keydown', function(event) {
{'fraction_non_alphanumeric': 0.1312961719274681, 'fraction_numerical': 0.011081262592343854, 'mean_word_length': 2.7613636363636362, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '3990348', 'n_tokens_mistral': 889, 'n_tokens_neox': 835, 'n_words': 232}