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

Questions about the API for Score Format Plugins #7

Open
blueapple25130 opened this issue Sep 25, 2017 · 4 comments
Open

Questions about the API for Score Format Plugins #7

blueapple25130 opened this issue Sep 25, 2017 · 4 comments

Comments

@blueapple25130
Copy link

blueapple25130 commented Sep 25, 2017

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)

@hozuki
Copy link
Owner

hozuki commented Sep 26, 2017

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.

@hozuki
Copy link
Owner

hozuki commented Sep 26, 2017

BTW, thanks.

@blueapple25130
Copy link
Author

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

@hozuki
Copy link
Owner

hozuki commented Oct 15, 2017

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.

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

2 participants