function fisherYates(array, seed) {
    var _a;
    var length = array.length;
    // need to clone array or we'd be editing original as we goo
    var shuffled = array.slice();
    for (var i = (length - 1); i > 0; i -= 1) {
        var randomIndex = void 0;
        if (seed) {
            randomIndex = Math.floor(seed() * (i + 1));
        }
        else {
            randomIndex = Math.floor(Math.random() * (i + 1));
        }
        _a = [shuffled[randomIndex], shuffled[i]], shuffled[i] = _a[0], shuffled[randomIndex] = _a[1];
    }
    return shuffled;
}
/**
 * Shuffle an array of Float32Array or Samples using Fisher-Yates algorithm
 * Takes an optional seed value to make shuffling predictable
 */
Shuffle an array of Float32Array or Samples using Fisher-Yates algorithm
Takes an optional seed value to make shuffling predictable
Shuffle an array of Float32Array or Samples using Fisher - Yates algorithm Takes an optional seed value to make shuffling predictable
function fisherYates(array, seed) {
    var _a;
    var length = array.length;
    var shuffled = array.slice();
    for (var i = (length - 1); i > 0; i -= 1) {
        var randomIndex = void 0;
        if (seed) {
            randomIndex = Math.floor(seed() * (i + 1));
        }
        else {
            randomIndex = Math.floor(Math.random() * (i + 1));
        }
        _a = [shuffled[randomIndex], shuffled[i]], shuffled[i] = _a[0], shuffled[randomIndex] = _a[1];
    }
    return shuffled;
}
function fisherYates ( array , seed ) { var _a ; var length = array . length ; var shuffled = array . slice ( ) ; for ( var i = ( length - 1 ) ; i > 0 ; i -= 1 ) { var randomIndex = void 0 ; if ( seed ) { randomIndex = Math . floor ( seed ( ) * ( i + 1 ) ) ; } else { randomIndex = Math . floor ( Math . random ( ) * ( i + 1 ) ) ; } _a = [ shuffled [ randomIndex ] , shuffled [ i ] ] , shuffled [ i ] = _a [ 0 ] , shuffled [ randomIndex ] = _a [ 1 ] ; } return shuffled ; }
Shuffle an array of Float32Array or Samples using Fisher-Yates algorithm
 Takes an optional seed value to make shuffling predictable
Shuffle an array of Float32Array or Samples using Fisher - Yates algorithm Takes an optional seed value to make shuffling predictable
// need to clone array or we'd be editing original as we goo