SlideShare a Scribd company logo
1 of 13
Download to read offline
FMSYNTH16
YMF825を使用したMIDI音源
2020/09/26 @LunaTsukinashi
自己紹介
Luna Tsukinashi
• 某高専の電気電子工学科2年
• MIDIとFM音源が大好き
• 去年は某ペンギンがマスコットの音ゲーを
再現していました
• 詳しくは
GitHub:Xi80
Twitter:@LunaTsukinashi
構想
• STM32を介してMIDIでYMF825Boardを制御、演奏させたい
• Mbed OS上で動作させるため比較的ハード寄りの記述は少なめ
• MIDIはハードウェア音源で再生して遊ぶ程度の知識
YMF825Boardについて
• ヤマハのFM音源IC、YMF825を
載せた音源ボード
• SPIで制御できる(!)ので比較的楽
• 最大同時発音数は16
• 古典的FM音源と制御方法が異なる
• 公式GitHubが最近消えた
構成
YMF825Board
YMF825 Driver
関数呼び出し
MIDI-YMF825 Bridge
SPI
MIDI Driver
関数呼び出し
MIDI IN
MIDI(UART)
MIDI Driver
MIDIの受信、メッセージの解析
MIDI-YM825 Bridge
YMF825用にパラメータを変換
YMF825 Driver
YMF825との通信、各種イベント送信
ハードウェア
• メイン基板(左)
• 変換基板に載ったICがSTM32
• 右下はMIDI受信用のオプトカプラ
• アンプ基板(右)
• スピーカーでもPowerfulに駆動可
• ただしモノラル
• MIDIまわりはほぼ規格に準拠
ソフトウェア
• MIDI Driver
• 一番力を入れた部分
• ルーチン自体はMIDI規格書に記載のもの+α程度
• 呼び出す関数を自由に変更可能で使いまわしやすい
• イメージとしてはArduinoのMIDIライブラリにちゃんとした
シリアル受信割り込みを付けた感じ
ソフトウェア
• MIDI-YMF825 Bridge
• 具体的にはボイスのアサインと各種パラメータ(PitchBend等)の変換
• 発音時間によるボイスあふれ時の消音->アサインも実装
• ここがバグると大変なことになる
• アサインを可視化するととても面白い
(参考:https://twitter.com/LunaTsukinashi/status/1285586089810341888)
ソフトウェア
• YMF825Driver
• 実際にYMF825と通信して制御するのはこれ
• こまごまとした作業は既にBridgeがやってくれているのでコマンドを発行していくだけ
• コマンドは基本的に16進数で入力してるのでTypoに気付きにくい(1敗)
音色について
• GM準拠の配列で128音色分のデータを音源に内蔵しています
• 128音色でもわずか約4KB(!)、FM音源の恩恵。
• ドラムセットと発音数の関係でGM音源とは名乗れない
• かなしい
• ちゃんとプログラムチェンジにも反応します
• 一時期永遠にバグらせていたのでようやく安定した感
演奏させるために
• ドラムパートはなし、全Chメロディーパート
• 容量的に厳しいので全Chメロディーパート。
• 数少ない発音数をドラムに割くとかなり発音数不足で音が途切れてしまう
• PitchBendとExpression/Part Levelはテーブルで持つ
• 特にMIDIのPitchBendはn乗の計算が必要なので遅い
• とりあえずリアルタイムに動いてるのでヨシ!
実演
• 動画はこちらから
https://www.youtube.com/watch?v=YGSEPjgV8T8
今後やりたいこと
• YMF825Boardを2枚使用しステレオ16音/モノラル32音化
• 16音だとちょっと物足りない
• 自前の音色のSysEx経由での転送
• 音色をもっとそれっぽくしたい

More Related Content

What's hot

php and sapi and zendengine2 and...
php and sapi and zendengine2 and...php and sapi and zendengine2 and...
php and sapi and zendengine2 and...
do_aki
 
The comparison between FPGA , ARDUINO , ASIC
The comparison between FPGA , ARDUINO , ASIC The comparison between FPGA , ARDUINO , ASIC
The comparison between FPGA , ARDUINO , ASIC
Mohamed Youssery
 
FINAL CORRECT Report
FINAL CORRECT ReportFINAL CORRECT Report
FINAL CORRECT Report
RK Saini
 

What's hot (20)

ARM_System_Developers_Guide-Designing_and_Optimizing_System_Software.pdf
ARM_System_Developers_Guide-Designing_and_Optimizing_System_Software.pdfARM_System_Developers_Guide-Designing_and_Optimizing_System_Software.pdf
ARM_System_Developers_Guide-Designing_and_Optimizing_System_Software.pdf
 
php and sapi and zendengine2 and...
php and sapi and zendengine2 and...php and sapi and zendengine2 and...
php and sapi and zendengine2 and...
 
The comparison between FPGA , ARDUINO , ASIC
The comparison between FPGA , ARDUINO , ASIC The comparison between FPGA , ARDUINO , ASIC
The comparison between FPGA , ARDUINO , ASIC
 
Project Report on Embedded Systems
Project Report on Embedded Systems Project Report on Embedded Systems
Project Report on Embedded Systems
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Embedded Robotics : Notes (2008)
Embedded Robotics : Notes (2008)Embedded Robotics : Notes (2008)
Embedded Robotics : Notes (2008)
 
Raspberry Pi (Introduction)
Raspberry Pi (Introduction)Raspberry Pi (Introduction)
Raspberry Pi (Introduction)
 
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
DESIGN AND SIMULATION OF DIFFERENT 8-BIT MULTIPLIERS USING VERILOG CODE BY SA...
 
ASIC design Flow (Digital Design)
ASIC design Flow (Digital Design)ASIC design Flow (Digital Design)
ASIC design Flow (Digital Design)
 
design of FPGA based traffic light controller system
design of FPGA based traffic light controller systemdesign of FPGA based traffic light controller system
design of FPGA based traffic light controller system
 
Traffic light controller
Traffic light controllerTraffic light controller
Traffic light controller
 
Raspberry pi
Raspberry piRaspberry pi
Raspberry pi
 
FINAL CORRECT Report
FINAL CORRECT ReportFINAL CORRECT Report
FINAL CORRECT Report
 
Industrial training report of embedded system and robotics
Industrial training report of embedded system and roboticsIndustrial training report of embedded system and robotics
Industrial training report of embedded system and robotics
 
Rasp berry Pi
Rasp berry PiRasp berry Pi
Rasp berry Pi
 
Atmega 328p
Atmega 328p Atmega 328p
Atmega 328p
 
Four way traffic light conrol using Verilog
Four way traffic light conrol using VerilogFour way traffic light conrol using Verilog
Four way traffic light conrol using Verilog
 
lesson2 - Nodemcu course - NodeMCU dev Board
 lesson2 - Nodemcu course - NodeMCU dev Board lesson2 - Nodemcu course - NodeMCU dev Board
lesson2 - Nodemcu course - NodeMCU dev Board
 
Esp8266 basics
Esp8266 basicsEsp8266 basics
Esp8266 basics
 
Embedded C programming based on 8051 microcontroller
Embedded C programming based on 8051 microcontrollerEmbedded C programming based on 8051 microcontroller
Embedded C programming based on 8051 microcontroller
 

YMF825を使用したMIDI音源