行頭から始まる行 = 新チャンネル(複数チャンネルは同時再生で和音・伴奏)。行頭に空白を入れた行は前のチャンネルの続き(チャンネル内で自由に改行できます)。コメントは「;」(そこから行末まで。行の途中でも可)と /* ~ */(複数行またぎも可)の2種類で、空行とともに無視されます。行頭の /* コメント */ の直後に続けて書いた内容は継続行扱いになるので、新チャンネルにしたいときはコメントを前の行に分けてください。内容は自動保存されます。 「記述を最適化」は選択範囲(未選択なら全体)の冗長な書き方を縮めます(l と同じ音長の明示指定を削除、絶対オクターブ指定を > < に変換)。l 指定の無い区間に4分音符があればチャンネルの頭に l4 を足して数字を省きます(c4 d4 e4 f4 → l4 c d e f)。最初に出てくる o は残すので、暗黙の初期値に依存する形にはなりません。音が変わらないことを検算してから適用します。 「mml.js用にコピー」はコメントを除去し1行=1チャンネルに整形してコピーします(他プロジェクトの mml.js へ持ち出す用)。
A line that starts at the left edge is a new channel (channels play together for chords and accompaniment). A line that starts with a space continues the channel above, so you can break a channel over as many lines as you like. Comments are ";" (to the end of the line, also mid-line) and /* ... */ (can span lines); they are ignored, as are blank lines. Text written right after a /* comment */ at the start of a line counts as a continuation line, so put the comment on its own line when you want a new channel. Your text is saved automatically. "Optimize" shortens redundant writing in the selection, or in the whole text if nothing is selected: it removes lengths that equal the current l and turns absolute octaves into > <. If a part with no l has quarter notes, it adds l4 at the head of the channel and drops the numbers (c4 d4 e4 f4 → l4 c d e f). The first o is kept, so the result never relies on the implicit default. It checks that the sound does not change before applying. "Copy for mml.js" removes comments and copies one line per channel (for taking your song to mml.js in another project).
雰囲気はスケール・テンポ・激しさ・音色などの「初期値セット」です。各パラメータを指定すると雰囲気の設定を個別に上書きできます(テンポだけ指定すれば、同じシードの同じ曲を速さ違いで鳴らせます)。 生成するとテキストエリアを置き換えて即再生します(「元に戻す」で直前の内容と入れ替え)。気に入った曲はシード値と設定で再現できます。生成後に手で編集して仕上げるのも有効です。
A mood is a starting set of scale, tempo, intensity, sounds and so on. Set any parameter to override that part of the mood (set only the tempo to hear the same seed's song at a different speed). Generating replaces the text area and plays at once ("Undo" swaps it with the previous text). You can reproduce a song you like from its seed and settings. Finishing it by hand afterwards works well too.
先頭チャンネル(最初のコメント以外のブロック)をメロディとみなし、キーとコード進行を推定してベース・アルペジオ等の伴奏を生成します。スケール・キー・テンポはメロディから推定するため設定はありません。雰囲気は伴奏の音色・パターンに使います。鍵盤録音や音声採譜のMMLにもどうぞ。
Treats the first channel (the first block that is not a comment) as the melody, estimates its key and chord progression, and generates bass, arpeggio and other accompaniment. The scale, key and tempo come from the melody, so there are no settings for them. The mood sets the accompaniment's sounds and patterns. Works on MML from the keyboard recorder or audio transcription too.
メロディの続きの小節を生成して末尾に足します。キー・コード進行・音域はメロディから推定し、直前の音から自然につなげます。 スケール指定は主音を変えずに明暗だけ変える同主調転調です(暗くしてボス感、明るくして解決など)。オクターブ上+盛り上げでクライマックス、締めで曲を閉じる、といった組み合わせができます。 同じメロディ+同じシードなら同じ結果になり、追い足すたびに(元が長くなるので)違う小節が出ます。
Generates the next bars of the melody and adds them at the end. The key, chord progression and range are estimated from the melody, and the new bars continue naturally from the last note. The scale setting changes to the parallel key: the tonic stays and only the brightness changes (darker for a boss feel, brighter to resolve, and so on). Combine an octave up with build-up for a climax, or end with a cadence to close the song. The same melody and seed give the same result, and each extension gives different bars (because the melody has grown).
打ち込み式のリズム入力です(4トラック×16分)。セルをクリックで打点ON/OFF(ONにした瞬間に単発試聴)。キック+ハット同時のような同時打鍵はトラックを分けて入力します。 MML出力時、打点が重ならないトラック同士は1チャンネルにまとめられます(例: キックとスネアが重ならなければ1トラック)。同一ステップで重なる場合のみチャンネルが分かれます。打点のないトラックは出力されません。 楽器はプリセットを選んでから @(波形)/ 音程(音名+オクターブ。例: c5, f#4。ノイズはバンドパス中心の微調整、noise以外はそのまま音の高さ)/ v(音量)/ q(ゲート1-8。小さくするとDecayを切り詰めて短く硬い音)/ @e(エンベロープ4値)を微調整できます。手で調整すると表示が「(手動)」になり、プリセットを選び直さない限り上書きされません。 調整した音は「登録」で名前を付けてユーザー楽器として保存でき、プリセットの下の「ユーザー定義」から全トラックで選べます(「✕」で削除)。パターン再生は本編の再生と排他です。
Step input for rhythm (4 tracks × 16ths). Click a cell to turn a hit on or off (it plays once when you turn it on). For hits at the same moment, such as kick and hi-hat together, use separate tracks. In the MML output, tracks whose hits never overlap are merged into one channel (for example, kick and snare become one track if they never coincide). Channels split only where hits fall on the same step. Tracks with no hits are left out. Pick a preset, then fine-tune @ (wave) / pitch (note + octave, e.g. c5, f#4; for noise it fine-tunes the band-pass center, otherwise it is the pitch itself) / v (volume) / q (gate 1-8; smaller cuts the decay for a shorter, harder sound) / @e (the 4 envelope values). Once you adjust by hand the preset shows "(manual)", and your values stay unless you pick a preset again. Use "Save" to name an adjusted sound and keep it as a user instrument. It appears under "User-defined" below the presets for every track ("✕" deletes it). Pattern playback and main playback do not run at the same time.
エンベロープ初期値: 鍵盤 @e3,0,100,80(手弾き向けにリリース長め)/ MMLエンジン @e3,0,100,40(チャンネルに @e 未記載のときの値) 単音(モノフォニック)録音です。重ねて弾いた音は前の音を切って直列化します。最初の打鍵が拍頭(時刻0)扱い。
Default envelope: keyboard @e3,0,100,80 (longer release for playing by hand) / MML engine @e3,0,100,40 (used when a channel has no @e) Monophonic recording. A note played over another cuts the earlier one, so notes play one after another. The first key press counts as the downbeat (time 0).
クリック / PCキー: 下段 Z S X D C… 上段 Q 2 W 3 E…(このウインドウが手前にあるときだけ)
Click / PC keys: lower row Z S X D C… upper row Q 2 W 3 E… (only while this window is in front)
鼻歌・口笛・単音楽器を採譜します(マイク / 音声ファイル)。単音(モノフォニック)専用で、和音や伴奏入りの曲からは採譜できません。 同じ高さの音を続けるときは「たたた」「らんらん」のように子音を挟むと切れ目を検出しやすくなります。 最初の検出音が拍頭(時刻0)扱いなので、BPMは歌ったテンポ感に合わせてください。変換後はテキストエリアで手直しし、「伴奏付け」につなげるのがおすすめです。
Transcribes humming, whistling or a single-note instrument (mic / audio file). Monophonic only: it cannot transcribe chords or songs with accompaniment. When you repeat the same pitch, putting a consonant between notes ("ta-ta-ta", "la-la-la") makes the breaks easier to detect. The first detected note counts as the downbeat (time 0), so set the BPM to the tempo you sang at. After converting, touch it up in the text area, then try "Accompaniment".
| c d e f g a b | 音符。直後に # / + でシャープ、- でフラット(例: c# b-)Notes. Add # / + for sharp or - for flat right after (e.g. c# b-) |
| 数字・付点Number, dot | 音長。c4=四分 c8=八分 c12=三連 c4.=付点四分(省略時は l の値)Length. c4 = quarter, c8 = eighth, c12 = triplet, c4. = dotted quarter (the l value when omitted) |
| r | 休符(音長指定は音符と同じ)Rest (lengths work as for notes) |
| o4 / > / < | オクターブ指定 / +1 / -1(o4 の a = 440Hz)Set octave / up 1 / down 1 (a in o4 = 440 Hz) |
| l8 | デフォルト音長(初期値4)Default length (default 4) |
| t140 | テンポBPM(初期値120。全チャンネルに書くこと)Tempo in BPM (default 120; write it in every channel) |
| v0〜v15v0-v15 | 音量(初期値10)Volume (default 10) |
| q1〜q8q1-q8 | ゲートタイム。8=音長いっぱい、小さいほどスタッカート(初期値8)Gate time. 8 = full length, smaller = more staccato (default 8) |
| @0〜@4@0-@4 | 音色: 0=sine 1=square 2=triangle 3=saw 4=noise(初期値1)Wave: 0=sine 1=square 2=triangle 3=saw 4=noise (default 1) |
| @e3,0,100,40 | エンベロープ: attack(ms), decay(ms), sustain(%), release(ms)。初期値 @e3,0,100,40(初期値に戻すにはこの値を書く)Envelope: attack (ms), decay (ms), sustain (%), release (ms). Default @e3,0,100,40 (write this to go back to the default) |
| & | タイ/スラー。前の音符と繋いでアタックを鳴らし直さない。c4&c8=タイ(長くする) c4&e4=スラー(音程だけ差し替え)Tie / slur. Joins to the previous note without a new attack. c4&c8 = tie (longer), c4&e4 = slur (only the pitch changes) |
| m120,5,30 | LFO(ビブラート): 遅れ(ms), 速さ(Hz), 深さ(セント。中心から±)。遅れは音符ごとに数え直す。初期値 m0,0,0=無効LFO (vibrato): delay (ms), rate (Hz), depth (cents, ± around the center). The delay restarts on each note. Default m0,0,0 = off |
| p60 | ポルタメント。& の繋ぎ目を60msかけて滑らせる(& が無い並びには効かない)。初期値 p0=瞬時に切り替えPortamento. Glides over 60 ms at each & joint (no effect without &). Default p0 = instant |
| @b-200,60 | ベンド。出だしを200セント下(負で下・正で上。@b+200,60 とも書ける)から60msで正規の音程へ。次の音符1つにだけ効くので解除は不要(休符は消費しない)Bend. Starts 200 cents below (negative = below, positive = above; @b+200,60 also works) and reaches the pitch in 60 ms. Applies to the next note only, so there is nothing to reset (rests do not use it up) |
| [ ... ]3 | リピート3回(ネスト可)。1チャンネルの音符+休符が100万を超えるとエラーRepeat 3 times (can nest). An error if one channel expands to more than 1,000,000 notes and rests |
| [ ... ]0 | 数字なし・0 は無限ループ: 2周目以降ここから繰り返す(イントロ付きループ用。チャンネル末尾にのみ書ける。複数チャンネルでは最も遅い開始点を採用)No number or 0 = infinite loop: from the second time on, playback repeats from here (for loops with an intro; only at the end of a channel; with several channels the latest start point is used) |
| | | 小節区切り(再生には影響しない。見た目整理用)Bar line (no effect on playback; for readability) |
& で繋いだ音は1回しか発音しません(音色・音量・エンベロープは繋いだ先頭の音のものを全体に使います)。m の遅れも繋いだ全体の頭から数えるので、長く伸ばすほどビブラートが育ちます。
m と @b はどちらもセント単位で同じ detune の上で加算されるため、@b-100,60 m120,5,30 なら「しゃくり上げてから揺れ始める」になります。
半音・全音のように音名で書ける上下(ハーモニカのベンドから戻る奏法など)は p と & で書けます: p40 o4 e16&d16&e2. — アタックは1回だけで E→D→E とひと息で動きます。
Notes joined with & sound only once (the wave, volume and envelope of the first note apply to the whole). The m delay also counts from the start of the whole joined note, so the longer it is held, the more the vibrato grows.
m and @b are both in cents and add up on the same detune, so @b-100,60 m120,5,30 scoops up into the note and then starts to wobble.
Moves you can write as note names (a half or whole step, such as bending a harmonica note and releasing it) can be written with p and &: p40 o4 e16&d16&e2. — one attack, moving E→D→E in one breath.
上の表はエンジン(mml.js)自体の記法です。mml.js が読み飛ばすのは空白・タブ・改行・| の4つだけで、それ以外の未知の文字はエラーになります。 コメント(; と /* ~ */)と「行頭=新チャンネル / 行頭空白=継続行」はこのエディタ側の機能で、mml.js 単体にはありません(mml.js へは1チャンネル=1文字列の配列で渡します)。 他プロジェクトの mml.js で鳴らしたいときは「mml.js用にコピー」ボタンを使うと、コメントを除去し継続行を連結した1行=1チャンネルの形でコピーできます。
The table above is the notation of the engine (mml.js) itself. mml.js skips only spaces, tabs, line breaks and |; any other unknown character is an error. Comments (; and /* ... */) and "left edge = new channel / leading space = continuation" are features of this editor, not of mml.js (mml.js takes an array with one string per channel). To play your song with mml.js in another project, use the "Copy for mml.js" button: it removes comments and joins continuation lines into one line per channel.