├── sounds ├── drum_kit │ ├── kick.wav │ ├── tom1.wav │ ├── tom2.wav │ ├── tom3.wav │ ├── hihat.wav │ └── snare.wav └── notes_piano_mp3 │ ├── p100.mp3 │ ├── p101.mp3 │ ├── p102.mp3 │ ├── p103.mp3 │ ├── p104.mp3 │ ├── p105.mp3 │ ├── p106.mp3 │ ├── p107.mp3 │ ├── p108.mp3 │ ├── p109.mp3 │ ├── p21.mp3 │ ├── p22.mp3 │ ├── p23.mp3 │ ├── p24.mp3 │ ├── p25.mp3 │ ├── p26.mp3 │ ├── p27.mp3 │ ├── p28.mp3 │ ├── p29.mp3 │ ├── p30.mp3 │ ├── p31.mp3 │ ├── p32.mp3 │ ├── p33.mp3 │ ├── p34.mp3 │ ├── p35.mp3 │ ├── p36.mp3 │ ├── p37.mp3 │ ├── p38.mp3 │ ├── p39.mp3 │ ├── p40.mp3 │ ├── p41.mp3 │ ├── p42.mp3 │ ├── p43.mp3 │ ├── p44.mp3 │ ├── p45.mp3 │ ├── p46.mp3 │ ├── p47.mp3 │ ├── p48.mp3 │ ├── p49.mp3 │ ├── p50.mp3 │ ├── p51.mp3 │ ├── p52.mp3 │ ├── p53.mp3 │ ├── p54.mp3 │ ├── p55.mp3 │ ├── p56.mp3 │ ├── p57.mp3 │ ├── p58.mp3 │ ├── p59.mp3 │ ├── p60.mp3 │ ├── p61.mp3 │ ├── p62.mp3 │ ├── p63.mp3 │ ├── p64.mp3 │ ├── p65.mp3 │ ├── p66.mp3 │ ├── p67.mp3 │ ├── p68.mp3 │ ├── p69.mp3 │ ├── p70.mp3 │ ├── p71.mp3 │ ├── p72.mp3 │ ├── p73.mp3 │ ├── p74.mp3 │ ├── p75.mp3 │ ├── p76.mp3 │ ├── p77.mp3 │ ├── p78.mp3 │ ├── p79.mp3 │ ├── p80.mp3 │ ├── p81.mp3 │ ├── p82.mp3 │ ├── p83.mp3 │ ├── p84.mp3 │ ├── p85.mp3 │ ├── p86.mp3 │ ├── p87.mp3 │ ├── p88.mp3 │ ├── p89.mp3 │ ├── p90.mp3 │ ├── p91.mp3 │ ├── p92.mp3 │ ├── p93.mp3 │ ├── p94.mp3 │ ├── p95.mp3 │ ├── p96.mp3 │ ├── p97.mp3 │ ├── p98.mp3 │ └── p99.mp3 ├── mth_loop_game.info ├── README.md ├── js ├── buffer-loader.js └── loop_game.js └── mth_loop_game.module /sounds/drum_kit/kick.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/drum_kit/kick.wav -------------------------------------------------------------------------------- /sounds/drum_kit/tom1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/drum_kit/tom1.wav -------------------------------------------------------------------------------- /sounds/drum_kit/tom2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/drum_kit/tom2.wav -------------------------------------------------------------------------------- /sounds/drum_kit/tom3.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/drum_kit/tom3.wav -------------------------------------------------------------------------------- /sounds/drum_kit/hihat.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/drum_kit/hihat.wav -------------------------------------------------------------------------------- /sounds/drum_kit/snare.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/drum_kit/snare.wav -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p100.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p100.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p101.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p101.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p102.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p102.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p103.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p103.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p104.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p104.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p105.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p105.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p106.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p106.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p107.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p107.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p108.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p108.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p109.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p109.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p21.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p21.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p22.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p22.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p23.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p23.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p24.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p24.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p25.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p25.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p26.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p26.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p27.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p27.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p28.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p28.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p29.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p29.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p30.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p30.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p31.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p31.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p32.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p32.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p33.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p33.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p34.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p34.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p35.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p35.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p36.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p36.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p37.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p37.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p38.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p38.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p39.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p39.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p40.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p40.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p41.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p41.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p42.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p42.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p43.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p43.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p44.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p44.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p45.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p45.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p46.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p46.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p47.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p47.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p48.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p48.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p49.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p49.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p50.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p50.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p51.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p51.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p52.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p52.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p53.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p53.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p54.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p54.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p55.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p55.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p56.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p56.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p57.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p57.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p58.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p58.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p59.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p59.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p60.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p60.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p61.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p61.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p62.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p62.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p63.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p63.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p64.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p64.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p65.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p65.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p66.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p66.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p67.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p67.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p68.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p68.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p69.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p69.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p70.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p70.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p71.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p71.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p72.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p72.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p73.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p73.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p74.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p74.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p75.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p75.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p76.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p76.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p77.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p77.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p78.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p78.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p79.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p79.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p80.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p80.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p81.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p81.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p82.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p82.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p83.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p83.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p84.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p84.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p85.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p85.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p86.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p86.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p87.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p87.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p88.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p88.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p89.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p89.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p90.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p90.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p91.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p91.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p92.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p92.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p93.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p93.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p94.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p94.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p95.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p95.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p96.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p96.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p97.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p97.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p98.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p98.mp3 -------------------------------------------------------------------------------- /sounds/notes_piano_mp3/p99.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andris9/loop_game/master/sounds/notes_piano_mp3/p99.mp3 -------------------------------------------------------------------------------- /mth_loop_game.info: -------------------------------------------------------------------------------- 1 | name = Loop Game 2 | package = mth 3 | description = Generates a page with the loop game. 4 | core = 7.x 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | loop_game 2 | ========= 3 | Loop game is a musical game. It produces a grid where columns represent beats and lines represent notes. 4 | The pattern is repeated ad infinitum producing a loop. User can chose which note(notes) is played on which beat. 5 | Uses "Web Audio", a new web technology (http://www.html5rocks.com/en/tutorials/webaudio/intro/). 6 | 7 | Web Audio API availability in different browsers can be found [here](http://caniuse.com/audio-api). 8 | 9 | If you have any interest in this code, you will notice it is designed as a Drupal 7 module. This is done for 2 reasons: 10 | 1. I plan to add feature for saving/sharing loops between users online. 11 | 2. Need the game to be translated. 12 | Drupal has built-in user system and translations system. 13 | -------------------------------------------------------------------------------- /js/buffer-loader.js: -------------------------------------------------------------------------------- 1 | /* 2 | code from http://www.html5rocks.com/en/tutorials/webaudio/intro/ 3 | */ 4 | 5 | function BufferLoader(context, urlList, callback) { 6 | this.context = context; 7 | this.urlList = urlList; 8 | this.onload = callback; 9 | this.bufferList = new Array(); 10 | this.loadCount = 0; 11 | } 12 | 13 | BufferLoader.prototype.loadBuffer = function(url, index) { 14 | // Load buffer asynchronously 15 | var request = new XMLHttpRequest(); 16 | request.open("GET", url, true); 17 | request.responseType = "arraybuffer"; 18 | 19 | var loader = this; 20 | 21 | request.onload = function() { 22 | // Asynchronously decode the audio file data in request.response 23 | loader.context.decodeAudioData( 24 | request.response, 25 | function(buffer) { 26 | if (!buffer) { 27 | alert('error decoding file data: ' + url); 28 | return; 29 | } 30 | loader.bufferList[index] = buffer; 31 | if (++loader.loadCount == loader.urlList.length) 32 | loader.onload(loader.bufferList); 33 | }, 34 | function(error) { 35 | console.error('decodeAudioData error', error); 36 | } 37 | ); 38 | } 39 | 40 | request.onerror = function() { 41 | alert('BufferLoader: XHR error'); 42 | } 43 | 44 | request.send(); 45 | } 46 | 47 | BufferLoader.prototype.load = function() { 48 | for (var i = 0; i < this.urlList.length; ++i) 49 | this.loadBuffer(this.urlList[i], i); 50 | } 51 | 52 | -------------------------------------------------------------------------------- /mth_loop_game.module: -------------------------------------------------------------------------------- 1 | ' . t('This module produces a pages with loop game.') . '

'; 21 | } 22 | } 23 | 24 | /** 25 | * Implements hook_menu(). 26 | */ 27 | function mth_loop_game_menu() { 28 | $module_path = 'loop_game'; 29 | $items[$module_path] = array( 30 | 'title' => 'Loop game', 31 | 'page callback' => 'mth_loop_game_main_page', 32 | 'access callback' => TRUE, 33 | 'expanded' => TRUE, 34 | ); 35 | return $items; 36 | } 37 | 38 | function mth_loop_game_main_page() { 39 | $path = drupal_get_path('module', 'mth_loop_game'); 40 | $wait = '

' . t('Wait... Loading...') . '

'; 41 | $loop_game_settings = array( 42 | 'soundsPath' => $path . '/sounds', 43 | 'warningHTML' => mth_web_audio_warning(), 44 | 'waitHTML' => $wait, 45 | ); 46 | drupal_add_js($path . '/js/buffer-loader.js'); 47 | drupal_add_js($path . '/js/loop_game.js'); 48 | drupal_add_js(array('mth_loop_game' => $loop_game_settings), 'setting'); 49 | $content = '
'; 50 | $content .= '
' . $wait . '
'; 51 | $content .= '
'; 52 | return $content; 53 | } 54 | 55 | function mth_web_audio_warning() { 56 | $text = '

' . t('WARNING! It seems, your browser does not support web audio.') . '

'; 57 | $text .= '

' . t('Web audio is required for the loop game to work correctly.') . '

'; 58 | $text .= '

' . t('We recommend Chrome browser, because it supports web audio.') . '

'; 59 | $text .= '

' . t('Safari supports web audio since version 6.0 and Opera since version 15.0. Support for Firefox is planned from version 23.0.') . '

'; 60 | return $text; 61 | } -------------------------------------------------------------------------------- /js/loop_game.js: -------------------------------------------------------------------------------- 1 | /* 2 | code by regginos 3 | */ 4 | 5 | var loopGame = { 6 | loopLength: 16, 7 | currentBeat: 0, 8 | isLoopPlaying: false, 9 | tempo: 80, 10 | notes: [60,62,64,67,69,72], 11 | notesURL: [], 12 | BUFFERS: [], 13 | pattern: [], 14 | context: null, 15 | soundsPath: '', //TODO: think of a logical stucture for the sounds directory 16 | waitHTML: '', 17 | warningHTML: '', 18 | timeId: null, 19 | }; 20 | 21 | loopGame.exportLoop = function() { 22 | var string = JSON.stringify(loopGame, ['loopLength','notes','pattern','tempo']); 23 | var newWindow = window.open('','','width=400,height=300'); 24 | newWindow.document.write(string); 25 | } 26 | 27 | jQuery(document).ready(function() { 28 | /* 29 | Loop game is originaly designed as a Drupal 7 module, and the following 30 | line is a convienient way of passing settings from the server. 31 | It can be replaced with something like this: 32 | var importedSettings = { 33 | soundsPath: 'path/to/directory/with/sounds', 34 | warningHTML: '

Message to user

How stupid can you be, not to use a browser that supports web audio!

', 35 | } 36 | */ 37 | var importedSettings = Drupal.settings.mth_loop_game; 38 | loopGame.importSettings(importedSettings); 39 | window.AudioContext = window.AudioContext || window.webkitAudioContext; 40 | if (!window.AudioContext) { 41 | //alert(Drupal.t('Your browser most probably does not support web audio.')); 42 | var newElem = document.createElement('div'); 43 | newElem.innerHTML = loopGame.warningHTML; 44 | var elem = document.getElementById('ready'); 45 | elem.appendChild(newElem); 46 | } 47 | else { 48 | loopGame.context = new AudioContext(); 49 | loopGame.init(); 50 | } 51 | }); 52 | 53 | loopGame.processNewForm = function(form) { 54 | var set = {}; 55 | for (var i = 0; i < form.length; i++) { 56 | switch (form[i].name) { 57 | case 'notes': loopGame.setNotes(form[i].value); break; 58 | case 'loopLength': loopGame.setLoopLength(form[i].value); break; 59 | } 60 | } 61 | loopGame.makeNewLoop(); 62 | } 63 | 64 | loopGame.setNotes = function(notesString) { 65 | //TODO: do some validation 66 | var arr = notesString.split(','); 67 | for (var i = 0; i < arr.length; i++) { 68 | arr[i] = arr[i].trim(); 69 | } 70 | loopGame.notes = arr; 71 | } 72 | 73 | loopGame.setLoopLength = function(string) { 74 | loopGame.loopLength = string; 75 | } 76 | 77 | loopGame.makeNewLoop = function(settings) { 78 | if (arguments.length > 0) { 79 | loopGame.importSettings(settings); 80 | } 81 | loopGame.stopLoop(); 82 | document.getElementById('ready').innerHTML = loopGame.waitHTML; 83 | document.getElementById('loopGame').innerHTML = ''; 84 | document.getElementById('tempo').innerHTML = ''; 85 | loopGame.init(); 86 | } 87 | 88 | loopGame.importSettings = function(settings) { 89 | for (prop in settings) { 90 | if (loopGame.hasOwnProperty(prop)) { 91 | loopGame[prop] = settings[prop]; 92 | } 93 | } 94 | } 95 | 96 | loopGame.createFormCustomize = function() { 97 | var text = '



Customize the loop (make changes and then click "Make new loop"):

'; 98 | text += '
'; 99 | text += ''; 100 | text += ''; 101 | text += ''; 102 | text += ''; 103 | text += '
Loop length (how many beats):
Notes (comma separated values 21-109, kick, snare, hihat, tom1, tom2, tom3):
Tempo:80
'; 104 | text += ''; 105 | text += ''; 106 | text += '
'; 107 | var newElem = document.createElement('div'); 108 | newElem.innerHTML = text; 109 | var elem = document.getElementById('controls'); 110 | elem.appendChild(newElem); 111 | } 112 | 113 | loopGame.setNotesURL = function() { 114 | for (var i = 0; i < loopGame.notes.length; i++) { 115 | switch (loopGame.notes[i]) { 116 | case 'kick': 117 | var url = loopGame.soundsPath + '/drum_kit/kick.wav'; 118 | break; 119 | case 'hihat': 120 | var url = loopGame.soundsPath + '/drum_kit/hihat.wav'; 121 | break; 122 | case 'snare': 123 | var url = loopGame.soundsPath + '/drum_kit/snare.wav'; 124 | break; 125 | case 'tom1': 126 | var url = loopGame.soundsPath + '/drum_kit/tom1.wav'; 127 | break; 128 | case 'tom2': 129 | var url = loopGame.soundsPath + '/drum_kit/tom2.wav'; 130 | break; 131 | case 'tom3': 132 | var url = loopGame.soundsPath + '/drum_kit/tom3.wav'; 133 | break; 134 | default: 135 | var url = loopGame.soundsPath + '/notes_piano_mp3/p' + loopGame.notes[i] + '.mp3'; 136 | break; 137 | } 138 | loopGame.notesURL[i] = url; 139 | } 140 | } 141 | 142 | loopGame.init = function() { 143 | for (var i = 0; i < loopGame.notes.length; i++) { 144 | loopGame.pattern[i] = []; 145 | for (var j = 0; j < loopGame.loopLength; j++) { 146 | loopGame.pattern[i][j] = 0; 147 | } 148 | } 149 | loopGame.pattern.length = loopGame.notes.length; //a "smart" way to delete extra items 150 | loopGame.setNotesURL(); 151 | bufferLoader = new BufferLoader( 152 | loopGame.context, 153 | loopGame.notesURL, 154 | loopGame.finishedLoading 155 | ); 156 | bufferLoader.load(); 157 | } 158 | 159 | loopGame.finishedLoading = function(bufferList) { 160 | for (var i = 0; i < loopGame.notes.length; i++) { 161 | loopGame.BUFFERS[i] = bufferList[i]; 162 | } 163 | loopGame.showReady(); 164 | loopGame.createForm(); 165 | loopGame.startLoop(); 166 | if (!document.getElementById('form_new_loop')) { 167 | loopGame.createFormCustomize(); 168 | } 169 | } 170 | 171 | loopGame.createForm = function() { 172 | var text = ''; 173 | text += ''; 174 | for (var i = 0; i < loopGame.notes.length; i++) { 175 | text += ''; 176 | for (var j = 0; j < loopGame.loopLength; j++) { 177 | text += ''; 180 | } 181 | text += ''; 182 | } 183 | text += '
'; 178 | text += ''; 179 | text += '
'; 184 | document.getElementById('loopGame').innerHTML = text; 185 | } 186 | 187 | loopGame.showReady = function() { 188 | var r = document.getElementById('ready'); 189 | r.innerHTML = '

READY!

click on some checkboxes. Make sure your speakers are on.

'; 190 | } 191 | 192 | loopGame.nextBeat = function() { 193 | loopGame.currentBeat++; 194 | if (loopGame.currentBeat == loopGame.loopLength) { 195 | loopGame.currentBeat = 0; 196 | } 197 | } 198 | 199 | loopGame.playBeat = function() { 200 | for (var i = 0; i < loopGame.notes.length; i++) { 201 | if (loopGame.pattern[i][loopGame.currentBeat]) { 202 | loopGame.playNote(i); 203 | } 204 | } 205 | loopGame.nextBeat(); 206 | } 207 | 208 | loopGame.startLoop = function() { 209 | if (!loopGame.isLoopPlaying) { 210 | var interval = (60000 / loopGame.tempo) / 4; 211 | loopGame.timeId = setInterval(loopGame.playBeat, interval); 212 | loopGame.isLoopPlaying = true; 213 | document.getElementById('start_stop').innerHTML = ''; 214 | } 215 | } 216 | 217 | loopGame.stopLoop = function() { 218 | if (loopGame.isLoopPlaying) { 219 | clearInterval(loopGame.timeId); 220 | loopGame.currentBeat = 0; 221 | loopGame.isLoopPlaying = false; 222 | document.getElementById('start_stop').innerHTML = ''; 223 | } 224 | } 225 | 226 | loopGame.playNote = function(index) { 227 | loopGame.playSound(loopGame.BUFFERS[index], 0); 228 | } 229 | 230 | loopGame.playSound = function(buffer, time) { 231 | var source = loopGame.context.createBufferSource(); 232 | source.buffer = buffer; 233 | source.connect(loopGame.context.destination); 234 | if (!source.start) {source.start = source.noteOn;} 235 | source.start(time); 236 | } 237 | 238 | loopGame.updateBeat = function(row,beat,value) { 239 | loopGame.pattern[row][beat] = (value) ? 1 : 0; 240 | } 241 | 242 | loopGame.updateTempo = function(value) { 243 | loopGame.tempo = value; 244 | document.getElementById('tempoValue').innerHTML = loopGame.tempo; 245 | if (loopGame.isLoopPlaying) { 246 | clearInterval(loopGame.timeId); 247 | var interval = (60000 / loopGame.tempo) / 4; 248 | loopGame.timeId = setInterval(loopGame.playBeat, interval); 249 | } 250 | } 251 | 252 | 253 | /* 254 | var game = new LoopGame('sites/all/modules/mth_loop_game/sounds'); 255 | var timeId; //the timeOut or setInterval ID 256 | //window.onload = game.init(); 257 | 258 | function LoopGame(path) { //constructor function 259 | this.loopLength = 16; 260 | this.currentBeat = 0; 261 | this.isLoopPlaying = false; 262 | this.tempo = 80; 263 | //this.notes = notes || [60,62,64,67,69,72]; 264 | this.notes = [60,62,64,67,69,72]; 265 | this.game = []; 266 | for (var i = 0; i < this.notes.length; i++) { 267 | this.game[i] = []; 268 | for (var j = 0; j < this.loopLength; j++) { 269 | this.game[i][j] = (i === 0 && j === 0) ? true : false; 270 | } 271 | } 272 | this.context; 273 | this.BUFFERS = []; 274 | this.notesURL = []; 275 | for (var i = 0; i < this.notes.length; i++) { 276 | var url = path + '/notes_piano_mp3/p' + this.notes[i] + '.mp3'; 277 | this.notesURL.push(url); 278 | } 279 | } 280 | 281 | LoopGame.prototype.init = function() { 282 | var g = this; 283 | window.AudioContext = window.AudioContext || window.webkitAudioContext; 284 | this.context = new AudioContext(); 285 | this.bufferLoader = new BufferLoader( 286 | this.context, 287 | this.notesURL, 288 | function(bufferList) { 289 | g.setBuffers(bufferList); 290 | g.showReady(); 291 | g.createForm(); 292 | g.createTempoControl(); 293 | g.startLoop(); 294 | } 295 | ); 296 | this.bufferLoader.load(); 297 | } 298 | 299 | LoopGame.prototype.setBuffers = function(bufferList) { 300 | for (var i = 0; i < bufferList.length; i++) { 301 | this.BUFFERS.push(bufferList[i]); 302 | } 303 | } 304 | 305 | LoopGame.prototype.showReady = function() { 306 | var r = document.getElementById('ready'); 307 | r.innerHTML = '

READY!

click on some checkboxes. Make sure your speakers are on.

'; 308 | } 309 | 310 | LoopGame.prototype.createForm = function() { 311 | var text = ''; 312 | text += ''; 313 | for (var i = 0; i < this.notes.length; i++) { 314 | text += ''; 315 | for (var j = 0; j < this.loopLength; j++) { 316 | text += ''; 319 | } 320 | text += ''; 321 | } 322 | text += '
'; 317 | text += ''; 318 | text += '
'; 323 | document.getElementById('loopGame').innerHTML = text; 324 | } 325 | 326 | LoopGame.prototype.createTempoControl = function() { 327 | document.getElementById('tempo').innerHTML = 'Tempo: 80'; 328 | } 329 | 330 | LoopGame.prototype.startLoop = function() { 331 | if (!this.isLoopPlaying) { 332 | var interval = (60000 / this.tempo) / 4; 333 | timeId = setInterval(this.playBeat, interval); 334 | this.isLoopPlaying = true; 335 | document.getElementById('start_stop').innerHTML = ''; 336 | } 337 | } 338 | 339 | LoopGame.prototype.playBeat = function() { 340 | alert(this.notes); 341 | for (var i = 0; i < this.notes.length; i++) { 342 | if (this.game[i][this.currentBeat]) { 343 | this.playNote(i); 344 | } 345 | } 346 | this.nextBeat(); 347 | } 348 | 349 | LoopGame.prototype.nextBeat = function() { 350 | this.currentBeat++; 351 | if (this.currentBeat == this.loopLength) { 352 | this.currentBeat = 0; 353 | } 354 | } 355 | 356 | LoopGame.prototype.stopLoop = function() { 357 | if (this.isLoopPlaying) { 358 | clearInterval(timeId); 359 | this.currentBeat = 0; 360 | this.isLoopPlaying = false; 361 | document.getElementById('start_stop').innerHTML = ''; 362 | } 363 | } 364 | 365 | LoopGame.prototype.playNote = function(index) { 366 | this.playSound(this.BUFFERS[index], 0); 367 | } 368 | 369 | LoopGame.prototype.playSound = function(buffer, time) { 370 | var source = this.context.createBufferSource(); 371 | source.buffer = buffer; 372 | source.connect(this.context.destination); 373 | if (!source.start) {source.start = source.noteOn;} 374 | source.start(time); 375 | } 376 | 377 | LoopGame.prototype.updateBeat = function(row,beat,value) { 378 | this.game[row][beat] = value; 379 | } 380 | 381 | LoopGame.prototype.updateTempo = function(value) { 382 | this.tempo = value; 383 | document.getElementById('tempoValue').innerHTML = this.tempo; 384 | if (this.isLoopPlaying) { 385 | clearInterval(timeId); 386 | var interval = (60000 / this.tempo) / 4; 387 | var p = this.playBeat(); 388 | timeId = setInterval(p, interval); 389 | } 390 | } 391 | */ --------------------------------------------------------------------------------