2015-06-22 70 views
0

我用我的項目MIDI.js,這裏是我的播放MIDI序列碼指出如何實現的音符序列MIDI.js的MIDI播放器

for (var repeat = 0; repeat < melodyrepititions; repeat++) 
     { 
      for (var i = 0; i < composition.length; i++) 
      { 
       for (var j = 0; j < composition[i].length; j++) 
       { 
        if (composition[i][j] != 0) 
        { 

         MIDI.noteOn(0, composition[i][j] + scale, velocity,delay); 
         MIDI.noteOff(0, composition[i][j] + scale, delay+onlynotationsofeachbeatbracketdelay[i][j]); 
        } 
        else if (composition[i][j] == 0) 
        { 
         MIDI.noteOff(0, composition[i][j] + scale, delay); 
        } 
        delay = delay + onlynotationsofeachbeatbracketdelay[i][j]; 
       } 
      } 
     } 

我想要實現MIDI.js球員爲了這個序列開始,暫停,在播放時停止旋律。我無法弄清楚如何使用MIDI.js播放器功能進行這種順序。請指導。

回答

0

使用https://github.com/surikov/SSSynthesiser.js代替MIDI.js.的轉換的更多信息

SSSynthesiser.js完全控制播放內容。您可以實時更改所有樂器樣本,旋律等。

+0

謝謝,我如何在SSSynthesiser.js中使用我自己的樂器,我沒有看到任何選項可以做到這一點 – user3467180

+0

SSSynthesiser.js播放Molgav(http:// molgav .nn.ru)文件。它包含數千種用於各種目的的工具。您也可以將原始格式的JSON文件添加到自己的示例中,請參閱項目頁面中歌曲的示例。 – user1024

+0

我試圖理解這個庫,但我不能。這裏有一些疑問 1.什麼是molgav文件? 2.從獲取音頻數據的位置,如MIDI.js中,我們提供soundfont js文件。 2.如果我想使用我自己的聲音樣本,我該如何使用?,請用代碼 – user3467180

相關問題