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

Function for modifying BMS? #493

Open
xxbidiao opened this issue Jul 31, 2018 · 5 comments
Open

Function for modifying BMS? #493

xxbidiao opened this issue Jul 31, 2018 · 5 comments

Comments

@xxbidiao
Copy link

xxbidiao commented Jul 31, 2018

I would like to know whether there is a way to use the BMS to generate a modified BMS. That is, on a parsed (edit:clarification) BMSChart, I would like to modify the information of notes like changing the column it belongs to, then write it back to a new BMS file.

If there is one, would you mind letting me know about how I should do that?
If there isn't, what's your suggestion on a library that allows me to do this?

Thanks!

@dtinth
Copy link
Member

dtinth commented Jul 31, 2018

Hello, as of right now, bms-js is only a parser. It is not yet capable of generating BMS files, and there is no plan for the main Bemuse project to support the generation of BMS files right now.

I think it is possible to generate a BMS file from a BMSChart since it retains most information, except for comments and #RANDOM (which is executed at compile-time), but you might have to write that code yourself.

So far, I am not yet aware of any library that can produce BMS files. Sorry.

When I have to modify a BMS file programmatically, usually I open the BMS in the editor, and modify the clipboard data. (iBMSC and BMSE uses plain text for clipboard data.) I find it easier to work with.

@xxbidiao
Copy link
Author

Thanks! Good to know that #RANDOM is pre-compiled. Does that means that #RANDOM will cause the chart to be compiled differently each time I compile it, and it is not transparent to me?

My usecase is just about playing a modified chart (not exactly looking for generating a BMS for use on other things like LR2), so my plan is to just modify the internal format that Bemuse uses so that it can play the modified BMS. Does bemuse have a specification of its own file format so that I can generate one by myself?

@dtinth
Copy link
Member

dtinth commented Jul 31, 2018

Hi, by default, yes, the chart will be compiled differently each time. There is, however, an rng compile option which allows you to supply your own random number generator.

In Bemuse, notecharts are read directly from BMS/bmson files without an intermediate file format. The loading logic is specified in bemuse-notechart package. If you want to modify a chart, maybe a JSON-based format such as bmson may work better for your use case?

@xxbidiao
Copy link
Author

That's nice! bmson seems to be a viable option. I'm already using bms package for the parsing and object manipulation purposes, do bmson package have similar features so that I can verify whether I created a valid bmson file?

@dtinth
Copy link
Member

dtinth commented Aug 4, 2018

@xxbidiao We don’t have a formal schema for bmson yet. The bmson package exports several functions which returns, e.g. BMS.Notes object. You can use it to compare the result.

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