abcjs: an in-browser abc renderer

Oxymorons "R" Us
Forum rules
Please see forum announcement for description and rules!
User avatar
fearfaoin
Posts: 7975
Joined: Thu Oct 16, 2003 10:31 am
antispam: No
Location: Raleigh, NC
Contact:

Re: abcjs: an in-browser abc renderer

Post by fearfaoin »

Awesome. This is exactly the sort of thing I was
thinking of trying but didn't have the plugin skillz
to pull off.

hans, looks like a good start to the wiki you were
talking about a few months back! For some reason
the MIDI speed changer doesn't work for me,
though... Is that functional yet? (Firefox 3.6 on XP,
Quicktime plugin is playing the MIDI within the
browser)
User avatar
hans
Posts: 2259
Joined: Fri Nov 01, 2002 6:00 pm
antispam: No
Please enter the next number in sequence: 8
Tell us something.: I've been making whistles since 2010 in my tiny workshop at my home. I've been playing whistle since teenage times.
Location: Moray Firth, Scotland
Contact:

Re: abcjs: an in-browser abc renderer

Post by hans »

fearfaoin wrote:hans, looks like a good start to the wiki you were
talking about a few months back! For some reason
the MIDI speed changer doesn't work for me,
though... Is that functional yet? (Firefox 3.6 on XP,
Quicktime plugin is playing the MIDI within the
browser)
Are you installing the plugin on a PmWiki system of your own, or do you mean it does not work on my demo?
If you are installing new, you won't have the abcjs version I am using, because I got from Greg a pre-release version, which has the extra hooks and midi options I was asking for. My demo is ahed of the times!

If it is on my site: make sure you press the Select button. This will save the choosen option to the page, and the page reloads and the midi will get redone using the new value. You need to be logged in in order to do that. There is no 'instant' way of changing the tempo, but we can feed a value to the abcjs midi-writing component.
User avatar
Cathy Wilde
Posts: 5591
Joined: Mon Oct 20, 2003 4:17 pm
antispam: No
Please enter the next number in sequence: 8
Location: Somewhere Off-Topic, probably

Re: abcjs: an in-browser abc renderer

Post by Cathy Wilde »

Just finished my first attempt at notating and editing an entire tune in ABCJS editor -- and an especially snarly tune at that -- and have to say it was just grand; almost seamless. The joys of instant notation :-)

I ESPECIALLY love the highlight feature that shows you where you are in the tune. Little things like that are a big help when you're deep in the ABC weeds.

And thanks for the "Q-tip"! I always forget to include that field; it worked a treat.

Two :thumbsup: :thumbsup: !
Deja Fu: The sense that somewhere, somehow, you've been kicked in the head exactly like this before.
User avatar
fearfaoin
Posts: 7975
Joined: Thu Oct 16, 2003 10:31 am
antispam: No
Location: Raleigh, NC
Contact:

Re: abcjs: an in-browser abc renderer

Post by fearfaoin »

hans wrote:If it is on my site: make sure you press the Select button. This will save the choosen option to the page, and the page reloads and the midi will get redone using the new value. You need to be logged in in order to do that. There is no 'instant' way of changing the tempo, but we can feed a value to the abcjs midi-writing component.
On your site, I click on the slowest setting,
click the Select button, the page reloads,
Quicktime plugin takes a second to reload
the MIDI. Same speed as before. I've tried
each of the RadioButtons, and always the
speed is as if generated with "Q: 200".

I'm not sure if it's supposed to, but the line
"slow - - - - - 1 - - - fast" doesn't change
either after the Select click. Nor does the
yellow highlighted background around the
middle RadioButton.
User avatar
hans
Posts: 2259
Joined: Fri Nov 01, 2002 6:00 pm
antispam: No
Please enter the next number in sequence: 8
Tell us something.: I've been making whistles since 2010 in my tiny workshop at my home. I've been playing whistle since teenage times.
Location: Moray Firth, Scotland
Contact:

Re: abcjs: an in-browser abc renderer

Post by hans »

I can only think that you may not have used 'login' with password on the index page.
I changed the display now, so one won't see the option to change tempo unless logged in.

The tempo changer is rather rudimentary, the text above does not change, nor the yellow highlight of what is factor 1, i.e. "default". But the quarters per minute number does change.

Perhaps there is another bug somewhere though, if you can't get it going.
Tamadden
Posts: 186
Joined: Sun Mar 17, 2002 6:00 pm

Re: abcjs: an in-browser abc renderer

Post by Tamadden »

Android App please!
User avatar
fearfaoin
Posts: 7975
Joined: Thu Oct 16, 2003 10:31 am
antispam: No
Location: Raleigh, NC
Contact:

Re: abcjs: an in-browser abc renderer

Post by fearfaoin »

Tamadden wrote:Android App please!
You can't use it from the browser?
Tamadden
Posts: 186
Joined: Sun Mar 17, 2002 6:00 pm

Re: abcjs: an in-browser abc renderer

Post by Tamadden »

fearfaoin wrote:
Tamadden wrote:Android App please!
You can't use it from the browser?
Not sure how I'd manage tune libraries on the phone - hoping an app would solve that.
User avatar
hans
Posts: 2259
Joined: Fri Nov 01, 2002 6:00 pm
antispam: No
Please enter the next number in sequence: 8
Tell us something.: I've been making whistles since 2010 in my tiny workshop at my home. I've been playing whistle since teenage times.
Location: Moray Firth, Scotland
Contact:

Re: abcjs: an in-browser abc renderer

Post by hans »

Tamadden wrote:
fearfaoin wrote:
Tamadden wrote:Android App please!
You can't use it from the browser?
Not sure how I'd manage tune libraries on the phone - hoping an app would solve that.
The library is on the server, and you manage it through the browser. That's what a wiki is for. I am curious as to how my demo wiki looks on a handheld device, I've never seen it.
User avatar
s1m0n
Posts: 10069
Joined: Wed Oct 06, 2004 12:17 am
antispam: No
Please enter the next number in sequence: 10
Location: The Inside Passage

Re: abcjs: an in-browser abc renderer

Post by s1m0n »

Is this something that could be installed to run on this forum, so that any valid abc that gets posted (for instance this) would automatically show up in dot, as well? That would be very very cool.
And now there was no doubt that the trees were really moving - moving in and out through one another as if in a complicated country dance. ('And I suppose,' thought Lucy, 'when trees dance, it must be a very, very country dance indeed.')

C.S. Lewis
User avatar
hans
Posts: 2259
Joined: Fri Nov 01, 2002 6:00 pm
antispam: No
Please enter the next number in sequence: 8
Tell us something.: I've been making whistles since 2010 in my tiny workshop at my home. I've been playing whistle since teenage times.
Location: Moray Firth, Scotland
Contact:

Re: abcjs: an in-browser abc renderer

Post by hans »

It would be cool, and it is possible by adding a line of code to the header template of a standard forum page, which loads the abcjs plugin script. An easy change, but it means the script gets loaded all the time when a page gets viewed. Still, once loaded, a browser should/would cache it.

-----------------

I've updated the PmWiki AbcTunebook add-on, and also my AbcTunebook demo wiki.
Midi playback is improved, and different default speeds for different rhythm types selected automatically. Tune display is improved by showing the score and hiding the abc, making it visible with a click.
User avatar
s1m0n
Posts: 10069
Joined: Wed Oct 06, 2004 12:17 am
antispam: No
Please enter the next number in sequence: 10
Location: The Inside Passage

Re: abcjs: an in-browser abc renderer

Post by s1m0n »

Is it something I can make Opera load as a plug in, so the same happens whenever I render a page with valid abc? How would I go about that?
Last edited by s1m0n on Thu Jun 03, 2010 4:47 am, edited 1 time in total.
And now there was no doubt that the trees were really moving - moving in and out through one another as if in a complicated country dance. ('And I suppose,' thought Lucy, 'when trees dance, it must be a very, very country dance indeed.')

C.S. Lewis
User avatar
hans
Posts: 2259
Joined: Fri Nov 01, 2002 6:00 pm
antispam: No
Please enter the next number in sequence: 8
Tell us something.: I've been making whistles since 2010 in my tiny workshop at my home. I've been playing whistle since teenage times.
Location: Moray Firth, Scotland
Contact:

Re: abcjs: an in-browser abc renderer

Post by hans »

s1m0n wrote:Is it something I can make Opera load as a plug in, so the same happen whenever I render a page with valid abc? How would I go about that?
Nice idea! I just tried it, and it works!
Here is some documentation about Opera userjavascript:
http://www.opera.com/docs/userjs/using/#whatcando
"To enable user JavaScript, use Settings > Preferences > Advanced > Content > JavaScript options, and select the directory where you will put your User JavaScript files. Opera will load all files in the specified directory whose names end with .js and will use them as User JavaScript files."

Go to http://code.google.com/p/abcjs/, download abcjs_plugin_1.0.2-min.js (or whatever latest abcjs_plugin file is listed), and copy it to the directory for your Opera user javascript files you've set in opera with the step above.

That's it! Try viewing a page with abc notation. The notation must have an X: field.

Note that javascripts added to the Opera javascript folder will always load, for all sites, all pages. If you want to restrict the scope of the abcjs_plugin script to the C&F forums for instance, you need to edit it in a text editor, and add something like this to the top, before the comments of the script:

Code: Select all

 // ==UserScript==
// @include http://forums.chiffandfipple.com/*
// ==/UserScript==
You can have several lines with @include ... and @exclude .... expressions.
User avatar
s1m0n
Posts: 10069
Joined: Wed Oct 06, 2004 12:17 am
antispam: No
Please enter the next number in sequence: 10
Location: The Inside Passage

Re: abcjs: an in-browser abc renderer

Post by s1m0n »

Wow! That was totally painless and easily accomplished in less than a minute. Folks, you should all do this.

Here's how it looks:

Image
And now there was no doubt that the trees were really moving - moving in and out through one another as if in a complicated country dance. ('And I suppose,' thought Lucy, 'when trees dance, it must be a very, very country dance indeed.')

C.S. Lewis
User avatar
hans
Posts: 2259
Joined: Fri Nov 01, 2002 6:00 pm
antispam: No
Please enter the next number in sequence: 8
Tell us something.: I've been making whistles since 2010 in my tiny workshop at my home. I've been playing whistle since teenage times.
Location: Moray Firth, Scotland
Contact:

Re: abcjs: an in-browser abc renderer

Post by hans »

Simon, did you get a midi player? I can't see it in the screenshot.
It needs a quicktime plugin installed/enabled.

If everybody wants to see abc rendered as score instantly in this forum, it would make more sense to load the script via the forum template.

I tried to load the script in Firefox via the GreaseMonkey addon, but failed so far. It needs some changes to run outside GreaseMonkey's security sandbox, I guess, and I could not figure out which.
Post Reply