きょうのMML - MMLでサンプリング音声

音質が超良くなりました! 矩形波 + 一番低い音 + エンベロープ0,127,127,0 が決め手です!

  • t20000 l120 で音符を並べると 10,000Hz のサンプリングに相当
  • 極端な音長設定で音を鳴らす場合、最後に普通の音符 (ここでは t120o4r4c4) を置かないと音が出なかったりする場合がある
  • mmlのデータサイズに制限があるらしい。リピートや音符の長さをうまく使って圧縮すればもっと高ビットレートにできる
  • 音質を上げようとしてディザリングとかしたら音符が増えすぎて再生できなくなった。とりあえずMMLのバッファがもっと欲しい!
  • 下のサイン波の例では 40,000Hz で音を出している

MML化された「ジャンボ!」と叫んだ声のサンプリング音声

t20000 l120 @3 q16 @e1,0,127,127,0 o0
v8c24v7c20v8cv7cv8c6v8c20v7cv8c24
v7c30v8cv7cv8cv7c24v8cv7cv8cv7c30v8cv7c40v8cv7cv8cv7cv8cv7c60v8cv7cv8cv7cv9cv7cv8cv7cv8cv7cv8c
v7cv8c24v9cv7cv8cv7cv9cv7cv9cv7cv9cv7cv8cv7cv8cv7cv9cv7cv8cv7cv8cv7c13v7c40v8cv7c60v8cv7cv8c
v7c15v8cv6cv7cv8cv7cv8cv7c60v8cv7c60v8cv7cv8cv7cv8c60v7cv8c12v7cv8cv7c
v8c60v7cv8cv7cv8cv7cv8c60v7cv8c60v7cv8cv7cv8c60v7cv8cv6cv8cv7c60v8cv7c60v8cv7cv8cv7c60v8cv7c60v8cv7c60v8cv6cv8cv7c
v8cv7cv8cv7c60v8cv7cv8cv7cv8cv7cv8cv7cv8c24v7cv8c40v7cv8c40v7cv9cv7cv8c40v7c60v8c60v7cv8cv7c
v8c60v7c60v8cv6cv7c60v8cv7cv8c60v7c40v8cv7cv8c60v7cv8cv7cv8cv7c40v8cv7c60v8cv7cv8c60v6cv9cv5cv10cv6cv9cv6cv10c
v6cv9cv7cv8c60v6cv10cv7c60v8cv6cv8cv6cv8cv7cv8c60v7cv8c60v7cv8cv7cv6cv8c60v7cv8cv7cv10cv7cv8c60v6cv7cv8cv7cv8c60v6c
v10cv6cv7cv8cv6cv8cv6cv8c40v6cv8cv6cv7cv8cv6cv9cv7c60v8c60v7cv8cv7c60v8c60v6cv10cv5cv10cv7cv8cv9cv5cv9cv5cv11cv5cv9c
v8cv6cv10cv4cv11cv4cv9cv8cv5cv10cv6cv10cv6cv8cv7c40v8cv6cv8cv9cv8cv7cv11cv7c20v10cv7cv8cv10cv7cv6cv9cv8cv7cv5c
v8c60v7cv8cv6cv7cv6cv8cv5cv9cv5cv7cv9cv7cv8cv6cv7c60v6cv9cv6cv9cv8cv10cv9cv7c40v9cv6cv8cv7cv9cv8cv7cv11cv8cv7cv8cv6c
v8cv7c60v6cv7cv8cv7c60v6cv7c40v6cv7cv8c40v6cv9cv8cv7c60v9cv8cv6cv9c60v8cv7cv8cv7cv8c60v7cv9cv8c30v6c
v5cv7cv5cv6cv9cv4cv10cv5cv8cv7c60v5cv9cv7cv5cv9cv7cv6cv9cv7cv9cv6cv8cv7cv8cv6cv7c60v6cv7cv8cv9cv8c40v9c60v10cv9cv8c
v9cv10c60v8c30v9cv7c60v6cv7cv8cv6c30v7cv6cv7cv6cv7c60v8cv7c30v8cv7cv6cv7cv6c60v5cv7cv5cv6c60v5c
v7c60v5cv7c60v6cv9cv10cv12c60v14cv13cv12cv13cv12c60v9cv10cv9cv8cv7cv6c60v5c30v4c60v5cv7c40v8cv9c60v10c30
v9cv8cv7cv6cv5cv4cv3c30v4cv3cv4cv5cv6c60v5c60v6cv7c30v9cv10cv12cv14cv15cv13cv12cv14cv15cv13cv8cv7cv9c60v7cv4cv2c
v4cv5c40v3cv5cv8cv10c60v9c60v10cv12cv11cv9cv7c40v8cv6cv3c60v4cv5cv3cv2cv3cv5cv6cv5cv4cv5cv6cv7c60v5cv3cv4cv5cv4c
v6cv8c60v10cv14cv15cv14cv11cv14cv15cv14cv6cv2cv6cv7cv5cv2crv1cv3cv7cv10cv7cv6cv12cv15cv14cv11cv9cv8cv10cv12cv7cv2c60v7cv9cv6cv1c60
v5cv8cv4cv1cv3cv6cv7c60v5c60v6cv8cv6cv3cv1c60v4cv8cv9c60v14cv15c60v12cv14cv15cv14cv5crv1cv4cv3c40v2cv4cv10cv15cv12cv8c
v10cv14c60v10cv4cv3cv6cv7c60v4cv3cv6cv12c60v6cv2cv4cv7cv5cv1c60v4cv6c60v8c60v6c40v5cv1crv2cv10cv13cv11cv14cv15c60
v12c60v15cv11cv3crv1cv3cv2cv5cv9cv7cv6cv12cv15cv14cv9cv6cv9cv10cv5cv3c40v6cv9cv10cv8c60v12cv14cv10cv2crv1c40rv3cv6cv7c
v11cv13cv8cv3cv2c60v1crv1cv10cv14c60v15c40v10c60v13cv9cv1crv1cv3c60v9cv13cv9c60v13cv15cv14cv8cv3cv5c60v2cv3c60v4cv7c
v10cv14cv13cv9c60v14cv9cv1cr40v1cv3cv9cv10cv8cv12cv14cv9cv2cr30v3cv12cv14cv15c30v11cv8cv6cv4cr60v1c60v5c
v14cv15cv13cv12cv14cv15cv12cv4cv1c60rv1cv4cv6cv9cv11cv13cv15cv14cv12cv13cv8cv1cr40v1cv3cv8cv14cv13cv14c60v8cv1cr30v4c
v13cv15c30v14cv10cv4cv1cr60v1cv2cv3cv11cv15c60v14cv13c60v12cv7cv2cr40v2cv6cv9cv13cv14c40v11cv10c60v5cv1c
r40v4cv9cv13cv14cv12c40v6cv1cr40v1cv7cv14cv15c30v11cv5cv1cr40v2cv5cv9cv14cv15c60v14cv13cv10cv8cv3cr40
v1cv5cv8cv12cv14cv15cv14cv11cv8c60v10cv4cr40v1cv7cv13cv15cv14cv10cv8c60v3cr30v3cv13cv15c30v13cv4cv1c60v2cv1c
v3cv4cv5cv12cv15c40v13cv9cv6cv2cv1cv2cv1crv2cv5cv9cv13cv15cv14cv12cv8cv6cv8cv7cv1cr40v2cv10cv15c60v12cv8cv6cv2c
r30v1cv8cv14cv15c40v14cv6cr60v2cv5cv8c60v6cv8cv12cv15c40v13cv8cv2crv1cv2cv3cv5c40v8cv11cv13cv14cv12cv9cv8cv5c
v1cr40v1cv5cv12cv15cv14cv12cv8cv3cr30v1cv9cv14cv15c40v14cv7cv1crv1cv5cv9cv10cv8cv7cv8cv10cv14cv15c60v12cv7cv2c
rv1cv2cv5cv7c40v8c60v10cv11cv13c60v10cv3cr40v1cv5cv11cv14cv13cv10cv6cv3cv1cr40v1cv9cv15c30v14cv7cv1cr
v1cv6cv12cv14cv12cv8cv5cv4cv7cv12cv15c60v13cv7cv2cr60v2cv6cv9cv10cv9cv7cv5c60v9cv12cv13cv10cv4cv1cr60v1cv7cv12cv13cv11cv7cv2c
r40v1cv4cv11cv15c24v10cv4cv1c60v4cv9cv12c60v11cv8cv5c60v7cv10cv13cv14cv13cv10cv6cv2cv1cv2cv5cv7cv9c60v8cv6cv5c
v7cv8c40v6cv4cv2c60v3cv6cv7cv8c60v6cv3cv1cr60v1cv5cv11cv15c30v13cv10cv7cv6cv7cv9cv11cv12cv11cv9cv6cv3c60v5cv8c
v10cv12c60v10cv8cv6cv5c60v7cv8cv9c60v8cv6cv4cv3c60v4cv5c60v6cv7c40v8c40v7cv6cv5cv4cv3c40v4cv5cv7cv8cv9cv8c
v7cv6cv7cv8cv10cv12cv14cv15c60v14cv13cv10cv9c60v10cv11cv12c60v11cv9cv7cv5c40v6cv7c30v6cv4c24v5cv6c60v7c60
v6cv5cv4c30v5c60v6cv5c60v4c60v5cv7cv8c60v9cv10cv11c60v12cv13cv14cv15c40v14cv12cv11c24v10cv9cv7cv6cv5c
v4c60v5c24v4c30v5c60v6c8v6c15v5c60v4cv3cv4cv6cv7cv8cv9cv10c30v11c
v12cv13cv15c40v14cv12cv11c40v10c40v9cv7cv6cv5cv4c30v5c40v6c60v5c20v6c40v7c40
v6c30v5cv6c24v5c60v6cv7cv8cv9c60v10c60v9cv10c60v11cv12cv13cv14c60v13cv12cv11cv10c60v9c30v8cv7cv6c60
v5c8v6c12v7c60v8c40v7c60v6c40v7cv8cv9cv10c40
v9c30v10cv11c60v12c60v11cv10c60v9c17v9cv8cv7cv6c60v5c60v6c20v5c60v4c60v5c60v6c60
v7c40v6c24v7cv8c24v7c30v8c13v8c40v9c40v8cv9c24v10c60
v9c15v8c40v7cv8c20v7c60v6c60v5c15v4c40v5c30v6c60v7c30
v8c40v9c4
v8c12v7c30v6c30v5c24v4c24v5c30v6c60v7c40v8c40v9c40
v10c12v9c30v8c24v7c10v7c12v8c12
v7c10v6c7v6cv7c30v8c30v9c24
v10c17v10cv9c30v8c40v7c24v6c13v6c40v7c17v7cv8c40
v9c15v8c13v8c40v7c30v6c24v5c20v6c24v7c40v8c40
v9c30v10c12v9c30v8c40v7c40v6c24v5c30v6c20
v7c30v8c24v9c12v8c20v7c17v7c
v6c9v6c40v7c30v8c24v9c10v8c30v7c17v7c
v6c10v5c30v7cv8cv10cv12cv14c60v13c60v11cv9cv7c30v8cv9c40v8cv7cv5cv4cv3cv4cv5cv7cv8cv10c
v11c40v9cv7cv6cv5cv4c40v5cv6cv7c24v6c60v7c60v8cv9c60v10c60v11c60v10cv9cv8cv6cv5cv4cv3c60v4cv5cv7cv8cv9c
v10c60v9c60v8c24v9cv10c60v9c60v8cv7cv5c60v4c60v6cv8cv10cv12cv14c60v13c60v10cv6cv4cv3cv2c60v3cv5cv6cv7cv8c60
v7c40v6c60v7cv8c60v9cv10cv9c60v7cv6cv4cv3c40v4cv6cv8cv10cv11cv12c60v11c60v10cv8c60v7c30v8c17v8c
v9c40v8c60v7cv6cv5cv4c60v5c60v6cv7c60v8c60v9c30v10cv9c30v8cv7c60v6cv5c60v4c60v6cv8cv9cv12cv13cv14c
v13cv12cv9cv7cv4cv3cv2c60v3cv4cv6cv8cv9cv10cv9c60v8c60v7c60v8c60v9c40v8cv7cv6cv5cv4cv3cv4cv5cv7cv9cv11cv12cv13cv12cv11c
v10cv8cv7cv5c60v4c60v5cv6cv7cv8c12v9c30v8cv7cv5cv4cv3c60v4cv5cv7cv9cv11cv12c60v11cv10cv9c
v7cv6cv5c40v6cv7c60v8c30v7c60v6cv5cv6cv7cv9cv10cv12cv14cv12cv11cv10cv6cv3cv2cv1c60v3cv6cv8cv11cv13c40v11cv10cv7c
v5c60v4cv5cv6cv8c60v9c60v8cv7cv6cv5c40v6cv7cv9cv10c60v11cv10cv8cv7cv5cv4cv3c60v4cv6cv7cv9cv10cv11c60v10cv9cv8cv7c
v6c30v7cv8c60v9c60v8c60v7c24v8c40v9c60v8c60v7cv6c30v7c60v8c60v9c40v8c60v7c60
v6c30v7c60v6cv7c60v8cv9cv10cv11c40v9cv8cv6cv4c60v3cv4cv5cv6cv7cv9cv10c40v9cv8c60v7c24v8c30
v7c60v6c40v7c60v8cv9cv10c40v9cv8cv7cv6cv5c30v6cv7cv8cv9cv10c60v9c60v8cv7cv6c30v7cv8c60v9c60v8cv7c
v6c60v5c60v6cv7cv8cv9cv10c40v9cv8cv7c60v6c40v7c60v8c24v7cv6c60v7c60v8cv10cv11c40v10cv8cv6cv5cv4c
v3cv4c60v6cv8cv9cv10cv11c60v10cv9cv8cv7cv6cv5cv6c60v7cv8c24v7cv6c40v7cv8c60v9cv10c60v9c60v7cv6c
v5c30v6cv7cv8cv10c60v11cv10c60v8cv7cv6c24v7cv8c20v7c40v8c40v9c60v8c40v7c60v6c30
v7c60v8c20v7c15v8c17v8cv7cv8c24v7c30v8c60v9c30
v8c60v7cv6c24v7cv8c60v9c30v8c60v7c60v6c60v7c40v8c40v7c20v8c40v9c60v8c60
v7c60v6c30v7c60v8cv9c24v8cv7c60v6c60v7c40v8c24v7c20v8c60v9c60v8c40
v7c20v8c12v9cv8cv9cv8cv7c40v6c30v7cv8c60v9c30v8c60
v7c13v7c40v8cv7c24v8c15v7c60v6c30v7c60v8c60v9c30v8c60
v7c17v7cv8c20v7cv8c15v7c15v8c15v7c15
v8c15
t120o4r4c4

MML化された1kHzのサイン波のサンプル

t80000 l120 @3 q16 @e1,0,127,127,0 o0
/:4000
  v8cv8cv10cv11cv12cv13cv13cv15cv14cv15c
  v15cv15cv15cv14cv14cv12cv13cv10cv11cv7c
  v9cv5cv7cv2cv5cv0cv4cv0cv1cv0c
  v0cv0cv0cv1cv1cv3cv2cv5cv4cv8c
:/

ちゃんとサンプリングレート40kHzで再生された場合、4秒間音が出る筈。
FlashのActionScriptって思ってたより早そうだなあ。