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

Use midi-file instead of midi-parser-js #165

Merged
merged 14 commits into from
May 21, 2024

Conversation

sevenc-nanashi
Copy link
Contributor

@sevenc-nanashi sevenc-nanashi commented May 20, 2024

I changed to use midi-file instead of midi-parser-js, because:

I tested and it worked for both standard midi and vocaloid midi.

@sdercolin
Copy link
Owner

Could you check the build error first?

@sevenc-nanashi
Copy link
Contributor Author

Oh, I forgot to test ui. I'll fix

@sdercolin sdercolin force-pushed the develop branch 3 times, most recently from 135e172 to f0c857f Compare May 21, 2024 14:46
@sdercolin
Copy link
Owner

Looks like the yarn lock file still contains a lot of unrelated changes, could you try remove that file and run the upgrade task again?

@@ -25,11 +24,8 @@ object StandardMid {

suspend fun parse(file: File): Project {
val midi = Mid.parseMidi(file)
if (midi == false) {
throw IllegalFileException.IllegalMidiFile()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does the new library handle unexpected input?
If it throws an error, we could catch it and rethrow the IllegalFileException.IllegalMidiFile() with the original error as the cause (passed by constructor)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it throws string (not Error). I changed to catch dynamic so that the error will be handled

Copy link
Owner

@sdercolin sdercolin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Let's wait for the CI

@sdercolin
Copy link
Owner

Oh, please cherry-pick this commit: d39db5f

@sevenc-nanashi
Copy link
Contributor Author

Done.

@sdercolin sdercolin changed the title Change: Use midi-file instead of midi-parser-js Use midi-file instead of midi-parser-js May 21, 2024
@sdercolin sdercolin merged commit 00b60cd into sdercolin:develop May 21, 2024
1 check passed
sdercolin added a commit that referenced this pull request Jul 6, 2024
* Bump up version

* Create core module

* Move files

* Add some JsExport

* Add: Support analysis for lyrics with suffix

* Add functions for TS library (#164)

* Change: Use Array for better typing

* Add: Add generate functions

* Add: Add ability to build minimum core

* Add: Add wrapper

* Add: Add test

* Improve: gradlew test will run deno test

* Add: Add missing keys

* Change: Create documentToUfData / ufDataToDocument

* Fix: Fix name shadowing

* Add: Add 10 tracks test

* Change: Create project data

* Add: add parseFile and toFile

* Add: Add fromAny

* Add: Add convertJapaneseLyrics

* Add: Add ust

* Delete: Delete deno things

* Delete: Delete unused gitignore#

* Change: DocumentContainer -> ProjectContainer

* Change: Use KDoc

* Change: Use internal to hide error

* Change: Rename convertJapaneseLyrics

* Change: Change visibility

* Revert: webpack.config.d was required

* Fix resources resolve

* Use midi-file instead of midi-parser-js (#165)

* Change: Use midi-file

* Fix: Fix importing assets

* Fix: Run kotlinUpgradeYarnLock

* Fix: Fix resolver

* Change: Make ESModule conditional

* Delete: Delete workaround

* Delete: Delete unused dependency

* Revert: Re-add workaround

* Revert: Revert unrelated changes

* Update: Update yarn.lock

* Change: Re-throw error

* Fix: Fix error

* Fix: It throws string, not an Error

* Fix tasks about resources copy

---------

Co-authored-by: colin.weng <[email protected]>

* Export exceptions to JS (#167)

* Update Russian translation (#168)

* Change: Don't remove "っ" by default (#169)

* Change: Don't remove "っ" by default

* Delete: Why is there a new line?

* Allow specifying default lyrics via ImportParams (#170)

* Add: Allow specifying default lyrics via ImportParams

* Code: gradlew ktlintFormat

* Update: Update Format.kt

* Allow specifying ImportParams from JS, and export pitches (#171)

* Add: Support tssln (#172)

* Add: Support importing tssln

* Add: Add basic export

* Code: gradlew ktlintFormat

* Change: Use yarn

* Update: Update texts for tssln (#174)

* Update: Update texts

* Update: kotlinUpgradeYarnLock

* Fix: Fix around esm import

* Code: Format

* Export tssln to JS (#175)

* Add: Export tssln

* Change: Use val

* Fix some issues (#176)

* Fix: Fix some minor issues

* Add: Add comment

* Fix: Fix loading tssln from VST (#177)

* Fix: Fix loading tssln from VST

* Code: gradlew ktlintFormat

---------

Co-authored-by: sevenc-nanashi <[email protected]>
Co-authored-by: colin.weng <[email protected]>
Co-authored-by: Dmitry Kiryanov <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants