This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

ABC Notation

Description

This includes the abcjs system on your WordPress site. To produce sheet music, put a valid ABC Notation string between the shortcodes [abcjs] and [/abcjs] on your page or post.

This also generates MIDI by using the shortcode [abcjs-midi] and can produce both visual and audio music that is coordinated with [abcjs-audio].

Thanks

Special thanks to http://www.beliefmedia.com/ for the idea to load the ABC string from a file, and for the idea to conditionally load the javascript only if there is a shortcode on the page.

Screenshots

  • An example of a shortcode and the resultant music that is produced.

Installation

  1. Upload this folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Click ‘Settings’ in the dashboard, then ‘ABC Notation’ to customize.

FAQ

Where can this be used?

Anywhere that shortcodes are accepted. That is, on pages, post, and widgets. It will not work on comments.

How does it work?

The plugin includes the abcjs JavaScript library. The string that is put in the shortcode is passed to that library, which translates it and renders it in an SVG element that it places on the page instead of the shortcode.

What can be put in the ABC string that is placed in the shortcode?

There is much written about ABC Notation around the web. You can start here

What parameters may be used?

The shortcode can take the same parameters as abcjs. See the documentation for details.

There is also an interactive way to play with the parameters: Configurator.

Here are some examples:

To make the music responsive:
[abcjs engraver="{ responsive: 'resize' }"]
... some ABC string ...
[/abcjs]

To set or override the tempo:
[abcjs-midi midi="{ qpm: 150 }"]
... some ABC string ...
[/abcjs-midi]

List of parameters to the [abcjs] shortcode:

[abcjs class="abc-paper"] etc... [/abcjs] puts the named class on the generated `<svg>` element.

[abcjs options="{}"] etc... [/abcjs] passes the javascript objects straight through to `abcjs.renderAbc`. See the abcjs documentation for details. Note that you need to put quotes around the the options parameter.

[abcjs file="https://url/to/abc/file"] loads the string from the specified file instead of the embedded string. You can upload this file using Add New Media or it can reside in any publicly available place.

[abcjs number_of_tunes=2] if there are more than one tune in the ABC string, this specifies how many should be printed out. If this is set to more than the number of tunes in the string, that's ok, the additional places are ignored, so if you want to be sure you have all the tunes, then use a high number for this.

List of parameters to the [abcjs-midi] shortcode:

[abcjs-midi class="abc-paper"] etc... [/abcjs-midi] puts the named class on the generated MIDI element.

[abcjs-midi parser="{}" midi="{}"] etc... [/abcjs-midi] passes the javascript objects straight through to `abcjs.renderMidi`. See the abcjs documentation for details.

[abcjs-midi file="https://url/to/abc/file"] etc... [/abcjs-midi] loads the string from the specified file instead of the embedded string. You can upload this file using Add New Media or it can reside in any publicly available place.

[abcjs-midi number_of_tunes=2] etc... [/abcjs-midi] if there are more than one tune in the ABC string, this specifies how many should be printed out. If this is set to more than the number of tunes in the string, that's ok, the additional places are ignored, so if you want to be sure you have all the tunes, then use a high number for this.

List of parameters to the [abcjs-audio] shortcode:

[abcjs-audio class-paper="abcjs-paper"] etc... [/abcjs-audio] puts the named class on the generated `<svg>` element.

[abcjs-audio class-audio="abcjs-audio"] etc... [/abcjs-audio] puts the named class on the generated MIDI element.

[abcjs-audio params="{}"] etc... [/abcjs-audio] passes the javascript objects straight through to `abcjs.renderAbc` and `abcjs.renderMidi`. See the abcjs documentation for details.

[abcjs-audio file="https://url/to/abc/file"] etc... [/abcjs-audio] loads the string from the specified file instead of the embedded string. You can upload this file using Add New Media or it can reside in any publicly available place.

[abcjs-audio number_of_tunes=2] etc... [/abcjs-audio] if there are more than one tune in the ABC string, this specifies how many should be printed out. If this is set to more than the number of tunes in the string, that's ok, the additional places are ignored, so if you want to be sure you have all the tunes, then use a high number for this.

[abcjs-audio animate="false"] etc... [/abcjs-audio] If true, this will cause a cursor to follow the music as it is playing.

[abcjs-audio qpm="undefined"] etc... [/abcjs-audio] If this is present, then it sets the beats per minute. If is not set, then the beats per minute is set by the `Q:` line in the ABC string.

Help! Some characters are not printing properly.

Use the “shortcode block” type block in the page editor. That will help keep the quotation marks and any other interpreted characters from being changed by WordPress.

I can’t upload `.abc` files in the media library.

This plugin uses the upload_mimes filter to allow files with the extension .abc to be uploaded. However, there are some other plugins that can cause this to break. If you get the security warning when trying to upload a file, try disabling other plugins to see if the problem goes away. You may be able to narrow down the problem.

If you can’t easily work around that, you can change the file extension to .txt.

Reviews

September 19, 2022
Thanks for the great job! looking forward to 7.0
September 28, 2020
I’ve used Paul Rosen’s ABCJS tools elsewhere for several years and it’s great to see this is also available as a Wordpress plugin. Really useful for anyone interested in Irish traditional music (as well as other forms) for posting music notation as part of their site. I’m currently using it with 5.5.1 with no problems.
March 7, 2018
This plugin is a must have for bloggers who want to display note sheets. Does exactly what I was looking for. Saves me a lot of time.
August 28, 2017
Exactly what I was looking for! There was a small problem with the rendering (only in german user interface), but the developer helped quickly! An idea for the next version: It would be nice if the tunes could also be played.
September 3, 2016
Das Plugin ist im Grunde genial. Es stellt Noten brilliant dar, wie man es sich nicht besser wünschen könnte. Leider mit einem kleinen Schönheitsfehler: Das Plugin, vielmehr die daraus resultierenden Notendarstellungen, sind NICHT responsive. Und damit ist das Plugin aus meiner sicht nur sehr eingeschränkt nutzbar. Schade, denn es gibt kein anderes Plugin, was das kann.
Read all 5 reviews

Contributors & Developers

“ABC Notation” is open source software. The following people have contributed to this plugin.

Contributors

Translate “ABC Notation” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.12

  • Initial version of this plugin. (Version numbers are in sync with the version of abcjs that is included.)

2.0

  • Upgrade abcjs version.

2.1

  • Upgrade abcjs version.

2.3

  • Upgrade abcjs version. See https://github.com/paulrosen/abcjs for details.

2.3.1

  • Added entry point for creating MIDI downloads.
  • Tested through WP 4.4.

3.1.3

  • Upgrade to use the abcjs 3.1.3 code.
  • Add „ as one of the smart quotes.

3.1.4

  • Add parameter to do responsiveness.

3.2.0

  • Add overlay feature
  • Bug fixes
  • Upgrade to use the abcjs 3.2.0 code.

3.2.1

  • Fix crash when window.performance is not available.
  • Fix placement of rests when the stem direction is forced.
  • Upgrade to use the abcjs 3.2.0 code.

3.3.0

  • Upgrade to use the abcjs 3.3.0 code.

3.3.2

  • Upgrade to use the abcjs 3.3.2 code.
  • Add “file” parameter to get the ABC from a separate file.
  • Allow files with the extension “.abc” to be uploaded in Add Media.
  • Add the “number_of_tunes” parameter to allow more than one tune to be displayed.

3.3.4

  • Upgrade to use the abcjs 3.3.4 code.

4.1.0

  • Upgrade to use the abcjs 4.1.0 code.

5.0.0

  • Upgrade to use the abcjs 5.0.0 code.

5.8.1

  • Upgrade to use the abcjs 5.8.1 code.
  • Add entry point to draw music and audio and animate the audio.

6.1.1

  • Upgrade to use the abcjs 6.1.1 code.

6.1.3

  • Upgrade to use the abcjs 6.1.3 code.