やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

LMMS 1.1.3 のプロジェクトファイル形式を確認する(mmpz, mmp)

 バイナリとXMLの2種類あった。

ファイル形式

名前 形式 補足
mmpz バイナリ mmpの圧縮形式?
mmp テキスト XML形式
mpt テキスト mmpと同じ内容。テンプレートらしいが。

内容

 前回作ったXML形式のファイル内容は以下。

CDEF.mmp

<?xml version="1.0"?>
<!DOCTYPE lmms-project>
<lmms-project version="1.0" creator="LMMS" creatorversion="1.1.3" type="song">
  <head timesig_numerator="4" mastervol="100" timesig_denominator="4" bpm="140" masterpitch="0"/>
  <song>
    <trackcontainer width="600" x="5" y="5" maximized="0" height="300" visible="1" type="song" minimized="0">
      <track muted="0" type="0" name="TripleOscillator" solo="0">
        <instrumenttrack pan="0" fxch="0" pitchrange="1" pitch="0" basenote="57" vol="100">
          <instrument name="tripleoscillator">
            <tripleoscillator phoffset2="0" userwavefile0="" finer0="0" userwavefile1="" finer1="0" userwavefile2="" finer2="0" coarse0="0" coarse1="-12" coarse2="-24" finel0="0" finel1="0" modalgo1="2" modalgo2="2" finel2="0" pan0="0" modalgo3="2" pan1="0" stphdetun0="0" pan2="0" stphdetun1="0" wavetype0="0" stphdetun2="0" wavetype1="0" wavetype2="0" vol0="33" vol1="33" phoffset0="0" phoffset1="0" vol2="33"/>
          </instrument>
          <eldata fres="0.5" ftype="0" fcut="14000" fwet="0">
            <elvol lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
            <elcut lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
            <elres lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
          </eldata>
          <chordcreator chord="0" chordrange="1" chord-enabled="0"/>
          <arpeggiator arptime="100" arprange="1" arptime_denominator="4" syncmode="0" arpmode="0" arp-enabled="0" arp="0" arptime_numerator="4" arpdir="0" arpgate="100"/>
          <midiport inputcontroller="0" fixedoutputvelocity="-1" inputchannel="0" outputcontroller="0" writable="0" outputchannel="1" fixedinputvelocity="-1" fixedoutputnote="-1" outputprogram="1" basevelocity="63" readable="0"/>
          <fxchain numofeffects="0" enabled="0"/>
        </instrumenttrack>
        <pattern steps="16" muted="0" type="1" name="TripleOscillator" pos="192" len="192">
          <note pan="0" key="48" vol="100" pos="0" len="48"/>
          <note pan="0" key="50" vol="100" pos="48" len="48"/>
          <note pan="0" key="52" vol="100" pos="96" len="48"/>
          <note pan="0" key="53" vol="100" pos="144" len="48"/>
        </pattern>
      </track>
      <track muted="0" type="2" name="Sample track" solo="0">
        <sampletrack vol="100">
          <fxchain numofeffects="0" enabled="0"/>
        </sampletrack>
      </track>
      <track muted="0" type="1" name="beat/bassline 0" solo="0">
        <bbtrack>
          <trackcontainer width="578" x="610" y="5" maximized="0" height="300" visible="1" type="bbtrackcontainer" minimized="0">
            <track muted="0" type="0" name="Kicker" solo="0">
              <instrumenttrack pan="0" fxch="0" pitchrange="1" pitch="0" basenote="57" vol="100">
                <instrument name="kicker">
                  <kicker decay_numerator="4" decay_denominator="4" distend="0.8" click="0.4" endnote="0" version="0" decay="440" syncmode="0" noise="0" slope="0.06" dist="0.8" env="0.163" startnote="1" startfreq="150" endfreq="40" gain="1"/>
                </instrument>
                <eldata fres="0.5" ftype="0" fcut="14000" fwet="0">
                  <elvol lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
                  <elcut lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
                  <elres lspd_denominator="4" sustain="0.5" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="0" latt="0" rel="0.1" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4"/>
                </eldata>
                <chordcreator chord="0" chordrange="1" chord-enabled="0"/>
                <arpeggiator arptime="100" arprange="1" arptime_denominator="4" syncmode="0" arpmode="0" arp-enabled="0" arp="0" arptime_numerator="4" arpdir="0" arpgate="100"/>
                <midiport inputcontroller="0" fixedoutputvelocity="-1" inputchannel="0" outputcontroller="0" writable="0" outputchannel="1" fixedinputvelocity="-1" fixedoutputnote="-1" outputprogram="1" basevelocity="63" readable="0"/>
                <fxchain numofeffects="0" enabled="0"/>
              </instrumenttrack>
              <pattern steps="16" muted="0" type="0" name="Kicker" pos="0" len="192"/>
            </track>
          </trackcontainer>
        </bbtrack>
      </track>
      <track muted="0" type="5" name="オートメーショントラック" solo="0">
        <automationtrack/>
      </track>
    </trackcontainer>
    <track muted="0" type="6" name="オートメーショントラック" solo="0">
      <automationtrack/>
      <automationpattern tens="1" mute="0" prog="0" name="Numerator" pos="0" len="192">
        <object id="7023175"/>
      </automationpattern>
      <automationpattern tens="1" mute="0" prog="0" name="Denominator" pos="0" len="192">
        <object id="7323864"/>
      </automationpattern>
      <automationpattern tens="1" mute="0" prog="0" name="テンポ" pos="0" len="192">
        <object id="4333997"/>
      </automationpattern>
      <automationpattern tens="1" mute="0" prog="0" name="マスターボリウム" pos="0" len="192">
        <object id="2576127"/>
      </automationpattern>
      <automationpattern tens="1" mute="0" prog="0" name="マスターピッチ" pos="0" len="192">
        <object id="163527"/>
      </automationpattern>
    </track>
    <fxmixer width="561" x="5" y="310" maximized="0" height="349" visible="1" minimized="0">
      <fxchannel num="0" muted="0" volume="1" name="マスタ">
        <fxchain numofeffects="0" enabled="0"/>
      </fxchannel>
    </fxmixer>
    <ControllerRackView width="258" x="880" y="310" maximized="0" height="154" visible="1" minimized="0"/>
    <pianoroll width="1079" x="5" y="5" maximized="0" height="480" visible="1" minimized="0"/>
    <automationeditor width="860" x="5" y="5" maximized="0" height="480" visible="0" minimized="0"/>
    <projectnotes width="400" x="700" y="10" maximized="0" height="300" visible="0" minimized="0"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'PibotoLt'; font-size:12pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#e0e0e0;">Put down your project notes here.</span></p></body></html>]]></projectnotes>
    <timeline lp1pos="192" lp0pos="0" lpstate="0"/>
    <controllers/>
  </song>
</lmms-project>

 XMLを見れば音楽を構成する要素を読み取れる。たとえば以下。

  • 音符: <note>要素
    • 音長: pos,len属性値

所感

 テキスト形式で出力できるのは素晴らしい。

前回まで

対象環境

$ uname -a
Linux raspberrypi 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux