Support for MML music notation format.

Discussion in 'Other' started by Havoc1337, Dec 6, 2013.

  1. Piano

    Piano Starship Captain

    Okay, I think I got what you're saying, but I'm uploading something simple anyway to see if I did it correctly.

    1: So, any time two notes are played together, they must be on a separate track. I have to admit, that can become a little tedious. Are there any ways to quickly input a chord into the code without having to manually create another track and find the right place to put the note?

    2: I've noticed that when you use an octave raise or lower symbol, it accounts for all of the notes afterwards, not just the note it was used for. Is there a way to make cause the program to revert back to the original octave after said note automatically?

    3: Spaces are okay to separate measures, correct? For me, it helps aesthetically to see the measures organized. Example: L4 CCCC CCCC
    That would be two measures of note C.

    4: Does it matter what order I put T/V/L/O or any others in?

    5: I tried importing a couple midi files, and sometimes 3MLE would make a separate track just for volume/tempo control. If I do this on my own, does that separate track affect all tracks that have notes playing?

    Edit: After typing this, I have found that the site is not allowing me to choose a midi file to upload. I'm going to post the code here instead for you to view.

    Track 1:
    // title : Track1

    /*M 0 */ <c4c4c4c4
    /*M 1 */ c4c4c4c4
    /*M 2 */ c4c4<b4b4
    /*M 3 */ >c1

    Track 2:
    // Track2

    /*M 0 */ <e4e4e4e4
    /*M 1 */ f4f4f4f4
    /*M 2 */ e4e4d4f4
    /*M 3 */ e1

    Track 3:
    // Track3

    /*M 0 */ <g4g4g4g4
    /*M 1 */ a4a4a4a4
    /*M 2 */ g4g4g4g4
    /*M 3 */ g1

    If read out correctly, we should have CEG CEG CEG CEG | CFA CFA CFA CFA | CEG CEG BDG BFG | CEG (Whole note)

    Those are my questions for now. Thank you again for the help!
  2. Rydian

    Rydian Big Damn Hero

    1. Well, this meant for music in general, not specifically piano notatoion. And in a song you often have multiple concepts at the same time. For example the baseline, the melody, and the accompaniment. And if a couple of these need to play a note at the same time, each of their sheet music will dictate the note to play and they'll end up playing it at the same time by virtue of following notation that's designed that way.

      These concepts you seem to want to focus on only apply to the piano (and/or harpsichord). There is no left/right hand when dealing with the trumpet, you don't dictate multiple notes to be played with one hand at once when playing the flute, etc. The vast majority of instruments out there play a single note at a time, after all.

    2. If you need to play one single specific note that's outside of the current octave (and jump right back later), you can use the N## command to specify it's MIDI note number and it'll play that note without changing the working octave.

    3. Yes, spaces and linebreaks are fine for composing, and 3MLE or whatever else will just remove them in the exported-to-clipboard copy.

      Just a note, if you hit CTRL+SHIFT+Y in 3MLE, it'll try to shorten your piece automatically by replacing some notation with shortcuts that mean the same thing, and it'll also insert linebreaks to show it all without needing to scroll. This function is there because Mabinogi has a limit on the number of characters you can have per track, which goes up with your composing rank in-game.

    4. No, in fact you can use them multiple times to change the volume, octave, and default length at varying points in the song, per-track. (You can also change tempo in the middle of a piece, but this affects the whole song, not just that one track.)

      Here's one example of a piece that changes tempo multiple times while it plays (along with volume changes but they're less noticeable), and uses different default note length changes per-track.
      (File -> Import MML From Clipboard)
  3. Piano

    Piano Starship Captain

    I don't mean to sound like I only want to do piano notation, but some programs have support to do as such. I write for all instruments, but when I am doing something for piano, it's easier to have something that might help with that.

    1: So from what you said, there is no command to quickly auto-create chords? Is there a program that does, such as the Sion @TripN talks about?

    2: Question 5 from above stil stands.

    3: Does the program allow for grace notes? If, so, what do I input in order to make one happen.

    4: Is there a tag to define what key you're in?

    5: Is there a tag for repeats to a first and second ending?
  4. Rydian

    Rydian Big Damn Hero

    2 - Missed that one. Tempo in one track effects all tacks. On the other hand, Length, volume, octave, etc. only affect the track that they're typed in.

    For the others, I don't know. Mabinogi's implementation of MML is not the de-facto standard (but is the only one I'm familiar with), so there may be some commands other MML-supporting programs have that I'm not familiar with.
  5. lvk

    lvk Aquatic Astronaut

    MML user here, but mostly used it for ppMCK, not Mabinogi. I'd love some support as well. I don't think I'd ever be able to write in ABC notation without external tools or hanging myself in the process. I know there are other priorities at hand, but eventually it would be great if it happened.

    I might write a MML to ABC converter myself, but I have no idea right now what the ABC notation supports. If something happens, I'll report back.

    (edit) According to this page, all bars are seperated with... well, bars (or pipes if you will) but Starbound's ABC files don't seem to do this. Are the bars/pipe symbols necessary or purely visual? Because if they're necessary, this may be a much more unpleasant format than I thought.

    From what I can tell, volume commands/envelopes (vX/@v{...}) are out of the question. Does ABC even have a way to modulate volume?

    Right now, I'm trying to figure out an efficient/flexible way to parse modifiers for MML notes, since there are multiple formats to consider (Mabinogi, ppMCK, SiON softsynth, MIDI, etc.) as well as some considerations to make (for now, I'm most likely dropping & note ties in favour of ^ note ties). After that, I can write something to parse the sequences into something to work with, then convert them to ABC. I'll keep additional info in this thread until I actually have something to show, then I'll create a new thread.

    (edit 2) Got some basic MML parsing action going on, have to fix some basic actions a bit and then we can get to the ABC conversion part, which will take a lot longer, probably. Also, if anyone has some experience with ABC, please contact me. Experience with both MML and ABC would be even better.

    (edit 3) There is some kind of conversion going on (and it isn't optimized yet, obviously) but I don't have an instrument in Starbound to test with. What can I do?

    (edit 4) Please read edit 3! I can't continue right now.

    (edit 5) Got pointed to a mod that seems to give new characters all instruments. Results incoming!

    (edit 6) It's working! Or at the very least, on a basic level. I found out the program isn't considering the default measure yet, so I have to adjust for that, but it sure can turn some basic MML data into ABC notes! I'll get to fixing the current issues as soon as possible, then work towards something useable.

    As of now, it can turn
    l8o0 defdgfdf>defdgfdf>l4defdgfdf
    D,/8 E,/8 F,/8 D,/8 G,/8 F,/8 D,/8 F,/8 D/8 E/8 F/8 D/8 G/8 F/8 D/8 F/8 d e f d g f d f

    which obviously isn't optimized yet, and completely disregards the active measure, but it's definitely doing something in the right direction! The /8 should obviously be /2. I've used the word obviously 4 times total in this post.

    Please keep in mind that in the end, the .ABC files will be functional but horribly mangled. The idea with the converter is that you don't have to touch the .ABC format at all, so I will be very lenient in what I consider passable for .ABC optimization.

    For example, I've fixed most of the tempo issues by switching to a default note length of 1/1. There are more complex, elegant and flexible solutions available, but this is definitely easier.

    Here's an example part of an MML from demigod Robokabuto (I've slightly modified it by taking out commands specific to ppMCK - I'll work on parsing those out eventually) - it's a single channel (N163 channel 3) from an NSF cover of his of Romancing SaGa 1's battle theme:


    o3r16l16bg-b>dg-dg-b b-8g-rr8g-b- a8g-rr8a-aa-8err4l8 g-2^8edg- d-4e4d-4<a4>d2^8d-de l16 d-<g-b->d-g-<b->d-g-b-d-g-b->d-<g-b->d-<<l8 g-1 g2.g-e g-2.e4 a2.^8r8>d2^8<b>d-de2d-4e4 dd-<b>d-<b4>d4<b4>d4d-4<b4b4.g4.b4a4.g-4.e4g2a2b2.a4g1^1a1b2a2 g1^1a1b2.a4bagab2> d-<bab>d-2 dd-<b>d-d4.e16g-16 f2^8e-d-<b> d-2d2 l16d-<b-g-b->d<b-g-b->e<b-g-b->g-<b-g-b->

    The converter outputs the following:

    %comment comment comment

    X: 1
    M: 4/4
    L: 1/1

    z/16 b/16 _g/16 b/16 d'/16 _g'/16 d'/16 _g'/16 b'/16 _b'/8 _g'/16 z/16 z/8 _g'/16 _b'/16 a'/8 _g'/16 z/16 z/8 _a'/16 a'/16 _a'/8 e'/16 z/16 z/4 _g'5/8 e'/8 d'/8 _g'/8 _d'/4 e'/4 _d'/4 a/4 d'5/8 _d'/8 d'/8 e'/8 _d'/16 _g/16 _b/16 _d'/16 _g'/16 _b/16 _d'/16 _g'/16 _b'/16 _d'/16 _g'/16 _b'/16 _d''/16 _g'/16 _b'/16 _d''/16 _g g3/4 _g/8 e/8 _g3/4 e/4 a7/8 z/8 d'5/8 b/8 _d'/8 d'/8 e'/2 _d'/4 e'/4 d'/8 _d'/8 b/8 _d'/8 b/4 d'/4 b/4 d'/4 _d'/4 b/4 b3/8 g3/8 b/4 a3/8 _g3/8 e/4 g/2 a/2 b3/4 a/4 g2 a b/2 a/2 g2 a b3/4 a/4 b/8 a/8 g/8 a/8 b/2 _d'/8 b/8 a/8 b/8 _d'/2 d'/8 _d'/8 b/8 _d'/8 d'3/8 e'/16 _g'/16 f'5/8 _e'/8 _d'/8 b/8 _d'/2 d'/2 _d'/16 _b/16 _g/16 _b/16 d'/16 _b/16 _g/16 _b/16 e'/16 _b/16 _g/16 _b/16 _g'/16 _b/16 _g/16 _b/16

    Which seems to be perfectly useable in Starbound! It doesn't sound great because the original uses a lot more channels. I may work on splitting tracks into seperate .ABC files so you can jam with your friends, but there are a lot of MML formats out there right now.

    What I'd like to do next is contact some veteran MML users for a closed beta type of thing, and then we can work towards a seperate thread with a public release.

    As a bonus to everyone who stayed interested during all three or so updates, here's a track from a Final Fantasy title screen (I forgot which) in .ABC format - original by Hautbois as found here. For best effect, use a harp.

    %Original MML by Hautbois, original composition by Square Enix

    X: 1
    M: 4/4
    L: 1/1

    C,/4 D,/4 E,/4 G,/4 C/4 D/4 E/4 G/4 c/4 d/4 e/4 g/4 c'/4 d'/4 e'/4 g'/4 c''/4 g'/4 e'/4 d'/4 c'/4 g/4 e/4 d/4 c/4 G/4 E/4 D/4 C/4 G,/4 E,/4 D,/4 A,,/4 B,,/4 C,/4 E,/4 A,/4 B,/4 C/4 E/4 A/4 B/4 c/4 e/4 a/4 b/4 c'/4 e'/4 a'/4 e'/4 c'/4 b/4 a/4 e/4 c/4 B/4 A/4 E/4 C/4 B,/4 A,/4 E,/4 C,/4 B,,/4 C,/4 D,/4 E,/4 G,/4 C/4 D/4 E/4 G/4 c/4 d/4 e/4 g/4 c'/4 d'/4 e'/4 g'/4 c''/4 g'/4 e'/4 d'/4 c'/4 g/4 e/4 d/4 c/4 G/4 E/4 D/4 C/4 G,/4 E,/4 D,/4 A,,/4 B,,/4 C,/4 E,/4 A,/4 B,/4 C/4 E/4 A/4 B/4 c/4 e/4 a/4 b/4 c'/4 e'/4 a'/4 e'/4 c'/4 b/4 a/4 e/4 c/4 B/4 A/4 E/4 C/4 B,/4 A,/4 E,/4 C,/4 B,,/4 F,,/4 G,,/4 A,,/4 C,/4 F,/4 G,/4 A,/4 C/4 F/4 G/4 A/4 c/4 f/4 g/4 a/4 c'/4 f'/4 c'/4 a/4 g/4 f/4 c/4 A/4 G/4 F/4 C/4 A,/4 G,/4 F,/4 C,/4 A,,/4 G,,/4 G,,/4 A,,/4 B,,/4 D,/4 G,/4 A,/4 B,/4 D/4 G/4 A/4 B/4 d/4 g/4 a/4 b/4 d'/4 g'/4 d'/4 b/4 a/4 g/4 d/4 B/4 A/4 G/4 D/4 B,/4 A,/4 G,/4 D,/4 B,,/4 A,,/4 _A,,/4 C,/4 _E,/4 G,/4 _A,/4 C/4 _E/4 G/4 _A/4 c/4 _e/4 g/4 _a/4 c'/4 _e'/4 g'/4 _a'/4 g'/4 _e'/4 c'/4 _a/4 g/4 _e/4 c/4 _A/4 G/4 _E/4 C/4 _A,/4 G,/4 _E,/4 C,/4 _B,,/4 D,/4 F,/4 A,/4 _B,/4 D/4 F/4 A/4 _B/4 d/4 f/4 a/4 _b/4 d'/4 f'/4 a'/4 _b'/4 a'/4 f'/4 d'/4 _b/4 a/4 f/4 d/4 _B/4 A/4 F/4 D/4 _B,/4 A,/4 F,/4 D,/4

    Post summary/tl;dr: Tried writing a converter for MML -> ABC, it ended up functioning, currently adding features to it, closed beta kind of thing soon, release eventually, demo song above.

    If you're still reading, great! Things will be slow as the end of the year draws near, so please bear with me.
    Last edited: Dec 28, 2013
    BloodyRain2k and Treadlight like this.
  6. lvk

    lvk Aquatic Astronaut

    Double post time (since I very much need MML and ABC users to read this)! I've a request - does anyone have an MML (or a single channel excerpt) that uses chords, along with a sample of what it should sound like? I've recently implemented chords, but I doubt they're functioning properly. Mostly because I'm also very confused with how chords and polyphony work in ABC.

    I see different lengths of notes and rests entered in chords, and I don't know what's going on. A good example would be [^a/2=g9/8z/8]. Does it just draw out the chord for the longest note in it? Is this where the note ties come in, and where it matters whether you have spaces in your chord or not? How does ABC know to which of the notes to apply the rest? I've heard files where there's a seperate bassline and lead going on at the same time, and I'm not sure how it translates to ABC. If someone more proficient at ABC could help, that'd be great!
  7. Rydian

    Rydian Big Damn Hero

  8. lvk

    lvk Aquatic Astronaut

    @Rydian That's on 3 seperate channels, though. Both MML for SiON/SiOPM and the ABC notation have polyphony available (both with square brackets, I believe). I've never written anything for the former.

    (edit) It looks like there aren't any direct chords in SiON's softsynth either, it mostly looks like...
    #M(modifiers)A(modifiers)B(modifiers)C; (or whatever channel you're using) I'm not sure how to handle chords at all. While MML doesn't seem to support them directly, I'd prefer not to lose functionality from ABC, given how limited ABC already is for reproducing music electronically.
    Last edited: Dec 29, 2013
  9. Jetter

    Jetter Subatomic Cosmonaut

    I have never actually seen a variant of MML that has chords without multiple channels. If Starbound supported ABC's multiple voices, then it'd be easy but for now it looks like you'll have to find a way to combine all those channels into one. Just off the top of my head (I do not guarantee that this will work) you might be able to parse each channel simultaneously and then make an ABC chord when two notes start at the same time. I have absolutely no idea how you'd handle one note starting while another is already going though, mainly due to unfamiliarity with how ABC would handle that situation. Also, depending on what you're programming in I might be able to help you with some parts of this project. I can't promise anything right now since I've got other stuff going on but I am interested.
  10. RatixFarrence

    RatixFarrence Scruffy Nerf-Herder

    As a former Mabinogi player currently struggling with the tempo-less old standard of ABC format, I'd like to see this happen also.
    Also we cant use Maestro(the ABC 2.1 converter), and are stuck with LOTRO Midi Player to convert our ABC files, which tends to fail at play-testing after a few uses and requires a restart.
  11. lvk

    lvk Aquatic Astronaut

    @RatixFarrence Don't worry, it's still happening. I've been very busy with schoolwork, but I should be able to continue by the end of the week. Though sadly, I do not think ABC can change tempo mid-song, rendering MML t# commands rather useless if you're using multiples.

    Also, I believe a bunch of fixes were introduced to the ABC parsing in Starbound partly thanks to the valiant efforts of the programmer of Starbound Composer (Lrns123), so we might see Maestro working better.
    Last edited: Jan 22, 2014
  12. Lrns123

    Lrns123 Big Damn Hero

    You can actually, just add a Q: <new tempo> . Make sure it's on a separate line though, Starbound doesn't support inline fields like [Q: ....].
  13. RatixFarrence

    RatixFarrence Scruffy Nerf-Herder

  14. Hyuponia

    Hyuponia Orbital Explorer

    I'm in. Been playing Mabinogi for years now, and only recently did I try my hand at ABC notation. It's actually counter intuitive, coming from something so straightforward.

    Have a comment in a like, I'll be watching this discussion.
  15. Rydian

    Rydian Big Damn Hero

    I managed to get a few people with hand chimes together in mabi for a nice example of what can be done with the party jam system.

    The animations are somewhat laggy due to my connection unfortunately, but it shows the concept of having multiple people play single notes with the right timing to make a song.

    Here's the MML so you all can confirm that each player is only hitting a single note at once (the hand chimes in the game don't play multiple notes at once).

    If Starbound could get some timing system to synch the start of playing in groups like this, and perhaps per-note animations for some instruments... that'd be cool.
  16. Yummeh

    Yummeh Void-Bound Voyager

    as a 10k from mabi playing starbound, i wholeheartedly support this motion. bring MML to more games yo. that being said, MML seems to require more information to process than ABC, which would explain why the devs chose to use it over MML in the first place. at least, based on the files of my music, the same song requires less data to be in ABC format than in MML format, despite being 10 times more convoluted and lame in terms of registering music. it's probably because it's so low-quality that the data size is reduced, but i still think the game engine could support a form of MML script reading that would work within starbound.

    plus, it'd be fun to bring all my original MML codes from mabi to starbound to play them there as well. WOO
  17. Meyling

    Meyling Space Hobo

    I’m not a programmer and I’m definitely not knowledgeable with music, let alone know what an octave is...
    But I do like to play music in Mabinogi and I agree that adding support for MML would help a whole lot! There’s a lot of MML out there that could be imported to Starbound and not just from Mabinogi alone, because MML is so popular
    Not to mention it would probably bring in more players! I know some who would greatly like this feature and I’m sure they know more as well!
    Please consider! And thank you for reading! :>

    also apologies in advance for the necro, I read the rules and this thread seemed to still be relevant! :eek:

Share This Page