Skip navigation

parent: The OJN Documentation

Before diving into the notes section is important to define some terms:

events: The notes section doesn’t just contain the notes, it also has the bpm changes of the music and auto-play samples( pieces of music that play automatically as the music goes that doesn’t depend on the player, it usually appears at Ex(easy) songs), and perhaps other things I’m not aware of.

measure: Ever noticed those horizontal lines in between the notes during the music ? Those are the measures, we say all the notes before the first line are ‘measure 0’, after the first we call them ‘measure 1’ and so on.

package: These are the blocks that form a note section, each package contain one or more events inside.
Each package correspond to a specifically measure in a specifically channel( see below).
The number of packages in each section is in the package_count variable in the header section.

Each package has a mini header as follows:

struct package_header {
        int32   measure;
        short16 channel;
        short16 events;

measure: This is the measure in which the events inside this package will appear.

channel: This determines the events type, so far a got these:

channel  meaning
0 measure fraction
1 BPM change
2 note on 1st lane
3 note on 2nd lane
4 note on 3rd lane
5 note on 4th lane(middle button)
6 note on 5th lane
7 note on 6th lane
8 note on 7th lane
9~22 auto-play samples(?)

events: The number of events inside this package.

Each event has, as far as I know, 4 bytes, and the effect of the event depends on the channel.

When the channel is 0(fractional measure), the 4 bytes are a float, indicating how much of the measure is actually used, so if the value is 0.75, the size of this measure will be only 75% of a normal measure. This pretty rare to find a song using this, one example is Phase 1 on Easy at the measure 42( roughly 1:05 min).

When the channel is 1(BPM change) these 4 bytes are a float with the new BPM.

When the channel is between 2..8(note), these 4 bytes are divided like this:

struct note_event {
        short16 value;
        half-char volume;
        half-char pan;
        char note_type;

value: when value is 0 the event is ignored ( see below why), otherwise this is the reference to the sample on the OJM file.

volume: The volume to play the sample from 1~15, and 0 is the max volume.

pan: The panning of the sample, although this can also be controlled using stereo samples, further control can be given by using different pans with the same sample( I guess).
1~7 = left -> center, 0 or 8 = center, 9~15 = center -> right.

note_type: 0 when it’s is a normal note, 2 when it is the start of a long note, and 3 at the end of a long note. And a 4 value indicates the use of an “OGG sample”(in the notetool), despise the fact you can use ogg in the WAV section.

As you could see, each package can have more than one event, in these cases, the position of the event inside the measure is determined dividing the occurrence by the number of events. Example: if you got a package with 16 events, the 8th event will be at the middle of the measure(8/16=0.5), that’s probably why we have those ‘ignored events'(value = 0), they are there for padding the real events in the right position inside the measure.



    • The epic comment
    • Posted November 15, 2010 at 10:37 am
    • Permalink
    • Reply

    Hi, the unk value in the note_event are volume and pan being the first bit volume:
    {0=16 [max vol.]

    And the second pan:
    {0=8 [center]
    value8 [right]

    Keep the good work 😀

    • Hi there ! thanks for the input !
      I updated the post with this info.

    • The epic comment
    • Posted November 15, 2010 at 1:41 pm
    • Permalink
    • Reply

    Hi again, i know here isn’t the place but i made a quick update to your Now it can read the OMC headers

    Btw, every sample in this format lacks the wave header :/ I tried to make a correct header with no luck, the sample sounds really wrong 😦

    The rar has the ojm file, the wav-ish file and the pl file

    • wow !! thank you for this ! this really will speed up the [guessing] process !

      and don’t worry about posting here, it’s ok, but if you prefer you can talk to me through email, I will send you one actually ;D

  1. I’m a little confused about packages.

    Is this correct?

    Packages are a list of notes in a channel in a measure, with it’s notes’ position divisor listed as numEvents in it’s header(48 means 1/48th etc.)

    So the data is stored as follows:

    PACK HEAD N (M events)
    NOTE 1 (can be empty)
    NOTE 2 (can be empty)

    NOTE M (can be empty)
    PACK HEAD N + 1

    • yes, and the position of the note X in a package of Y elements is X/Y.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: