隨著電子音樂科技的蓬勃發展,以MIDI音樂為核心的電子鋼琴已日漸普及化。為了讓演奏者自主練習時能有伴奏配合的效果,前人提出結合電腦輔助與多媒體技術的互動式音樂教學平台;但這些應用程式大都仍受限於固定拍速的伴奏,而無法配合彈奏者主旋律的拍速變化。為了提升初學者的學習動機,本論文開發出一套自動音樂伴奏系統,分為樂譜追蹤、拍速預測與伴奏播放三個核心模組。樂譜追蹤是透過樂譜資訊建構其隱藏式馬可夫模型,進而推算出目前彈奏音符的位置。拍速預測則是採用一次移動平均的趨勢預測法,依據MIDI的時間參數計算當前拍速,並以此預測下一個按鍵時間。主旋律的實驗結果顯示追蹤錯誤率約為3.58%,拍速預測誤差為238毫秒,能精準且快速地掌握初學者的彈奏位置。在自動音樂伴奏系統的播放時間上,實際與預期伴奏也幾乎都能落在100毫秒內。
In recent years, the low-priced MIDI piano has become one of the most popular musical instruments. MIDI music applications have ranged from simple entertainment to an interactive support system for self-learners at the beginning stage. This study aims at developing automatic accompaniment that achieves synchronization by adapting to the player's performance as a human accompanist would. Our system design can be divided into three sub-problems: score following, tempo estimation and accompaniment generation. To estimate the most probable score position, a hidden Markov model is used as a performance model which follows the score being played in the performance MIDI. To estimate the tempo, we began by extracting MIDI-based parameters concerning onset-time and tempo. Based on their differences, we apply simple moving average to predict the next onset-time of the major melody and accompaniment. Computer experiments on three practice songs demonstrate the effectiveness of the proposed method with an error rate of 3.58% in score following and a deviation of 238 ms in tempo estimation.