53

I know on the Guitars site (soon to be merged with this one), JTab was used for rendering tablature notation (see). For those not familiar with it, tab (tablature) is a simplifed music notation specifically for guitar playing.

Question 1: Will JTab be implemented here? It has been!
Question 2: What other music notation will be implemented?

8
  • JTab could be useful in some cases -- especially if the Guitars site is merged, which I hope it will be -- but we definitely need a good way of representing sheet music and individual notes.
    – user28
    Apr 26, 2011 at 20:11
  • 4
    vexflow.com seems promising as it's open source and supports html5, canvas and SVG. The image you see is actually rendered in your browser ;)
    – Stormenet
    Apr 26, 2011 at 20:48
  • 9
    @Stormenet, the VexFlow page says it is pre-pre-pre-alpha. That would make me a bit nervous. Apr 26, 2011 at 21:05
  • 1
    @Rebecca, good point. Some further searching lead me to drawthedots.com/abcjs which seems more mature and I like how the editor colors the current note where your cursor is at red.
    – Stormenet
    Apr 26, 2011 at 21:11
  • @Stormenet that's so awesome. I hope they polish it up soon so we can use it. May 5, 2011 at 1:41
  • 4
    Good question. I'd certainly like to see the standard notation supported here; it's almost as important as LaTeX is to mathematicians/physicists in discussions!
    – Noldorin
    May 6, 2011 at 12:36
  • Suggestion to developers: As some of the images below seem to be too width, it could be handy to use Lightbox to show the music in it's full resolution. Or perhaps, implement this cross-site as I believe there are more screenshots that could benefit from being clicked on... :) May 9, 2011 at 13:40

7 Answers 7

29

I know about Lilypond, which is a kind of LaTeX for music notation, but I don't think it exists in markup version for use on webpages.

"Music markup" is also of interest. Now, if they don't have one, I don't see where we are gonna find such a markup language.

Here are some Lilypond examples:

Jesu, meine Freunde

Goyescas

code example 1a

code example 1b

Lilypond's "Beautiful examples" and "“Compiling” Music" are useful. Also see the "Template section" of the online manual for more complex examples.

16
  • 8
    Just invoking lilypond --jail -fpng some_source.ly would produce a PNG output.
    – Benoit
    Apr 29, 2011 at 7:00
  • True, it would be no problem to include images this way. Apr 29, 2011 at 8:26
  • @Raskolnikov: How do you include an image on the stack exchange question?
    – iddober
    May 2, 2011 at 14:23
  • 2
    @idober: Use the markup ![image description](image URI). There's a handy button in the editor to automatically do this and handle file uploads, as well.
    – user28
    May 2, 2011 at 15:48
  • 3
    Of course, we shouldn't ask users to upload their own images - what kind of professional musician site would this be? I like this idea best, as Lilypond is far more powerful than anything else available, and it has a nice syntax - the fact that it looks like TeX means we could have a consistent-looking syntax across sites. The only problem is, will StackExchange allow the notation to be parsed and the image generated server-side? I guess it depends on the resources Lilypond requires... May 4, 2011 at 16:31
  • LilyPond is probably much more well known than ABCjs, although it is not for editing music but more for high quality sheet music that will not change much. But either way, I think a most basic WYSIWYG is going to the primary deciding factor. May 6, 2011 at 18:49
  • 1
    @Raskolnikov: Could you include the most relevant Lilypond examples pictures in your post? Alongside an example to make one of them, it could give a better impression. :) May 8, 2011 at 19:47
  • I'm not sure how easy it would be to implement the engraver in JAX. My (limited) understanding of Lilypond is that the optimization of placement of note heads etc can be quite involved. Maybe it is something we (or StackExchange) can contact the Lilypond developers about? May 9, 2011 at 14:21
  • That's a great idea @Willie! May 9, 2011 at 15:51
  • To make this similar to the ABC post, can you post up the source you used to get those images. ABC seems easy to understand, but I don't know what I would have to learn in order to produce lilypond output
    – Doktor Mayhem Mod
    May 10, 2011 at 9:49
  • You mean the source code? I don't think it's on the site for the images I gave. But there's another page with examples of code. May 10, 2011 at 11:33
  • I also added a link to the online introductory manual containing a template section. May 10, 2011 at 12:24
  • 3
    Check out Bopland.org for an implementation of lilypond rendering which allows for transposition, playback, (via midi) and copying of the notes for every music example. The syntax is quite simple and it would require zero development, since the Bopland service is free and can be called and will render the music, generate the midi and supply play back controls via Javascript. It would only require the addition of a very small javascript on the stack exchange pages. You can see examples of how it works here: my.bopland.org/licks Aug 10, 2011 at 2:10
  • Not sure why this answer has so many upvotes; it doesn't really answer Matthew's question (I'm pretty sure he was requesting [hence the "feature-request" tag] that std. notation be implemented on the SE site).
    – ksoo
    Aug 31, 2013 at 20:15
  • 1
    @AsianSquirrel FYI Mathew was just the most-recent editor of the question. It was Tangurena who asked. Not a big deal. And I'm not picking a fight. :) Sep 15, 2015 at 4:53
17

The best I can find is ABCjs, which uses ABC notation as its input. It's licensed under GPL - I don't know if that will be a problem for you.

Here is an example page utilizing ABCjs, and here are some general examples of ABC notation. It appears that ABCjs can correctly render all the examples

O:I
R:J
X:1
M: 6/8
T:Paddy O'Rafferty
C:Trad.
K:D
dff cee|def gfe|dff ce|dfe dBA|dff cee|def gfe|faf gfe|1 dfe dBA:|2 dfe dcB|]
~A3 B3|gfe fdB|AFA B2c|dfe dcB|~A3 ~B3|efe efg|faf gfe|1 dfe dcB:|2 dfe dBA|]
fAA eAA|def gfe|fAA eAA|dfe dBA|fAA eAA|def gfe|faf gfe|dfe dBA:|

Example output

I should note (hehe) that knowledge of ABC-notation among musicians isn't as widespread as, say, knowledge of TEX among mathematicians. It would be extremely helpful to have an in-browser WYSIWYG editor to go along with this - there's got to be a free one in javascript or java available somewhere...


[Edit] Seeing how many upvotes this has gotten, I'd like to reiterate that Lilypond suggested by Raskolnikov is definitely a better solution... but it will have to be rendered serverside into a png image, not rendered clientside using javascript.

It won't be used nearly as often as the serverside TeX rendering on the math sites was, though - there it is not uncommon to see TeX notation used 10 or more times in one post, while here I would guess the average will be < 1 per post. So, I can't imagine it causing too much stress on the server.

8
  • I tested it a bit. It looks quite simple of use. May 4, 2011 at 17:22
  • I played around with ABC a long time ago. It's definitely one of the easier notations to learn. I think it's quite severely limited in its ability to notate instrument-specific annotations though, and a lot of the questions here probably involve instrument-specific techniques. May 5, 2011 at 1:47
  • @BlueRaja : just to be sure: your source text does not match the result image. The time signature is different.
    – ogerard
    May 5, 2011 at 9:10
  • @ogerard: You're right; fixed. I don't know if my ABC was incorrect or this is an ABCjs bug, but I guess the measure needs to go after the "X" May 5, 2011 at 15:42
  • This looks pretty cool. I would certainly like to see musical markup implemented here.
    – Noldorin
    May 6, 2011 at 12:34
  • Indeed nice, scaled to the post width this should be the clear enough to read. :) May 8, 2011 at 19:45
  • Looks really nice. The "demo" tune at drawthedots.com really showcases the versatility of this suite. It seems pretty fast, too. I don't really see the reason to prefer server-side scripting, and the code looks easier to grok than lilypond (and I use LaTeX!).
    – naught101
    Sep 27, 2012 at 5:56
  • Serverside is definitely better in my opinion (as a professional software developer) where possible. Relying on all client browsers to render complex stuff using JS is far better than it once was, but by no means entirely reliable!
    – Mr. Boy
    Jan 15, 2015 at 11:58
7

One of the notational service available via the SongTrellis site is a Tunetext service, which accepts properly encoded markup and produces a MIDI performance and matching score expressed as a JPG image.

A Tunetext page, which the service returns in response to a request, performs the generated MIDI sequence, displays the score on the page, and provides links which package that music in a number of ways so that it can be posted on other websites. Think of this page as a factory for producing music examples.

When a musical example is packaged as a tunetext button, the score image is displayed within a frame with the instruction "Click on music to play" located below the bottom edge of the frame. The tunetext URL that generated that music is attached as a link to the score image. When the score image is clicked, the music plays and is displayed in entirety within its response page.

By pressing the "Edit Tunetext Parameters" button that appears on a Tunetext response page, a visitor can customize the example for their own purposes (change the tempo, alter the instrumentation, generate color coded scores to label the harmonic or melodic intervals formed by notes and chords in the score).

Such buttons cannot be posted to StackExchange at this moment because usage of the Embed HTML tag is not currently allowed, but it might be reasonable to ask Stack Exchange developers for a way to submit such buttons to the site, if members believe they would be valuable to post.

The notation of the music is available for a viewer to manipulate for their own purposes. The music they produce by their alterations they can save for themselves and can post elsewhere.

Tunetext is especially suited for generating example harmony extremely quickly. When chords are specified in the markup using only chord names like this:

Cmi7(b5),F7Alt,Bmi(MA7)

the Tunetext interpreter will automatically generate voicing for that chord list.

Click here to perform those chords

Here's the score image harvested from that Tunetext page:

If you issued the URL

http://www.songtrellis.com/tunetext

with no following parameters, a form would launch where you could type these or other chord symbols. When you press the "Submit Score" button in this form, the specified music will be performed and the score for that music will be displayed

If it's necessary to precisely specify the voicing for a chord, a list of pitch specifications enclosed in square brackets is written after the chord name, like this:

DMA7[3,d,4,d,f#,a,5,d] Click here to perform

The integers in the list specify the octave ranges where the immediately placed pitches will be placed on the staff.

The tunetext interpreter treats durations as a property of the notes, chords and rests that are being added to a score. Once a duration has been set for a note, chord or rest, it's not necessary to respecify the duration for following elements that have the same duration. The default duration assumed at the beginning of a specification is whole note duration.

When a change of duration must be made for a following chord (or note or rest), a scaling factor is applied to transform the previously used duration value into the duration required of the new note. For example, a /2 operator means to divide the previously by 2. The *3 operator means to multiply the previously used duration by 3.

This specification

Cmi7(b5),F7Alt,*2,Bmi(MA7) Click here to perform

would play Cmi7(b5) then F7Alt as whole note chords and then would double the duration of the Bmi(MA7) chord.

Here's a four chord sequence expressed as a Tunetext URL:

http://www.songtrellis.com/tunetext?text=show:0,sys:0,chords:%28inst:1,C7,D7,E7,F%237%28%2311%29%29

Here's a melody improvised above these chords using pitch rules that are part of the Tunetext language.

Here's the score image harvested from the Tunetext page for that melody:

I should mention that I'm the developer of the SongTrellis site and its Tunetext service. When people see specification omissions in the Tunetext language, improvements that should be made to the notation produced or in interfaces that the website provides, I'm anxious to fix such things quickly. I appreciate any feedback provided and am at your service.

1
2

muscript (requires perl) offers a simple syntax and multiple output options. eps2jpg (same site) (requires ghostscript) can postprocess to jpg.

It uses "English" names for the note shapes: breve, semibreve, crochet, quaver, semiquaver, demisemiquaver, hemidemisemiquaver.

#title Caprice No. 6 in G Minor
boundingbox 600 400
2 systems 40 / 20 / 20 / 20 / 20 / 20 / 20 / 20 / 20 / 20 40 /
/

1 bar | 2b 3/4 5 5 5 5 5 5 |
|
=1' treble 2b 3/4 cro. d qua [g f# e]
=1, 2b 3/4 hds3 [G B G B G B G B G B G B] \
[G B G B G B G B G B G B] \
[G B G B G B G B G B G B] \
[G e G e G e G e G e G e] \
[G d G d G d G d G d G d] \
[G c G c G c G c G c G c]
|

3 bars | 15 | 15 | 15 |
|
=1' cro. d qua [d c B]
=1, smq. [G B] [G B] [G B] [F A] [E G] [D F]
|
=1' cro. A qua [c A G]
=1, smq. [C E] [C E] [C E] [C E] [C# En] [C E]
|
=1' smq. [G B] [G B] [F# A] [Eb A] [D G] [D F#]
=1, cro. D qua [Cn B_ A_]
|

$muscript cap6a.mu >cap6a.mu.eps

$eps2jpg cap6a.mu.eps > cap6a.mu.jpg

theme from Paganini Caprice no 6

I'm still learning how to do fancy barring, phrasing and tremolos.

1
  • 2
    It'd probably be prettier as a PNG :( May 20, 2012 at 6:53
2

I've recently found MuseScore to be quite easy to use for quick examples.

4
  • I've used MuseScore before (I consider it to be the best free, open-source notation program out there!) and I don't remember it having anything that could be used to embed notation into SE posts... A little more information maybe?
    – ksoo
    Aug 31, 2013 at 20:17
  • The two linked posts use PNG images which were exported from MuseScore. For these, I set the page size to A6 or A7 to make a "small" page. For other purposes, it's much easier to use a snapshot tool and cut the image straight out of the window. But it's just images. Aug 31, 2013 at 20:32
  • Oh, okay. It's just that I'm pretty sure Matthew was asking about embedding notation in SE posts...but I could be wrong.
    – ksoo
    Aug 31, 2013 at 20:33
  • 1
    @AsianSquirrel: This is just a workaround until/if embedding notation is implemented on the site.
    – awe
    Oct 28, 2013 at 11:50
-5

Very limited use I'm sure.

G           ♪               ♩               ♩   X
F         ♪   ♪     
E       ♪       ♪       ♩       ♩           ♩   X
D     ♪           ♪     
C   ♪               ♩               ♩   X   ♩   X
                                        ^       ^
    1       2       3       4       5   |   6   |
                                        |       |
                                        Rest    Rest
3
  • 3
    Why wouldn't you just use normal ASCII guitar tabs, if you're going to do that?
    – naught101
    Sep 27, 2012 at 5:58
  • 2
    Well, yes, that block of novelty notation is quite limited in readability (but not in notation capability; new syntax rules can be created to notate just about anything, probably). That said, it's nothing even close to standard music notation, in which spacing doesn't affect rhythmic value at all, and there are different rest symbols for different length rests. Using a pathetic parody of standard notation doesn't help prove your point. @naught101 is right, it bears more resemblance to guitar tablature... However, if you actually read the question, Matthew isn't asking for TAB notation at all!
    – ksoo
    Aug 31, 2013 at 20:13
  • 2
    Also when it comes to guitar notation, we already have jTab implemented, so for guitar notation, we already have a powerful tool to use.
    – awe
    Oct 28, 2013 at 11:44
-7

Implementing a markup language for music notation for use on Music.SE is a bad idea. I say no way. Markup for music notation is way too esoteric because sheet music is much more complex than written languages. Any kind of markup notation would be useful to only a tiny fraction of the participants who spend a great deal of time learning to use it. Implementing something in SE to display music notation from a markup language would be a huge waste of time for the developers because it would practically never be used.

Those of us conversant in notation are better served by making examples in the software of our choice and then taking a screen shot and posting a .PNG.

And by the way, the undisputed king of markup for music is MusicXML, which is now owned and developed by MakeMusic (the company that makes Finale) but is made available free with an open specification.

MusicXML can be output by Sibelius, Finale, and several other professional music notation systems, and MusicXML can be used as a file-exchange format between those programs. Lilypond does not speak MusicXML, which is why I do not use LilyPond.

4
  • I wonder why this is downvoted? I hate XML as much as the next guy, but sheesh... :) May 20, 2012 at 6:50
  • 3
    This is simply not true! Music notation is guided by rules and strictures that aren't especially more complex than say, mathematical formulas. Similarly to the limited LaTeX support on the Math websites, it would also make sense to have some limited LilyPond support.
    – Hannele
    Aug 2, 2012 at 18:36
  • 3
    @luserdroog: It is not downdvoted because he suggests MusicXML. It is downvoted because he say that "Implementing a markup language for music notation for use on Music.SE is a bad idea.". If he edits his answer and removes the first part, leaving only the part about MusicXML, I will gladly remove my down-vote!
    – awe
    Aug 28, 2012 at 8:13
  • 1
    I agree with @awe --even the tone of voice in the answer ("And by the way, the undisputed king of markup...") gives the asker more than enough sass to deserve a downvote. And it's already been stated that the first sentence is a classic put-down and not appropriate for a StackExchange site.
    – ksoo
    Aug 31, 2013 at 20:05

Not the answer you're looking for? Browse other questions tagged .