Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
defined. Whether it runs on this system is found at run time.
-->
<PropertyGroup>
<BrackVersion>1.0.0</BrackVersion>
<BrackVersion>1.1.0</BrackVersion>
<BrackProject>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../brack/bindings/dotnet/Brack/Brack.csproj'))</BrackProject>
<BrackSource Condition="'$(UseBrackPackage)' != 'true' and Exists('$(BrackProject)')">Project</BrackSource>
<BrackSource Condition="'$(BrackSource)' == '' and '$(BrackVersion)' != ''">Package</BrackSource>
Expand Down
1 change: 1 addition & 0 deletions IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ MIDI はそのノートポートへ、受け取ったバイト列のまま渡す
- **ラックは Glosa の窓(`設定-オーディオプラグイン...`)で組み、設定フォルダの `brack-session.json` に Brack のセッションとして持つ。** プラグインの状態(エディタで変えた設定)も入る。スキャンの結果のキャッシュは `brack-plugin-cache.json`。**どちらもアーキテクチャの違うプレイヤー(Windows on Arm の x64 版と ARM64 版など)で共有する。** Brack はどのアーキテクチャのプラグインもそのアーキテクチャのプラグインホストで動かすので、同じラックをどのプレイヤーでも開ける。そのプレイヤーにホストの無いアーキテクチャのプラグイン(下の表)は読み込めないが、状態ごとラックに残る。キャッシュは Brack が項目ごとにアーキテクチャを持ち、そのプレイヤーで動かせないものは一覧に出さない(Brack 自身の設定とキャッシュも同じ形)。ラックを変えたときはすぐに書き、プラグインが状態の変化を知らせたときは 3 秒待ってから書く。終了するときは、変化を知らせないプラグインのために、変更が無くても書く。ただしラックが空なら書かない(読み込めずに退けられなかったファイルを空のラックで上書きしないため)。
- **読み込めないセッションファイルは `.broken` を付けて退け、空のラックで上書きしない。** ファイルが無くなったプラグインはラックに残り(Brack が状態ごと保つ)、そのデバイスは開けない。
- **起動を待たせない。** プラグインの読み込みには秒単位でかかることがあるので、セッションは裏で読む。読み終わるまでは、ファイルに書いてあるプラグインを 1 つずつデバイスとして並べる。並べておかないと、起動直後の一覧でポートが「見つかりません」になり、コマンドラインの `--device` も通らない。ノートポートの数は読み込むまで分からないので、**曲の準備では、出力を選ぶ前に読み終わりを待ち、一覧を読み直す**(`MainViewModel.OnSongLoading`、`IMidiOutputFactory.WaitUntilListed`)。待たないと、複数のポートを持つプラグインのポート(`名前 2` など)は一覧に無いので、その曲の間は使わないポートとして外される。待つのは再生スレッドなので、読み込み中も画面は止まらない。曲は読み終わってから始まる。
- **ラックのプラグインを 1 つずつ読み込む設定を、オーディオプラグインの窓に出す**(`BrackRack.LoadPluginsSerially`、Brack の `load_plugins_serially`)。Brack は既定でセッションのプラグインを一斉に読み込むが、SOUND Canvas VA は 2 つ同時に読み込むと、片方が「Parameter file1 read error」のダイアログを出して止まるか、状態の読み込みで落ちる。既定は Brack と同じく一斉のままにする。設定はセッションに持つので、次にラックを読み込むとき(Glosa の次の起動)から効く。
- **音声デバイスは、出力が開いているかエディタが出ている間だけ動かし、最後に閉じてから 3 秒後に止める。** 出力は再生が止まるたびに閉じる([出力を開く・閉じる](#出力を開く閉じる))。動かし続けると、開いたままの音声ストリームが Windows のスリープを妨げる。すぐに止めると、最後の音の余韻が切れる。
- **バッファ(音声デバイスの周期)は時間で選び、新しいラックでは 20 ms にする**(`BrackRack.Buffer`)。Brack の既定(256 フレーム)は弾いた音にすぐ応えるための短さで、曲を再生するだけの Glosa には要らない。長いほど、重いプラグインやほかの処理があっても音が途切れにくい。ただし Brack はメッセージを届いた 1 周期後に置くので、周期のぶんプラグインの音は MIDI ポートの先の機械より遅れる。20 ms は Windows の共有モードの周期(10 ms、これより短くしても効かない)の倍で、遅れも 20 ms ほどに収まる。Brack の設定はフレーム数なので、選んだときの出力デバイスのレートで換算して持ち、出力デバイスを変えるときは新しいデバイスのレートで換算し直す。既定の出力が変わるなどしてレートの違うデバイスで鳴ると長さも変わり、窓にはそのときのレートでの長さが出る。
- **サンプリングレートは、プラグインを動かすレート(`process_sample_rate`)を選ぶ。** 出力デバイスのレートは共有モードでは OS のミキサーのもので、Brack から変えられるのは Windows の排他モードだけ。排他モードは遅れを短くするためのもので、使っている間はほかのアプリの音が出なくなるので、設定に出さない。出力と違うレートを選ぶと、Brack が出力のレートに変換する。**変換の品質は設定に出さず、新しいラックで最高(Ultra)にする**(`BrackRack.Load`)。品質を下げる理由は CPU と遅れだが、測ると CPU の負荷は High より増えず(テスト用の音源で、44.1 kHz と 96 kHz から 48 kHz へ)、変換の遅れ(最大 9 ms ほど)は再生するだけの Glosa には効かない。
Expand Down
22 changes: 22 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ TMIDI Player の定義ファイルを利用した音源エミュレーション
名前で分からないときは、曲の MIDI データからも判別します。
- **ポートマップ** — ポート A〜F の 6 本の出力に、それぞれ別の MIDI デバイスをつなげます。
つなぎ方に名前を付けて複数持っておけ、曲の対象音源に合わせて自動で切り替えられます。
- **オーディオプラグイン** — CLAP・VST3・VST2 の音源プラグインも、MIDI デバイスと同じようにポートにつなげます。
- **音色マップの自動切り替え** — 下位機種向けの曲を、その機種の音色マップで鳴らします。
- 出力音源が SC-88 以降なら、SC-55・SC-88 などの曲を、その機種のマップで鳴らします。
- 出力音源が MU100 以降なら、MU50・MU80・MU90 の曲を MU Basic で鳴らします。
Expand Down Expand Up @@ -49,6 +50,7 @@ TMIDI Player の定義ファイルを読み込むと、TMIDI Player と同じ**
- Windows では loopMIDI などの仮想 MIDI ポートが使えます。
- macOS では「Audio MIDI 設定」の IAC ドライバや、ソフトウェア音源が作る仮想ポートが使えます。
- Linux では ALSA シーケンサーのポート(USB の MIDI 機器、ソフトウェア音源が作るポート、Midi Through)が使えます。
- または、CLAP・VST3・VST2 の音源プラグイン([オーディオプラグイン](#オーディオプラグイン))

.NET ランタイムは必要ありません(配布物に含まれています)。

Expand Down Expand Up @@ -88,6 +90,24 @@ TMIDI Player の定義ファイルを読み込むと、TMIDI Player と同じ**

<img src="images/port-map-settings.png" width="560" alt="ポートマップ設定。MU2000 のマップに、対象音源が MU2000・MU1000・MU128 の曲を割り当てています">

### オーディオプラグイン

**設定 → オーディオプラグイン...** で、使う音源プラグインをラックに並べます。

- CLAP・VST3・VST2 の標準のフォルダにある音源は、右の一覧に出ます。
ダブルクリックか **追加** でラックに入れます。
ほかの場所にあるものは **ファイルから...** で入れます。
- ラックのプラグインの MIDI ポートは、ポートマップ設定でほかの MIDI デバイスと同じように選べます。
一覧では、プラグインに印が付きます。
- プラグインを右クリックすると、エディタを開く・名前を変える・読み込み直す・削除する、が出ます。
名前を変えても、ポートマップの割り当てはそのまま付いていきます。
- エディタで変えた設定は、ラックと一緒に自動で保存されます。
- Glosa と違うアーキテクチャのプラグインも使えます(Windows の x64 版では 32 ビットのプラグインなど)。
- 設定の **オーディオ出力** で、出力デバイス・サンプリングレート・バッファの長さを選べます。
複数同時に読み込むとエラーになるプラグインがあるときは、**プラグインを1つずつ読み込む** を入れます。
- どれかのポートマップでプラグインを使っていると、シークバーの上にマスターボリュームが出ます。
プラグインの音だけに効きます。

### 曲を追加して演奏する

- 曲は **ファイル** メニューか、ウィンドウへのドロップで追加します。
Expand Down Expand Up @@ -162,6 +182,8 @@ Linux ~/.config/glosa/

- `settings.yaml` — 設定
- `playlists\*.yaml` — プレイリスト(1 つにつき 1 ファイル)
- `brack-session.json` — オーディオプラグインのラック(プラグインの設定も含む)
- `brack-plugin-cache.json` — 音源プラグインを探した結果

`--config` を付けて起動すると、代わりにそのフォルダを使います。

Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ It also emulates one module on another, using TMIDI Player's definition files.
Which of these are used, and in what order, is chosen in Preferences. When the names give no answer, the song's MIDI data is looked at too.
- **Port maps** — Connects a different MIDI device to each of the six outputs, ports A to F.
Several arrangements can be kept under their own names, and switched automatically to suit each song's target module.
- **Audio plugins** — CLAP, VST3 and VST2 instrument plugins connect to the ports just as MIDI devices do.
- **Automatic tone map switching** — Plays songs made for older models with that model's tone map.
- With an SC-88 or later as the output module, songs for the SC-55, SC-88 and so on are played with that model's map.
- With an MU100 or later as the output module, songs for the MU50, MU80 and MU90 are played with MU Basic.
Expand Down Expand Up @@ -48,6 +49,7 @@ A song written for a different module is played with the differences converted (
- On Windows, virtual MIDI ports such as loopMIDI can be used.
- On macOS, the IAC Driver in Audio MIDI Setup and the virtual ports software synthesizers create can be used.
- On Linux, ALSA sequencer ports can be used (USB MIDI devices, ports software synthesizers create, and Midi Through).
- Or CLAP, VST3 and VST2 instrument plugins ([Audio plugins](#audio-plugins))

No .NET runtime is needed (the release carries its own).

Expand Down Expand Up @@ -89,6 +91,24 @@ Which map is used is chosen in **Settings → Port Map**. "Auto" picks one for e

<img src="images/port-map-settings.png" width="560" alt="Port Map Settings: a map for the MU2000, used for songs whose target module is the MU2000, MU1000 or MU128">

### Audio plugins

**Settings → Audio Plugins...** sets up the rack of instrument plugins to use.

- Instruments in the standard CLAP, VST3 and VST2 folders are listed on the right.
A double click or **Add** puts one in the rack.
One kept anywhere else is added with **From File...**.
- The MIDI ports of the plugins in the rack can be chosen in Port Map Settings just like other MIDI devices.
The list marks them as plugins.
- Right-clicking a plugin offers to open its editor, rename it, reload it and remove it.
Port maps follow a renamed plugin.
- What is changed in an editor is saved with the rack.
- Plugins built for another architecture than Glosa's work too (32-bit plugins in the x64 build on Windows, for example).
- **Audio Output** in the settings chooses the output device, the sample rate and the buffer length.
When a plugin fails because several load at once, turn on **Load plugins one at a time**.
- While any port map uses a plugin, a master volume shows above the seek bar.
It acts on the plugins' sound only.

### Adding and playing songs

- Add songs from the **File** menu or by dropping them on the window. Adding an archive or a folder adds all the songs in it.
Expand Down Expand Up @@ -161,6 +181,8 @@ Linux ~/.config/glosa/

- `settings.yaml` — settings
- `playlists\*.yaml` — playlists (one file each)
- `brack-session.json` — the audio plugins' rack, with each plugin's settings
- `brack-plugin-cache.json` — what the search for instrument plugins found

When started with `--config`, that folder is used instead.

Expand Down
38 changes: 36 additions & 2 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,48 @@ the third-party material below, each under its own license.

- **In the source** — code or data that Glosa follows or was generated from.
- **In the published app** — the .NET runtime and the libraries a published Glosa carries
in its `libs` folder.
in its `libs` and `runtimes` folders.

The runtime and two of the libraries carry notices of their own for the material they
The runtime and three of the libraries carry notices of their own for the material they
incorporate; those are reproduced unchanged in the `licenses` folder, beside the Apache
License that abseil-cpp, part of ANGLE, is under.

# In the source

## Brack

Hosts the audio plugins: `Brack.Net.dll`, and in `runtimes` its native library (`brack.dll`
on Windows, `libbrack.dylib` on macOS, `libbrack.so` on Linux) and its plugin hosts
(`brack-host-*`). They incorporate CLAP, the VST 3 pluginterfaces, vst2sdk, r8brain-free-src,
miniaudio, nlohmann/json and Windows MIDI Services' interfaces; their notices are in
`licenses/Brack-THIRD_PARTY_NOTICES.md`, copied from the Brack the app was published with.

<https://github.com/hsshss/brack>

```
MIT License

Copyright (c) 2026 hsshss

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

## rcm2smf

`src/Glosa.Core/Rcp/RcpConverter.cs` follows the Recomposer format as implemented by
Expand Down
10 changes: 10 additions & 0 deletions src/Glosa.App/Glosa.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@
CopyToPublishDirectory="PreserveNewest" ExcludeFromSingleFile="true" />
</ItemGroup>

<!-- Brack's notices, from the checkout or the package the app was published with. -->
<Target Name="CopyBrackNotices" AfterTargets="Publish" Condition="'$(BrackSource)' != ''">
<PropertyGroup>
<_BrackNotices Condition="'$(BrackSource)' == 'Project'">$([System.IO.Path]::GetFullPath('$(BrackProject)/../../../../THIRD_PARTY_NOTICES.md'))</_BrackNotices>
<_BrackNotices Condition="'$(BrackSource)' == 'Package'">$(NuGetPackageRoot)brack.net/$(BrackVersion)/THIRD_PARTY_NOTICES.md</_BrackNotices>
</PropertyGroup>
<Error Condition="!Exists('$(_BrackNotices)')" Text="Brack's THIRD_PARTY_NOTICES.md was not found at $(_BrackNotices)." />
<Copy SourceFiles="$(_BrackNotices)" DestinationFiles="$(PublishDir)licenses\Brack-THIRD_PARTY_NOTICES.md" />
</Target>

<!-- The runtime's own notices, from the runtime pack the app was published with. -->
<Target Name="CopyRuntimeNotices" AfterTargets="Publish" Condition="'$(SelfContained)' == 'true'">
<ItemGroup>
Expand Down
18 changes: 18 additions & 0 deletions src/Glosa.App/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/Glosa.App/Strings.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
<data name="AudioPluginsLoad" xml:space="preserve">
<value>CPU</value>
</data>
<data name="AudioPluginsLoadSerially" xml:space="preserve">
<value>プラグインを1つずつ読み込む</value>
</data>
<data name="AudioPluginsLoadSeriallyTip" xml:space="preserve">
<value>複数同時に読み込むとエラーになるプラグインのための設定です。チェックを入れると、ラックのプラグインを1つずつ読み込みます。読み込みは遅くなります。Glosa を次に起動したときから効きます。</value>
</data>
<data name="AudioPluginsLoadTip" xml:space="preserve">
<value>プラグインが音を作るのにかかった時間の割合です。100%に近づくと音が途切れます。</value>
</data>
Expand Down
6 changes: 6 additions & 0 deletions src/Glosa.App/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@
<data name="AudioPluginsLoad" xml:space="preserve">
<value>CPU</value>
</data>
<data name="AudioPluginsLoadSerially" xml:space="preserve">
<value>Load plugins one at a time</value>
</data>
<data name="AudioPluginsLoadSeriallyTip" xml:space="preserve">
<value>For plugins that fail when several of them load at once. When on, the rack's plugins load one after another, which takes longer. Takes effect the next time Glosa starts.</value>
</data>
<data name="AudioPluginsLoadTip" xml:space="preserve">
<value>The share of the time the plugins take to render. Near 100%, the sound breaks up.</value>
</data>
Expand Down
Loading
Loading