I have been looking for ages for a suitable music renderer to use with Android, I looked at ABC4j, but it is built for Swing views and is not an easy port for Android.
I recently came across ABC for Javascript, which works surprisingly well with the WebView, and was not quite as bad to implement as I thought it might be, especially as I know very little about javascript.
There are two demo's, the first is for displaying snippets of music in an app using a WebView as part of the layout, the second is a simple ABC book reader.
ABC format music books are available all over the internet.
The first demo uses standard B4a libraries, but if you are having trouble getting some music to display, I suggest you download and enable Martin's WebViewExtras Library, specifically enable the ChromeClient, as it enables error logging from the Javascript on the WebView.
The second demo requires Martin's WebViewExtras Library, as there is two way communication between the Javascript and the android app.
The ABC music format takes some getting used to, but the output it provides is well worth the time take to learn the basics.
The MidiRenderer part of the library will not work with android as it uses an external plugin (but now see Andrews post below). I might get round to looking at the possibility of getting it just return a midi file when I get some more spare time.
There are two external Javascript libraries included in both demo's. The first is the ABCJS library (GNU GENERAL PUBLIC LICENSE Version 3), and the second is a Base64 encoder/decoder library from CodePlex (Apache 2.0 License)
Depends On: WebViewExtras
Additional Info / Reading:
ABC Javascript Library source and download : https://code.google.com/p/abcjs/downloads/list
Base64 javascript decoder library : http://jsbase64.codeplex.com/
Useful ABC Javascript specific info: https://code.google.com/p/abcjs/wiki/InstallationDocumentation
Main ABC Notation Wiki : http://abcnotation.com/wiki/abc:standard:v2.1#abc_file_structure
I hope you enjoy these examples.
I recently came across ABC for Javascript, which works surprisingly well with the WebView, and was not quite as bad to implement as I thought it might be, especially as I know very little about javascript.
There are two demo's, the first is for displaying snippets of music in an app using a WebView as part of the layout, the second is a simple ABC book reader.
ABC format music books are available all over the internet.
The first demo uses standard B4a libraries, but if you are having trouble getting some music to display, I suggest you download and enable Martin's WebViewExtras Library, specifically enable the ChromeClient, as it enables error logging from the Javascript on the WebView.
The second demo requires Martin's WebViewExtras Library, as there is two way communication between the Javascript and the android app.
The ABC music format takes some getting used to, but the output it provides is well worth the time take to learn the basics.
The MidiRenderer part of the library will not work with android as it uses an external plugin (but now see Andrews post below). I might get round to looking at the possibility of getting it just return a midi file when I get some more spare time.
There are two external Javascript libraries included in both demo's. The first is the ABCJS library (GNU GENERAL PUBLIC LICENSE Version 3), and the second is a Base64 encoder/decoder library from CodePlex (Apache 2.0 License)
Depends On: WebViewExtras
Additional Info / Reading:
ABC Javascript Library source and download : https://code.google.com/p/abcjs/downloads/list
Base64 javascript decoder library : http://jsbase64.codeplex.com/
Useful ABC Javascript specific info: https://code.google.com/p/abcjs/wiki/InstallationDocumentation
Main ABC Notation Wiki : http://abcnotation.com/wiki/abc:standard:v2.1#abc_file_structure
I hope you enjoy these examples.
Attachments
Last edited: