AKAI MPC 1000 シーケンス ファイル コマンド ライン ユーティリティ
私はよく MPC 1000 をバッキング トラックやドラム ループのプレーヤーとして、音楽を練習したり、すぐにジャムセッションをしたいときに使用します。私は通常、選択した DAW でドラム ループを作成し、さまざまな速度で複数の wav ファイルをエクスポートします。次に、それらのファイルを MPC にコピーし、wav ファイルごとに 1 つのシーケンスを保存します。次回練習やジャムをしたいときは、シーケンスと wav ファイルのフォルダーをすばやくロードするだけで、複数の速度を簡単に切り替えることができます。
MPC 自体ですべてのシーケンスを作成するのは非常に面倒な作業なので、このツールを作成しました。あとは、MPC 上で 1 つの「テンプレート シーケンス」を作成し、それをコンピュータにコピーし、そこからいくつかの (名前を変更した) ファイルを作成するだけです。次に、このツールを使用して、シーケンス ファイルのメタ情報を表示し、AUDIO トラック内のファイル名の置換やシーケンス BPM の置換などの反復的なタスクを実行します。
JJOS を実行している MPC 1000 から作成されたシーケンス ファイル用にこのツールを書きましたが、このツールは MPC 2500 のファイルでも同様に動作すると思います。同じフォーマットを共有していると思います。おそらく MPC 500 のものも機能するでしょうが、それについてはわかりません。これらの MPC モデル ファイルの使用に関するテストやフィードバックをいただければ幸いです。
OS に Python をインストールする手間を省き、最新の開発バージョンを実行することに興味がない場合は、リリース v1.2 以降で利用可能な自己完結型の実行可能ファイルを使用してください: https://github.com/JOJ0/ mpc1k-seq/リリース/タグ/v1.2
seq.exe
をダウンロードします。seq
(新しい MacOS バージョンが動作するかどうかは不明です。問題があれば報告してください)システム上のどこからでもseq
実行できるようにするには、検索される場所に seq をコピーします。
Windows エクスプローラーを使用して、seq.exe ファイルを c:windowssystem32 にコピーします。
これは汚いハックであることに注意してください。これを実行したくない場合、または実行する権限がない場合は、コマンド プロンプトでいつでも seq.exe が保存されている場所に「cd」するだけで、そこから実行できます :-)
seq が保存されているディレクトリ内にいることを確認してください。ユーザーは管理者権限を持っている必要があります。次のコマンドを実行すると、パスワードの入力を求められます。
sudo cp seq /usr/local/bin/
次の章の手順に従ってください。
上で説明したように実行可能ファイルを使用している場合は、この章をスキップしてください
まず、 python --version
を使用して、システムに Python バージョンがすでに存在するかどうかを確認します。
Python 2.7.x が必要です
github リポジトリのクローンを作成し、ディレクトリにジャンプします。
git clone https://github.com/JOJ0/mpc1k-seq.git
cd mpc1k-seq
ここからmsiインストーラーをダウンロードします
クローン作成したリポジトリ ディレクトリをシステム %path% 変数に追加してツールをインストールします。
または、すでにシステム検索パスにあるパスに簡単にコピーします。
copy seq.py c:windowssystem32
Mac OS X 10.11 "El Capitan" には、Python 2.7.6 がプリインストールされた状態で出荷されます。これは、ユーティリティが開発され、テストされたバージョンです。 OX X 10.8 には Python 2.6 が含まれており、おそらくこれも機能するでしょう。 10.9 以降にはすべて 2.7.x が含まれていますが、これで問題ありません。
上記をお持ちでない場合は、ここから最新の 2.7 パッケージをインストールするか、homebrew を使用して入手してください。
ツールをインストールする
cp seq.py /usr/local/bin/
おそらく、すでに実行中の Python バージョンをお持ちでしょう。上記のようにチェックしてください!
最新の Linux ディストリビューションの一部では、デフォルトで Python 3.x がすでに使用されているため、python2 パッケージをインストールする必要があります。
Debian ベースのシステム
apt install python2.7
Redhatベース
yum install python27
そして、この Python バージョン (例: #!/usr/bin/python2.7
) を使用するようにスクリプトの最初の行を設定します。
最後にツールをインストールします
cp seq.py /usr/local/bin/
開発バージョンを使用している場合は、seq の代わりに seq.py を実行する必要があります。さらに、Windows seq.exe は、.exe が終了しなくても実行できることに注意してください。 MacOS 実行可能ファイルは単に seq と呼ばれ、ファイル末尾がありません。
このユーティリティは UNIX スタイルのコマンド ライン ユーティリティとして提供されており、一般的な --help または -h オプションを使用して実行するとすべての機能が表示されます。
seq -h
usage: seq [-h] [--search SEARCHTERM] [--replace REPLACETERM]
[--correct-wav] [--correct-wav-bpm] [--filter BPM_LIST]
[--correct-bpm] [--hex] [--verbose]
path
positional arguments:
path path of *.SEQ files to be processed
optional arguments:
-h, --help show this help message and exit
--search SEARCHTERM, -s SEARCHTERM
search for given string in file contents
--replace REPLACETERM, -r REPLACETERM
replace SEARCHTERM with REPLACETERM
--correct-wav, -w sets basename of .SEQ file to the place where
SEARCHTERM is found. Use this if your seq and wav
files are named identically
--correct-wav-bpm, -p
replace BPM in found SEARCHTERM with BPM found in
filename
--filter BPM_LIST, --bpm BPM_LIST, -b BPM_LIST
historically was used as a space seperated BPM list
but actually it is a simple filter: only filenames
containing one of the strings in the list, will be
processed
--correct-bpm, -c set BPM to the same as in filename
--correct-length, -l set the sequences looplength (bars) to the same as in
filename. Assumes value in filename is marked with
trailing "b" (eg 8b)
--hex, -x show hex values next to decimal and strings
--verbose, -v also show border markers and not yet studied header
information
現在のディレクトリ内のすべての seq ファイルのメタ情報を表示するだけです
seq .
ファイル名に 64 または 512 が含まれるすべての seq ファイルの情報を表示します (通常は BPM 値)
seq -b "64 512" .
値も 16 進数で表示します
seq -b "64 512" -x .
文字列を検索する
seq -b "64 512" -x -s "FunkBG" .
最初に出現したSEARCHTERM を REPLACETERM に置き換えます (スクリプトを再度実行して、SEARCHTERM の次のインスタンスを置き換えます)
FIXME - 「replacecount」は将来のリリースで構成可能になる可能性があります
seq -b "64 512" -x -s "FunkBG" -r "Blues01" .
現在のディレクトリ ( .
) 内のファイル名に 80 が含まれるすべての .SEQ ファイルを表示し ( -b "80"
または--filter "80"
、ファイル内で用語"FunkBG"
を検索します
通常、これはオーディオ トラック内の wav ファイル名を検索して置換する場合に便利ですが、(バイナリ) シーケンス内のどこかにある MPC "プログラム ファイル" (.PGM) の名前を置換するためにも使用できる可能性があります。ファイル。
コマンドラインとその出力を見てみましょう。
seq -b "80" -s FunkBG .
* PATH used: .
* searching for "FunkBG" (after End of header)
* bpm_list (filter_list): ['80']
############### FunkBG_080_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "FunkBG_0"
and this would be the second half: "80_8bar"
** REPLACE OPTIONS: ********************************
** --replace simply replaces FunkBG with REPLACETERM.
** --correct-wav (-w) puts this files basename at found terms position,
** it would replace "FunkBG_0" with "FunkBG_0",
** and "80_8bar" with "80_8bar".
** --correct-wav-bpm (-p) just replaces the bpm part in the found term,
?? didn't find a possible bpm value in given term (FunkBG),
?? use underscores or dashes as seperating characters!
** it would replace "FunkBG" with "FunkBG".
** If this all looks like crap, don't do it! Existing files will be OVERWRITTEN!
出力の最初のセクションには、バージョン、小節数、シーケンスの BPM など、ファイル ヘッダーに保存されているメタ情報が表示されます。
「ヘッダーの終わり」マーカーの後に、検索語「FunkBG」が見つかったことがわかります。これはおそらく、AUDIO トラック内の wav ファイル名の先頭です。
seq ファイルに設定されている wav ファイル名の一部を置き換えたいとします。奇妙なことに、wav ファイルの名前は 2 つの 8 バイトのチャンクに分かれて別の場所に保存されます。このスクリプトは、wav ファイル名の一部が見つかったのか、それとも他の何か (pgm ファイル名やその他の文字列など) が見つかったのかを調べるのに役立ちます。
次に、その文字列を置き換える可能性を示します。
--replace (-r)
置換の最も単純な形式であり、SEARCHTERM が見つかった位置に REPLACETERM を配置するだけです。 REPLACETERM が SEARCHTERM より長い場合、残りの部分が上書きされます。
--correct-wav (-w)
は、wav ファイルの名前が wav ファイルとまったく同じである場合に使用するオプションです (もちろんファイルの末尾は除きます)。これは私が最もよく使用するオプションです。 github リポジトリの seq ファイルの例の場合、wav ファイル名と seq ファイル名はすでに同一であるため、このオプションは現時点ではあまり役に立ちません。
--correct-wav-bpm (-p)
SEARCHTERM に BPM 値を表す数値が含まれている場合にのみ意味を持ちます。別の例で示します。
各オプションには、何を置き換えるかが正確に示されているため、いずれかが満足であれば、スクリプトを再実行し、コマンド ラインに replace オプションを追加するだけです。
たとえば、単に「FunkBG」を「PunkBG」に置き換えたいため、使用するオプションとして-r
選択した場合、コマンドとその結果の出力は次のようになります。
seq -b "80" -s FunkBG -r "PunkBG" .
* PATH used: .
* searching for "FunkBG" (after End of header)
* replace is enabled! REPLACETERM is "PunkBG"
* bpm_list (filter_list): ['80']
############### FunkBG_080_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "FunkBG_0"
and this would be the second half: "80_8bar"
!!! replacing FIRST occurence of "FunkBG" with "PunkBG",
!!! and overwriting ./FunkBG_080_8bar.SEQ ...
ここでもう一度 FunkBG を検索すると、確かにもう見つかりません。
seq -b "80" -s "FunkBG" .
* PATH used: .
* searching for "FunkBG" (after End of header)
* bpm_list (filter_list): ['80']
############### FunkBG_080_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
################## End of header ###################
your SEARCHTERM "FunkBG" was not found!
代わりに Punk が見つかり、上記の最初の検索と同様のオプションが表示されます。
seq -b "80" -s "Punk" .
* PATH used: .
* searching for "Punk" (after End of header)
* bpm_list (filter_list): ['80']
############### FunkBG_080_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 4 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "PunkBG_0"
and this would be the second half: "80_8bar"
** REPLACE OPTIONS: ********************************
** --replace simply replaces Punk with REPLACETERM.
** --correct-wav (-w) puts this files basename at found terms position,
** it would replace "PunkBG_0" with "FunkBG_0",
** and "80_8bar" with "80_8bar".
** --correct-wav-bpm (-p) just replaces the bpm part in the found term,
?? didn't find a possible bpm value in given term (Punk),
?? use underscores or dashes as seperating characters!
** it would replace "Punk" with "Punk".
** If this all looks like crap, don't do it! Existing files will be OVERWRITTEN!
これは、私が実際にこのスクリプトを書いたユースケースです。上記の例で、Funk を Punk に置き換えたファイルをコピーして名前を変更してみましょう。好きなようにコピー/名前変更を行うことができます。たとえば、iOS X Finder には優れた一括名前変更ツールが組み込まれています。ここでは、コマンドラインで直接実行します。
cp FunkBG_080_8bar.SEQ PunkBG_080_8bar.SEQ
cp FunkBG_080_8bar.SEQ PunkBG_090_8bar.SEQ
cp FunkBG_080_8bar.SEQ PunkBG_100_8bar.SEQ
それでは、3 つの「パンク シーケンス ファイル」すべての wav ファイル名をファイル名と同じに設定したいと思います。まず Punk を検索し、何があるか確認します。おそらくこのフォルダーには他の seq ファイルがあるため、特に--filter (-b)
オプションを使用して 3 つのファイルを選択します。
seq --filter Punk -s "PunkBG" .
* PATH used: .
* searching for "PunkBG" (after End of header)
* bpm_list (filter_list): ['Punk']
############### PunkBG_080_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "PunkBG_0"
and this would be the second half: "80_8bar"
** REPLACE OPTIONS: ********************************
** --replace simply replaces PunkBG with REPLACETERM.
** --correct-wav (-w) puts this files basename at found terms position,
** it would replace "PunkBG_0" with "PunkBG_0",
** and "80_8bar" with "80_8bar".
** --correct-wav-bpm (-p) just replaces the bpm part in the found term,
?? didn't find a possible bpm value in given term (PunkBG),
?? use underscores or dashes as seperating characters!
** it would replace "PunkBG" with "PunkBG".
** If this all looks like crap, don't do it! Existing files will be OVERWRITTEN!
############### PunkBG_090_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
bpm in filename is different! correct with -c
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "PunkBG_0"
and this would be the second half: "80_8bar"
** REPLACE OPTIONS: ********************************
** --replace simply replaces PunkBG with REPLACETERM.
** --correct-wav (-w) puts this files basename at found terms position,
** it would replace "PunkBG_0" with "PunkBG_0",
** and "80_8bar" with "90_8bar".
** --correct-wav-bpm (-p) just replaces the bpm part in the found term,
?? didn't find a possible bpm value in given term (PunkBG),
?? use underscores or dashes as seperating characters!
** it would replace "PunkBG" with "PunkBG".
** If this all looks like crap, don't do it! Existing files will be OVERWRITTEN!
############### PunkBG_100_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
bpm in filename is different! correct with -c
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "PunkBG_0"
and this would be the second half: "80_8bar"
** REPLACE OPTIONS: ********************************
** --replace simply replaces PunkBG with REPLACETERM.
** --correct-wav (-w) puts this files basename at found terms position,
** it would replace "PunkBG_0" with "PunkBG_1",
** and "80_8bar" with "00_8bar".
** --correct-wav-bpm (-p) just replaces the bpm part in the found term,
?? didn't find a possible bpm value in given term (PunkBG),
?? use underscores or dashes as seperating characters!
** it would replace "PunkBG" with "PunkBG".
** If this all looks like crap, don't do it! Existing files will be OVERWRITTEN!
3 つのファイルの出力を詳しく調べると、次のような有用な可能性が見つかるでしょう。
--correct-bpm (-c)
ファイル 2 と 3 (コピー) のシーケンスの BPM を修正できます。--correct-wav (-w)
AUDIO トラックの wav ファイルの名前を置き換えて、seq ファイル名と等しくすることができます。ファイル 2 と 3 (コピー) にもありますここでオプション-w
および-c
オプションを使用すると、次の出力が得られます。
seq --filter Punk -s "PunkBG" -w -c
* PATH used: .
* searching for "PunkBG" (after End of header)
* bpm_list (filter_list): ['Punk']
* correct-bpm is enabled!
* correct-wav is enabled!
############### PunkBG_080_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "PunkBG_0"
and this would be the second half: "80_8bar"
-> found underscore seperated bpm value in given term: 80
!!! putting "PunkBG_0" where "PunkBG_0",
!!! putting "80_8bar" where "80_8bar",
!!! replacing bpm value,
!!! and overwriting ./PunkBG_080_8bar.SEQ ...
############### PunkBG_090_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
bpm in filename is different! This will be fixed now!
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "PunkBG_0"
and this would be the second half: "80_8bar"
-> found underscore seperated bpm value in given term: 90
!!! putting "PunkBG_0" where "PunkBG_0",
!!! putting "90_8bar" where "80_8bar",
!!! replacing bpm value,
!!! and overwriting ./PunkBG_090_8bar.SEQ ...
############### PunkBG_100_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
bpm in filename is different! This will be fixed now!
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "PunkBG_0"
and this would be the second half: "80_8bar"
-> found underscore seperated bpm value in given term: 100
!!! putting "PunkBG_1" where "PunkBG_0",
!!! putting "00_8bar" where "80_8bar",
!!! replacing bpm value,
!!! and overwriting ./PunkBG_100_8bar.SEQ ...
最後のチェックでは、wav ファイル名と BPM が修正されたことが示されています。
seq --filter Punk -s "PunkBG" .
* PATH used: .
* searching for "PunkBG" (after End of header)
* bpm_list (filter_list): ['Punk']
############### PunkBG_080_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 80
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "PunkBG_0"
and this would be the second half: "80_8bar"
** REPLACE OPTIONS: ********************************
** --replace simply replaces PunkBG with REPLACETERM.
** --correct-wav (-w) puts this files basename at found terms position,
** it would replace "PunkBG_0" with "PunkBG_0",
** and "80_8bar" with "80_8bar".
** --correct-wav-bpm (-p) just replaces the bpm part in the found term,
?? didn't find a possible bpm value in given term (PunkBG),
?? use underscores or dashes as seperating characters!
** it would replace "PunkBG" with "PunkBG".
** If this all looks like crap, don't do it! Existing files will be OVERWRITTEN!
############### PunkBG_090_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 90
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "PunkBG_0"
and this would be the second half: "90_8bar"
** REPLACE OPTIONS: ********************************
** --replace simply replaces PunkBG with REPLACETERM.
** --correct-wav (-w) puts this files basename at found terms position,
** it would replace "PunkBG_0" with "PunkBG_0",
** and "90_8bar" with "90_8bar".
** --correct-wav-bpm (-p) just replaces the bpm part in the found term,
?? didn't find a possible bpm value in given term (PunkBG),
?? use underscores or dashes as seperating characters!
** it would replace "PunkBG" with "PunkBG".
** If this all looks like crap, don't do it! Existing files will be OVERWRITTEN!
############### PunkBG_100_8bar.SEQ ################
4:20 version: MPC1000 SEQ 4.40
28:30 bars: 8
32:34 bpm: 100
################## End of header ###################
Found first occurence of SEARCHTERM at index 7168, it's 6 chars long
If SEARCHTERM is the START of a wav filename in an AUDIO track,
this would be the first half: "PunkBG_1"
and this would be the second half: "00_8bar"
** REPLACE OPTIONS: ********************************
** --replace simply replaces PunkBG with REPLACETERM.
** --correct-wav (-w) puts this files basename at found terms position,
** it would replace "PunkBG_1" with "PunkBG_1",
** and "00_8bar" with "00_8bar".
** --correct-wav-bpm (-p) just replaces the bpm part in the found term,
?? didn't find a possible bpm value in given term (PunkBG),
?? use underscores or dashes as seperating characters!
** it would replace "PunkBG" with "PunkBG".
** If this all looks like crap, don't do it! Existing files will be OVERWRITTEN!
FIXME... --correct-wav-bpm の使用例