;; SameTime2.cal ;; (Check the Same Controllers & Wheels on the Same Time II) ;; Written By 蛞蝓なめちゃん, 2004/02/17 ;; odasan@ma.catv.ne.jp ;; 機 能 : 同一タイミングで重複しているコントローラがあれば ;; 警告メッセージを出します。 ;; 同一タイミングで重複しているピッチベンドも警告します。 ;; 使用法 : 対象範囲の音を選択して、本 program を実行します。 ;; 現在何番のコントローラを処理中かが、 ;; ウィンドウ下のステータスバーに表示されます。 ;; 重複イベントを発券するとステータスバーに表示します。 ;; インプットメッセージで 0 を入れると削除。 ;; 0 以外は何もせず次を検索します。 ;; 注 意 : クリップにまたがった範囲指定をすると、うまく動作しないことがあ ;; ります。トラックごとにクリップを結合してから実行しましょう。 ;; 重複している最初のイベントは削除できません。 ;; ふたつめ以降が削除対象になります。 ;; 3つ以上重なっていると、同じ警告が2回以上表示されます。 ;; UNDO : forEachEvent をやりなおせば Wheel は復帰しますが、 ;; Controller は127回戻さないと完全には戻りません。 (do (int cont 0) ;; controller number (int M) ;; mesure (int B) ;; beat (int T) ;; tick (dword pos) ;; posision (initial value=max) (int delflag) ;; 0 then delete (int val) ;; Value (int chan) ;; Channel ;; CHECK CONTROLLERS (while (<= cont 127) (do (message "Now Checking cc#" cont) (= pos 4294967295) (forEachEvent (if (&& (== Event.Kind CONTROL) (== Control.Num cont)) (if (== Event.Time pos) (do (= M (meas pos)) (= B (beat pos)) (= T (tick pos)) (= val Control.Val) (= chan Event.Chan) (message M ":" B ":" T ", ch = " chan ", cc# " cont " = " val) (getInt delflag "DELETE=0" 0 127) (if (== delflag 0) (delete) ) ) (= pos Event.Time) ) ) ) (+= cont 1) ) ) ;; CHECK WHEELS (do (message "Now Checking wheels") (= pos 4294967295) (forEachEvent (if (== Event.Kind WHEEL) (if (== Event.Time pos) (do (= M (meas pos)) (= B (beat pos)) (= T (tick pos)) (= val Wheel.Val) (= chan Event.Chan) (message M ":" B ":" T ", ch = " chan ", Wheel =" val) (getInt delflag "DELETE=0" 0 127) (if (== delflag 0) (delete) ) ) (= pos Event.Time) ) ) ) ) )