hozuki / MilliSim

Extensible simulator for THE iDOLM@STER Million Live! Theater Days / アイドルマスターミリオンライブ!シアターデイズ用の拡張可能なシミュレーター / 可扩展的偶像大师百万现场剧场时光模拟器

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Questions about the API for Score Format Plugins

blueapple25130 opened this issue · comments

Looking at the current MilliSim API for Score Format Plugins,
the compiler seems to compile MilliSim.SourceScore into MilliSim.RuntimeScore.

I think that the feature should be in MilliSim and not neccessary for external plugins.

[Example: flow of compile with external plugin]

1. (plugin).ScoreReader.ReadAsSourceScore
  (something source file)
    -> (plugin).SourceScore
  (convert by (plugin).Extensions.ToMilliSimSourceScore)
    -> MilliSim.SourceScore
  
2. (plugin).ScoreCompiler.Compile
  (MilliSim.SourceScore)
    -> MilliSim.RuntimeScore

(the 2nd process is unnecessary for external plugin)

Yes, this is a problem in current IScoreCompiler design.

I abstracted IScoreCompiler in order to provide an open access to SourceNote and RuntimeNote. It is reserved for the ExtraProperties property on SourceNote and RuntimeNote. This property is not placed yet. It would be of type Dynamic, to store custom information on ordinary notes. For example, note attribute, custom command, etc. This feature should be used with custom Elements, to achieve those effects in Deleste, or something like this.

However the basic compile methods are quite the same, so I think these methods can be wrapped in a helper class instead of making everyone copy the code. A custom IScoreCompiler just need to call the methods to create a basic RuntimeNote (with timing info, etc.) and then fill in compiler-specific properties if there is any.

Right now I'm solving other bugs. I'll see if I can make this change in a few days.

BTW, thanks.

I don't think it's any need to publish the compilation procedure externally. (-> IScoreCompiler.Compile)
Simply, just read and compile inside the plugin and match it to MilliSim formats.
figure2

Something happened two weeks ago so I disappeared from GitHub for two weeks.

Anyway, here the point. The compiler design is preserved for score format exchange. It works like this:

image

The exchange I talked about:

image

I wrote a small example: here.