or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
music-code
Music Code Player is a web app that allows you to type and play music using plain text.
Website: https://stdio2016.github.io/music-code/
Currently, it supports only one format, Music Macro Language.
Music Macro Language
Music Macro Language (MML) is a text format to describe a music. It is case-insensitive, and ignores all white spaces and newlines.
I have implemented two versions of MML player, the first version is mus.html, and this is the second version.
Some features are implemented after I finished mus.html, so there are syntax differences between these two versions. I will denote such differences in warning sections.
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Here is a list of commands:
CDEFGAB
A note. Its format is
pitch accidentals duration dots
.Pitch is a letter from
A
toG
and causes the corresponding note to be played.Accidentals can be zero or more
+
,#
,-
,=
or@
, where a+
or#
denotes a sharp, a-
denotes a flat, and an=
or@
denotes a natural.- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →=
, and allows up to 2 of the same accidental characters.The note duration is specified by an integer, representing a fraction of a whole note. Valid range is 1 to 64. For example,
C4
is a C quarter note. Duration can have 0 to 2 dots, which correspond to the dots of the note. For example,C4.
is single dotted C quarter note.- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →P
orR
Rest note. Its format is
P duration dots
. It is similar to a note, but a rest note does not have pitch and accidentals.- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →R
as rest note.O
Followed by a digit. Sets the octave of the following notes. Octave 4 (
O4
) contains Middle C.The octave setting will affect current track only. By default, each track is in octave 4 initially.
Octave can be -1 to 9. To reach octave -1 you need to type
O0<
.- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →O2016
.>
Raise the octave by 1. The highest possible octave is 9. The octave setting will affect current track only.
<
Lower the octave by 1. The lowest possible octave is -1. The octave setting will affect current track only.
L
The format is
L duration dots
. Sets the duration of the following notes to the duration specified by this command.For each following note:
The L command will affect current track only. By default all notes are quarter notes.
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →L
command with dots.T
Followed by an integer. Set the tempo in Beats Per Second. Valid range is 32 to 255.
An MML music is assumed to be 4/4 time. By default, a song will play a tempo of 120 (
T120
).T command will apply to the whole music, so the tempo of each track can by synchronized.
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →T120.5
, but I do not think it is useful, so I do not add support for non-integer bpm in this program.N
Play a note in the specified pitch. Its format is
N pitch dots
. The pitch is MIDI note number minus 12, soN48
plays Middle C. Pitch is an integer between 0 and 115.N note can have dots, but cannot have a duration. Please use L command to change its duration.
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →N2016
.V
Change the volume of the following notes. Volume is an integer from 0 to 127.
When in MML Compatible Mode, this command will accept an integer between 0 and 15. The program convert this integer to the volume with formula: \(volume = input\times 8+7\).
The volume setting will affect current track only. By default, all notes are played in volume 63.
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →V
command.&
Connect notes of the same pitch together like ties in music.
For example,
C2 & C4.
means to connect a C half note with a C dotted quarter note.When used with
&
, all the notes in the same chord are tied.- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →&
command.MML@
Enter MML Compatible Mode. In MML Compatible Mode, you can use
,
to separate tracks. This mode is for playing Mabinogi MML music.- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →;
Leave MML Compatible Mode. It is also a line comment, so anything after
;
is ignored.- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →;
as line comment.Extensions
These commands are extensions created by me.
,
(comma)When in MML Compatible Mode: Switch to next track.
When not in MML Compatible Mode: Lower the octave by 1. This is the same as
<
.'
(apostrophe)Raise the octave by 1. It is the same as
>
./
Chord. Its usage is
note / note / ... / note
. For example,C/E/G
plays C, E, and G at the same time. Only the first note of the chord needs to specify a duration, since other notes will have the same duration as the first note.Octave changes after
/
will only apply to the following notes in the same chord, soC/<G G
plays two G's in different octaves.K keyname
Set a key signature. Key name is assumed to be major key. For example,
KD
means that this music is played in D major.After setting a key, the following notes that have no accidentals will add accidentals acording to that key signature.
In D major, for example, C and F are sharp, so
KD C D E F G A B
will playC+ D E F+ G A B
.If you want to specify a minor key, please type its relative major key instead.
Key name can have accidentals. For example B flat major can be represented by
KB-
.K accidentals
Transpose all the following notes. For example
K++
raises notes up 2 semitones. Transposition happens after a note adds accidentals, soKD K++ F
will play a F sharp note raised by 2 semitones, that is G sharp.This command affects every tracks, so it can be used to transpose a music.
If there are multiple transposition commands, their effect will sum up.
K++ K-
for example will raise music up 2 semitones, then lower down 1 semitone. The net effect will be raise up 1 semitone.K=
has no effect, since this program does not reset transposition by natural symbol.- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →! tracknumber
Switch to other track. Valid range of track number is 0 to 999.
For example,
!0 C !1 D
plays C and D at the same time.You can interleave different tracks as you like. For example,
!0 A B !1 C !0 D !1 E F
is the same as!0 A B D !1 C E F
.~
Act as a tie in sheet music. Can only appear immediately after a note.
When used with
/
, only the notes immediately preceding~
are tied.For example, only G notes in
C/G~ C/G
are tied, where both C and G inC/G& C/G
are tied.