Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic channel allocation function #119

Open
denjhang opened this issue Aug 24, 2021 · 6 comments
Open

Dynamic channel allocation function #119

denjhang opened this issue Aug 24, 2021 · 6 comments

Comments

@denjhang
Copy link

The dynamic channel allocation function allows me to compose music with more audio tracks than the actual number of channels. In fact, in most cases, the channels of YM2612 are not fully used all the time, and there are always idle channels. If this function is available, the channel utilization can be improved a lot, and there are fewer restrictions when composing tracks. .

@musicalman
Copy link

So you want something like this?
When you want dynamic allocation, you write your mml data on tracks. Each track has a list of parts it is allowed to write to.
When you write on a track, the compiler will search for free parts in which to place notes.
If a new note arrives but all parts are occupied, decide which part to cut off. Perhaps the part with the lowest volume should be cut first.
It sounds quite complicated to implement.
I think the part arpeggio function is a good compromise. It's not exactly what you want, but it helps in some cases.

@denjhang
Copy link
Author

So you want something like this?
When you want dynamic allocation, you write your mml data on tracks. Each track has a list of parts it is allowed to write to.
When you write on a track, the compiler will search for free parts in which to place notes.
If a new note arrives but all parts are occupied, decide which part to cut off. Perhaps the part with the lowest volume should be cut first.
It sounds quite complicated to implement.
I think the part arpeggio function is a good compromise. It's not exactly what you want, but it helps in some cases.

In fact, this is not complicated, only a simple algorithm is needed to use these channels in turn. In general, the new notes directly overwrite the old ones. In addition, it is also necessary to calculate the actual length of the note. Longer notes have a higher priority to be covered. . Something like that.

@denjhang
Copy link
Author

In practical examples, Windows comes with OPL3/OPNA MIDI driver with this algorithm, which can play MIDI in FM sound source (usually there are more MIDI channels than FM hardware channels)

@kuma4649
Copy link
Owner

申し訳ありませんが、その形式をサポートする予定はありません。

OPLの様に短時間での大量の書きこみに耐えられるCHIPなら問題ないでしょうけども、
そうではないChipも多数あります。

また、Chip毎に発音するためのアルゴリズムを組むのも大変で複雑だからです。

更に、MDPlayerで鍵盤表示が見にくい状態になるという理由もあります。
(IBM系のOPLのデータを再生した場合や、MULTIPCMのデータを再生した場合によくわかると思います)

データを作成するユーザーは常に発音数を意識する必要があります。
初期のMIDI音源やM01(DSのソフト)にみられる発音数の少なさから発生する制限です。

@denjhang
Copy link
Author

For algorithmic issues, there are currently two projects that have implemented this function. I suggest you refer to their code. In fact, the OPL series chips are very suitable for dynamic channel allocation.

https://github.com/Wohlstand/libADLMIDI
https://github.com/Wohlstand/libOPNMIDI

@kuma4649
Copy link
Owner

作り方がわからないという問題だけではありません。
申し訳ありませんが、この機能についてはサポートしません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants