Every tool on SongSpark is free and unlimited, with no account and no paywall.

Melody Maker

旋律工坊 · 音阶 + 速度 + 音色 → 可听的旋律

A melody inspiration generator, not a full song machine. Pick a key and scale, set a tempo, press Play and hear a simple, music-theory-correct melody — then export it as MIDI into any DAW. It also fits a melody to your own lyric's syllable pattern.

4Generate re-rolls a fresh idea

Last updated: November 2026 · Reviewed by the SongSpark editorial team最后更新:2026 年 11 月 · 由 SongSpark 编辑团队 审校

What this tool does, and what it does not do这个工具做什么,不做什么

Melody Maker writes a short melody inside a key and scale you choose, draws it as a piano roll, plays it with the Web Audio API, and exports it as a MIDI file. You set five things — key, scale, tempo, bar count and instrument — and every press of Generate produces a new monophonic line of 2 to 8 bars. It is an idea generator for the first two seconds of hearing a tune, nothing more.

旋律工坊在你选的调性和音阶里写一段短旋律,把它画成钢琴卷帘,用 Web Audio 播放,并导出成 MIDI 文件。你只需要设五件事:调性、音阶、速度、小节数和音色;每按一次"生成旋律",就会得到一条新的单声部旋律,长度 2 到 8 小节。它是"第一次听到这个调子"那两秒钟的灵感工具,仅此而已。

What it will never give you: chords, drums, bass lines, vocals, a mixed track, an MP3 or WAV render, or a lyric. The output is one pitch line for one instrument. If you need harmony, take the MIDI into a DAW or choose a progression in Chord Mood Map and play the melody against it.

它永远给不了你:和弦、鼓、贝斯线、人声、混音成品、MP3 或 WAV,也没有歌词。输出只有一条给一件乐器的旋律线。需要和声的话,把 MIDI 导进 DAW,或者在和弦情绪图里选一套进行,再让旋律在它上面跑。

Good fit:

适合:

  • You want a contour idea in ten seconds and are willing to play it ten more times to find one worth keeping.
  • You are auditioning how a key and tempo feel before committing to a full song.
  • You need a MIDI skeleton to import into a DAW and build an arrangement on top of.
  • You are teaching someone what scale degrees and stepwise motion sound like.
  • 你想在十秒内拿到一条旋律走向,并愿意再点十次挑出值得留的那条。
  • 你想先听听某个调性、某个速度是什么手感,再决定要不要写成整首。
  • 你需要一个 MIDI 骨架,导进 DAW 再往上搭编曲。
  • 你要让别人听到"音阶级数"和"级进"到底是什么感觉。

Not a good fit:

不适合:

  • A finished audio file. There is no renderer here, only oscillators and a MIDI export.
  • Anything polyphonic. One voice, one note at a time, no chords.
  • Reproducing a specific artist's phrasing or a song you have in mind — the rules are generic.
  • Long-form composition. Eight bars is the ceiling, and each bar is sixteen sixteenth-note steps.
  • 成品音频文件。这里没有渲染器,只有振荡器和一份 MIDI 导出。
  • 任何复调内容。单声部、一次一个音,没有和弦。
  • 复刻某位歌手的乐句或你心里那首歌——规则是通用的。
  • 长篇幅写作。上限八小节,每小节十六个十六分音符格子。

How to use it, step by step分步使用

  1. Pick a key. The twelve keys run C, C#, D, D#, E, F, F#, G, G#, A, A# and B; the tonic sits at MIDI note 60 for C through 71 for B, which is the C4 octave.
  2. Pick a scale: major, minor, pentatonic, pentMinor, blues, dorian or mixolydian. The line under the selector tells you the mood each one is known for, and the roll only uses notes from that set.
  3. Set the tempo with the slider, from 60 to 180 BPM. The melody is scheduled against this value; one sixteenth step lasts 60 / tempo / 4 seconds.
  4. Set the bar count from 2 to 8. The grid becomes bars × 16 sixteenth steps.
  5. Pick an instrument: piano, pluck, pad or bass. This only changes the synth voice, never the notes.
  6. Press Generate melody (or drag any slider). Each press draws a new random seed and redraws the roll.
  7. Press Play once to hear it. Browsers refuse audio until you click, so the first press both creates the audio context and starts playback. Loop repeats the line; Stop cancels it.
  8. Keep it if it works: Download MIDI for the DAW, Copy notes for the note names as text, then follow the two next-step links under the roll.
  1. 选调性。十二个调从 C 到 B;主音落在 MIDI 的 60(C)到 71(B),也就是 C4 那个八度。
  2. 选音阶:大调、小调、五声、小调五声、布鲁斯、多利亚、混合利底亚。选择器下面那行字说明每种音阶的性格,卷帘里只会出现这套音。
  3. 用滑杆设速度,范围 60 到 180 BPM。旋律按这个值排程,一个十六分音符格子等于 60 / 速度 / 4 秒。
  4. 设小节数,2 到 8。网格变成"小节 × 16 个十六分音符格子"。
  5. 选音色:钢琴、拨弦、氛围垫、贝斯。这只改变合成器的发声方式,从不改变音符。
  6. 点"生成旋律"(或者拖动任意滑杆)。每点一次就换一个随机种子,卷帘重画。
  7. 点一次"播放"。浏览器在你点击前不会出声,所以第一次点击既创建音频上下文也开始播放。"循环"会重复这条线,"停止"取消。
  8. 好用就留下:下载 MIDI 给 DAW,复制音符拿到音名文本,再点卷帘下方两个"下一步"链接。

What the engine actually does引擎到底在做什么

The generator is a seeded random walk over scale degrees, not a learned model. Each note is one of seven degrees in your scale (five in the pentatonic sets), and movement is chosen from a fixed table of small intervals, clamped so the line never leaves the scale's range. The full rule set, in order:

生成器是对音阶级数做的一次带种子的随机游走,不是学出来的模型。每个音符是你所选音阶的七个级数之一(五声音阶是五个),移动方向来自一张固定的小幅度间隔表,并被夹住,保证旋律始终不超出音阶范围。完整规则如下:

  • Seed. A small 32-bit PRNG is seeded from the clock on every run, so the same settings never repeat, and the same seed would.
  • Step weights. The engine draws a random number and moves −3 degrees 5% of the time, −2 for 14%, −1 for 24%, stays put 19%, +1 for 24%, +2 for 10% and +3 for 4%. Near the bottom or top of the scale it adds a 60% chance of a corrective step inward, which keeps the melody from sticking to the edge.
  • Rhythm. Every bar is sixteen steps. A note lasts 8 steps about 10% of the time, 4 steps about 35%, 2 steps about 30%, 1 step otherwise; a 12% chance inserts a one-step rest. The last note of the passage is forced onto the tonic.
  • Register. 30% of notes jump up an octave. This is why the piano roll shows isolated high notes that are still inside the scale.
  • Synthesis. Piano is a triangle plus a sine at double frequency, pluck is a sawtooth through a 2.4 kHz lowpass, pad is two sawtooths detuned by 0.7%, bass is a sine one octave below. Every voice gets the same envelope: a 12 ms attack and an exponential release.
  • Export. MIDI is a format 0 Standard MIDI File, 480 ticks per quarter note, 120 ticks per sixteenth, with a tempo event and acoustic-grand program change. Note velocity is fixed at 96 on channel 0.
  • 种子。一个 32 位小随机数生成器,每次运行都用时钟做种子,所以同样的设置不会重复,而同样的种子会给出同一结果。
  • 步进权重。引擎取一个随机数:5% 走 −3 级、14% 走 −2 级、24% 走 −1 级、19% 原地、24% 走 +1 级、10% 走 +2 级、4% 走 +3 级。接近音阶上下缘时,还会额外有 60% 的概率向内修正一步,避免旋律黏在边缘。
  • 节奏。每小节十六格。音符持续 8 格约 10%,4 格约 35%,2 格约 30%,其余 1 格;另有 12% 的概率插入一格休止。整段的最后一个音符强制落在主音上。
  • 音区。30% 的音符会往上跳一个八度。这就是卷帘里那些孤立的高音——它们仍在音阶之内。
  • 合成。钢琴是三角波加一个双倍频率的正弦;拨弦是锯齿波过 2.4 kHz 低通;氛围垫是两个差 0.7% 的锯齿波;贝斯是低一个八度的正弦。所有音色共用同一套包络:12 毫秒起音,指数衰减。
  • 导出。MIDI 是 format 0 标准文件,每四分音符 480 tick,每个十六分音符 120 tick,带 tempo 事件和大钢琴音色切换。0 通道固定力度 96。

The lyric-fit mode is a second generator. Give it one syllable count per line and it places one note per syllable: a line of 8 or fewer syllables gets 16 grid steps, a longer line gets 32, each note lasts floor(steps / syllables) and the last note of every line snaps back to the tonic. That is why a fitted melody often feels square — it is literally a metronome of syllables.

歌词适配是另一套生成器。给它每行一个音节数,它就每个音节放一个音符:8 音节以内的行给 16 格,更长的行给 32 格,每个音符持续 floor(格数/音节数),每行最后一个音回到主音。所以适配出来的旋律经常显得方正——它本质上就是"音节节拍器"。

Options explained参数说明

Key调性

Twelve chromatic keys. The tonic is MIDI 60 + the key's index, so C sits at 60 (C4) and B at 71 (B4). Changing the key transposes everything: the interval shape stays identical, only the pitch and the note names change.

十二个半音调。主音等于 MIDI 60 加调的位置,所以 C 在 60(C4),B 在 71(B4)。换调等于整体移调:音程形状完全不变,只有音高和音名变。

Scale音阶

Seven scales with fixed semitone offsets: major 0-2-4-5-7-9-11, minor 0-2-3-5-7-8-10, pentatonic 0-2-4-7-9, pentMinor 0-3-5-7-10, blues 0-3-5-6-7-10, dorian 0-2-3-5-7-9-10, mixolydian 0-2-4-5-7-9-10. Pentatonic lines have only five degrees, so they leap less and sound folkier; blues adds a flat 5 that makes every line a little tense.

七套音阶,半音偏移固定:大调 0-2-4-5-7-9-11、小调 0-2-3-5-7-8-10、五声 0-2-4-7-9、小调五声 0-3-5-7-10、布鲁斯 0-3-5-6-7-10、多利亚 0-2-3-5-7-9-10、混合利底亚 0-2-4-5-7-9-10。五声只有五个级数,跳进更少、民谣感更强;布鲁斯多一个降 5 音,每条线都带一点紧张。

Tempo速度

60 to 180 BPM, in 1 BPM steps. Tempo changes playback length, not the notes: the same grid is squeezed or stretched. One sixteenth is 60 / tempo / 4 seconds, so 120 BPM gives 125 ms per step and an eight-second four-bar phrase.

60 到 180 BPM,每档 1 BPM。速度只改变播放时长,不改音符:同一张网格被压缩或拉长。一个十六分音符等于 60 / 速度 / 4 秒,所以 120 BPM 时每格 125 毫秒,四小节就是八秒。

Bars小节

Two to eight bars, each sixteen sixteenths. Fewer bars give you a hook fragment, more bars give you a phrase with room for a rise and a fall. Every press of Generate re-seeds the random walk, so pressing it again is the way to ask for a different idea — there is no separate Surprise button, and none is needed.

两到八小节,每小节十六个十六分音符。小节少,得到的是 hook 碎片;小节多,才有起和落的空间。每按一次「生成旋律」都会重新取种子,所以想换一个思路,再按一次就是——不需要另设一个「随机」按钮。

Instrument音色

Four voices, all synthesised live: piano (triangle plus sine), pluck (filtered sawtooth), pad (two detuned sawtooths), bass (sine an octave lower). The choice never changes which notes are generated, only how they sound. Pad and bass hide short notes; pluck exposes them.

四种音色,全部实时合成:钢琴(三角波加正弦)、拨弦(过滤后的锯齿波)、氛围垫(两个失谐锯齿波)、贝斯(低一个八度的正弦)。它不改变生成哪些音符,只改变听感。氛围垫和贝斯会盖住短音符,拨弦则会把短音符暴露出来。

Contour轮廓

There is no contour or rhythm-pattern control, and this page will not pretend otherwise. The shape of the line comes out of the step table and the seed, which is exactly why you regenerate rather than fine-tune. If you want a rising phrase, generate a handful and keep the one that rises.

这里没有"轮廓"或"节奏型"这类参数,本页也不会假装有。旋律的形状由步进权重表和种子决定,这正是要反复生成、而不是精细调节的原因。想要上扬的乐句,就连生成几条,留下真正上扬的那条。

A complete worked example一个完整的实例

Settings: Key G · Scale mixolydian · 120 BPM · 4 bars · Pluck. One real run from this build produced 31 notes across 64 sixteenth steps, using durations of 1, 2, 4 and 8 steps. The first events, as the piano roll draws them:

参数:调性 G · 音阶 混合利底亚 · 120 BPM · 4 小节 · 拨弦。当前版本真实运行的一次,在 64 个十六分音符格子里生成了 31 个音符,用到 1、2、4、8 格四种时值。卷帘画出来的开头几个事件是:

G mixolydian (G A B C D E F) · 120 BPM · 4 bars
31 notes / 64 steps · durations 1, 2, 4, 8

step  0   A4   dur 1
step  1   G4   dur 2
step  3   A4   dur 1
step  4   B5   dur 4   octave jump
step  8   B5   dur 1
step  9   G4   dur 2
step 11   A5   dur 2   octave jump
step 14   B4   dur 1
step 15   G4   dur 1
step 16   A4   dur 4
...                       (23 more notes)
final note forced to G4, the tonic

Read it honestly. The line opens with a two-semitone walk (A4, G4, A4), then leaps an octave to B5 and holds for a beat — an audible, slightly comic jump. Two of the first ten events are octave jumps, and the phrase keeps returning to G. At 120 BPM those 64 steps last 8.0 seconds, and the summary under the roll reports 2.0 s because it divides by sixteen rather than by four; trust the bar count and the DAW tempo, not that number.

如实读一下。开头是两个半音的小走位(A4、G4、A4),然后直接跳到高八度的 B5 并停一拍——一个听得见、甚至有点滑稽的跳跃。前十事件里有两处八度跳,整句还不断回到 G。按 120 BPM,这 64 格实际持续 8.0 秒,而卷帘下面那行摘要写的是 2.0 秒,因为它按除以十六算而不是除以四;请相信小节数和 DAW 里的速度,别信那个数字。

What I would do with it: keep the first four events, they are stepwise and singable; regenerate until the octave jumps land on a bar line rather than mid-phrase; then export MIDI, add a pad chord per bar from Chord Mood Map, and change the pluck to piano in the DAW. The melody is a sketch, and the sketch is the useful part.

我会怎么用它:保留开头四个事件,它们是级进的、能唱的;反复生成,直到八度跳落在小节线上而不是句中间;然后导出 MIDI,用和弦情绪图每小节垫一个和弦,再在 DAW 里把拨弦换成钢琴。旋律只是草稿,而草稿才是它有用的地方。

Making the output better让结果更好用

  • Generate five to ten times before you judge the tool. The step table allows a 9% chance of a three-degree leap, and those runs are the ones that sound random.
  • Start with pentatonic when you want something immediately singable; it limits leaps to five degrees and almost never produces a wrong-sounding interval.
  • Audition at 70–90 BPM. Slow playback exposes awkward intervals that fast playback hides.
  • Keep two bars for a hook and six to eight bars for a verse. Four bars is the awkward middle for most drafts.
  • Loop while you write the chord part. Hearing the same line fifteen times tells you which notes are structural and which are filler.
  • When you fit to lyrics, fix the syllable counts first. A line that is one syllable off shifts every note after it by a step.
  • 先连生成五到十次再评判这个工具。步进表里有 9% 的概率一次跨三级,听起来"随机"的正是这几条。
  • 想要立刻能唱,从五声音阶开始:它把跳进限制在五个级数内,几乎不会出现听起来错的音程。
  • 用 70–90 BPM 试听。慢速播放会暴露快速播放掩盖掉的别扭音程。
  • hook 留两小节,主歌留六到八小节。四小节在多数草稿里是最尴尬的中间值。
  • 写和弦声部时开着循环。同一条线听十五遍,你就知道哪些音是结构音、哪些是填充音。
  • 用歌词适配前先把音节数改对。差一个音节,后面每个音符都会顺移一格。

FAQ常见问题

Why is there no sound when I press Play?点播放为什么没有声音?

Browsers block the Web Audio API until you interact with the page, and the first click on Play is what creates the audio context. If silence continues, check that the tab and system output are not muted, and that another app is not holding the audio device.

浏览器在你与页面交互前会拦截 Web Audio,第一次点"播放"才是创建音频上下文的动作。如果仍然没声音,检查标签页和系统输出是否静音,以及是不是别的程序占着音频设备。

Why does the melody sound robotic?旋律为什么听起来很机械?

Every note is one or two oscillators with a fixed envelope: triangle plus sine at double frequency for piano, a filtered sawtooth for pluck, two sawtooths detuned by 0.7 percent for pad, and a sine an octave lower for bass. There is no velocity, no vibrato, no reverb and no humanisation.

每个音符都是一到两个振荡器加一套固定包络:钢琴是三角波加双频正弦,拨弦是过滤后的锯齿波,氛围垫是两个差 0.7% 的锯齿波,贝斯是低八度的正弦。没有力度变化、没有揉弦、没有混响,也没有任何人性化处理。

Can I download an MP3 or WAV file?可以下载 MP3 或 WAV 吗?

No. The only file export is MIDI — a format 0 Standard MIDI File at 480 ticks per quarter note — which you import into a DAW to render with real instruments and add effects. Copy notes gives you the note names as text.

不能。唯一的文件导出是 MIDI——每四分音符 480 tick 的 format 0 标准文件——导进 DAW 才能用真实音色渲染并加效果。"复制音符"给你的是音名文本。

Does it write chords or a full arrangement?会写和弦或完整编曲吗?

No. The output is one monophonic line for a single instrument, plus a piano-roll view. Chords are not generated; use Chord Mood Map to pick a progression and build harmony around the exported MIDI.

不会。输出只有一条单声部旋律线和一张卷帘视图,不生成和弦。先用和弦情绪图选一套进行,再围绕导出的 MIDI 搭和声。

Is every generated melody different?每次生成的旋律都不同吗?

Yes. Each generation draws a new random seed, so the same key, scale, tempo and bar count produce a different line every time. The engine is deterministic for a given seed, but the page has no seed field, so download the MIDI if you want to keep one.

是的。每次生成都取一个新种子,所以同样的调性、音阶、速度和小节数,每次给出的旋律都不同。引擎对固定种子是确定的,但页面没有种子输入框,想留住某一条就下载 MIDI。

Can I use these melodies commercially?这些旋律可以商用吗?

Yes. The notes come from arithmetic rules, not from samples of any recording, so the output is yours to use. Two procedural melodies can still resemble an existing tune by coincidence, so check before release.

可以。音符来自算术规则,不采样任何录音,输出归你使用。不过两条程序生成的旋律仍可能碰巧像某首现成的歌,发布前请自行核查。

Where to go next接下来去哪

We use cookies to make the site work and to show personalised Google ads. Read our Privacy Policy to learn more. Privacy Policy