掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
WAVEを内蔵するには? (ID:74388)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
単音でならすなら(デスクトップキーボードみたいに)MidiOutShortStringと言うAPIをつかいます。 と言っても、このAPI、使い方が特殊で難しいんです。 とりあえず、自作モジュールの中からちょっとだけ。 Public Type PlayInstulment PeddalDown As Boolean inst As Long Velosity As Long PlayOn As Long Corlas As Long Revorbe As Long Stereo As Long Picchi As Long DeviceOn As Boolean Modulation As Long End Type Dim hMid As Long Public ComInst As PlayInstulment Public Sub UseInst(inst As PlayInstulment, Optional NoteOfDrm As Boolean = False) With inst If .DeviceOn = False Then Exit Sub midiOutShortMsg hMid, &H80 + .PlayOn * 256 + .Velosity * 256 * 256 midiOutShortMsg hMid, &H89 + .PlayOn * 256 + .Velosity * 256 * 256 If NoteOfDrm = False Then midiOutShortMsg hMid, &HE0 + .Picchi * 256 * 256 midiOutShortMsg hMid, &HB0 + 1 * 256 + .Modulation * 256 * 256 midiOutShortMsg hMid, &HB0 + 10 * 256 + .Stereo * 256 * 256 midiOutShortMsg hMid, &HB0 + 91 * 256 + .Revorbe * 256 * 256 midiOutShortMsg hMid, &HB0 + 93 * 256 + .Corlas * 256 * 256 midiOutShortMsg hMid, &HC0 + .inst * 256 + 0 midiOutShortMsg hMid, &H90 + .PlayOn * 256 + .Velosity * 256 * 256 Else midiOutShortMsg hMid, &HE9 + .Picchi * 256 * 256 midiOutShortMsg hMid, &HB9 + 1 * 256 + .Modulation * 256 * 256 midiOutShortMsg hMid, &HB9 + 10 * 256 + .Stereo * 256 * 256 midiOutShortMsg hMid, &HB9 + 91 * 256 + .Revorbe * 256 * 256 midiOutShortMsg hMid, &HB9 + 93 * 256 + .Corlas * 256 * 256 midiOutShortMsg hMid, &HC9 + .inst * 256 + 0 midiOutShortMsg hMid, &H99 + .PlayOn * 256 + .Velosity * 256 * 256 End If End With End Sub ユーザー定義型変数の名前は、それぞれMIDI用語です。PlayOnは音階、60が4オクターブ目の"ド"です。 MIDIデバイスを開いたり閉じたりも忘れないでくださいね。 やり方は、ここのAPI集参照。 それから、MIDIデバイスを使うものが近くにあって、同じタイミングで扱われてると、とっても危ないです。 このモジュール、あげてもいいですけど、 (って、人から教えてもらって、やっと作ったのにいいのかなぁ…) そのなかにもまだ上の危険性は残っているので^^; MSDNでMIDIをひくと、いっぱい出てくると思いますけど…。
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.