﻿OtoMotion sample scene - XPression bindings and scripts
OtoMotion サンプルシーン - XPression のひも付けとスクリプト
============================================================
Object names are up to you. Only the DataLinq Column / Row must match OtoMotion's keys exactly.
オブジェクト名は自由。DataLinq の Column / Row だけは OtoMotion のキー名と一字一句同じにする。

[1] Text objects (display) - bind only, no script / テキスト（表示用）- ひも付けだけ
    object       Column   Row
    g1_name      g1       name
    g1_m         g1       m
    g1_s         g1       s
    g1_tp        g1       tp
    g1_i         g1       i
    g1_diff_i    g1       diff_i
    g1_lra       g1       lra
    g1_tpmax     g1       tpmax
    g1_s_big     g1       s
    bpm          beat     bpm
    elapsed      (empty)  elapsed

[2] Drivers - hidden text objects (Alpha 0) that receive a value and move a quad
    ドライバー - 値を受けて四角を動かす見えないテキスト（Alpha 0）
    object       Column   Row          moves
    g1_mbar      g1       mbar         M      (ScaleX, pivot at left)
    g1_sbar      g1       sbar         S      (ScaleX, pivot at left)
    g1_pk_l      g1       pk_l         PK_L   (ScaleX, pivot at left)
    g1_pk_r      g1       pk_r         PK_R   (ScaleX, pivot at left)
    g1_tpover    g1       tpover       TP OVER (Visible)
    g2_mbar      g2       mbar         LOW    (ScaleY, pivot at bottom)
    g3_mbar      g3       mbar         MID    (ScaleY, pivot at bottom)
    g4_mbar      g4       mbar         HIGH   (ScaleY, pivot at bottom)
    beat_count   beat     beat_count   dot_1 - dot_4 (Visible)

[3] Scripts - paste into each driver's Script Editor, event OnSetText
    スクリプト - 各ドライバーの Script Editor の OnSetText に貼る

---------- g1_mbar ----------
dim bar as xpBaseObject
dim v as Double
Scene.GetObjectByName("M", bar)
v = text / 1
bar.scaleX = v
bar.Visible = (v > 0)

---------- g1_sbar ----------
dim bar as xpBaseObject
dim v as Double
Scene.GetObjectByName("S", bar)
v = text / 1
bar.scaleX = v
bar.Visible = (v > 0)

---------- g1_pk_l ----------
dim bar as xpBaseObject
dim v as Double
Scene.GetObjectByName("PK_L", bar)
v = text / 1
bar.scaleX = v
bar.Visible = (v > 0)

---------- g1_pk_r ----------
dim bar as xpBaseObject
dim v as Double
Scene.GetObjectByName("PK_R", bar)
v = text / 1
bar.scaleX = v
bar.Visible = (v > 0)

---------- g1_tpover ----------
dim box as xpBaseObject
Scene.GetObjectByName("TP OVER", box)
box.Visible = (text = "1")

---------- g2_mbar ----------
dim bar as xpBaseObject
dim v as Double
Scene.GetObjectByName("LOW", bar)
v = text / 1
bar.scaleY = v
bar.Visible = (v > 0)

---------- g3_mbar ----------
dim bar as xpBaseObject
dim v as Double
Scene.GetObjectByName("MID", bar)
v = text / 1
bar.scaleY = v
bar.Visible = (v > 0)

---------- g4_mbar ----------
dim bar as xpBaseObject
dim v as Double
Scene.GetObjectByName("HIGH", bar)
v = text / 1
bar.scaleY = v
bar.Visible = (v > 0)

---------- beat_count ----------
dim d1 as xpBaseObject
dim d2 as xpBaseObject
dim d3 as xpBaseObject
dim d4 as xpBaseObject
Scene.GetObjectByName("dot_1", d1)
Scene.GetObjectByName("dot_2", d2)
Scene.GetObjectByName("dot_3", d3)
Scene.GetObjectByName("dot_4", d4)
d1.Visible = (text = "1")
d2.Visible = (text = "2")
d3.Visible = (text = "3")
d4.Visible = (text = "4")

[4] Colors / 色（OtoMotion の画面と同じ）
    M #F24028   S #FF8A70   PK_L / PK_R #FFD23F   LOW / MID / HIGH #B04DFF   TP OVER #D9202A   dots #F24028
    Gradient textures / グラデーションのテクスチャ: textures/*.png

[5] OtoMotion settings used in the sample / サンプルで使った OtoMotion の設定
    Groups: 4 / 系統の数 4
    g1 MAIN MIX  band full    g2 LOW band low    g3 MID band mid    g4 HIGH band high
    All groups use the same input channels (e.g. L1 / R1 for a mono mic)
    全系統で同じ入力（モノラルのマイクなら L1 / R1）
