AKAI MPC 1000 序列檔命令列實用程式
我經常使用 MPC 1000 作為播放器,在練習音樂或只是想快速演奏一些東西時為背景曲目或鼓循環播放。我通常在我選擇的 DAW 中建立一個鼓循環,然後以不同的速度匯出幾個 wav 檔案。然後,我會將這些檔案複製到我的 MPC 上,並為每個 wav 檔案保存一個序列。下次我想要練習或即興演奏時,我只需快速載入一個包含序列和 wav 檔案的資料夾,並且可以輕鬆地在幾種速度之間切換。
在 MPC 本身上建立所有序列是一項非常繁瑣的任務,這就是我編寫此工具的原因。我現在只需在 MPC 上建立一個“模板序列”,將其複製到電腦上,然後從中建立多個(重新命名的)檔案。然後,我讓該工具幫助我顯示序列檔案的元資訊並執行重複性任務,例如替換音訊軌道中的檔案名稱或替換序列 BPM。
雖然我是為從運行 JJOS 的 MPC 1000 創建的序列文件編寫的,但我認為該工具也適用於 MPC 2500 的文件,我認為它們共享相同的格式。也許來自 MPC 500 的也可以工作,但不確定。我當然非常感謝有關這些 MPC 模型文件的使用的任何測試和回饋。
如果您不想在作業系統上安裝 Python,並且對運行最新的開發版本不感興趣,只需使用自 v1.2 版本以來可用的獨立可執行檔:https://github.com/JOJ0/ mpc1k-seq/ releases/tag/v1.2
seq.exe
seq
(不確定較新的 MacOS 版本是否可以運作,請回報任何問題)為了能夠從系統上的任何位置執行seq
,請將其複製到搜尋到的位置:
使用 Windows 資源管理器將 seq.exe 檔案複製到 c:windowssystem32
請注意,這是一個骯髒的駭客行為。如果您不想執行此操作或沒有執行此操作的權限,則可以在命令提示字元下「cd」到儲存 seq.exe 的位置並從那裡執行它:-)
確保您位於儲存 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
基於紅帽
yum install python27
並將腳本的第一行設定為使用此 python 版本(例如#!/usr/bin/python2.7
)
最後,安裝工具
cp seq.py /usr/local/bin/
如果您使用的是開發版本,則必須執行 seq.py 而不是 seq。進一步注意,Windows seq.exe 可以在沒有 .exe 結尾的情況下執行。 MacOS 執行檔僅名稱為 seq,且沒有以 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" .
也以十六進位顯示值
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 檔案名,那麼這很有用,但我們也可能使用它來替換(二進位)seq 中某處的 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”,它很可能是音訊軌道中 wav 檔案名稱的開頭。
假設我們想要替換配置到 seq 檔案中的部分 wav 檔案名稱。奇怪的是,wav 檔案的名稱保存在不同位置的兩個 8 位元組區塊中。該腳本試圖幫助我們找出它是否只是找到了 wav 檔案名稱的一部分或其他內容(例如 pgm 檔案名稱或其他字串)。
接下來是我們替換該字串的可能性:
--replace (-r)
是最簡單的替換形式,它只是將 REPLACETERM 放在找到 SEARCHTERM 的位置。如果 REPLACETERM 比 SEARCHTERM 長,它將覆蓋剩餘部分。
--correct-wav (-w)
是當我們的 wav 檔案與我們的 wav 檔案命名完全相同時使用的選項(當然檔案結尾除外)。這是我最常用的選項。對於 github 儲存庫中的範例 seq 文件,wav 和 seq 檔案名稱已經相同,因此此選項目前不是很有用。
--correct-wav-bpm (-p)
僅當 SEARCHTERM 包含代表 BPM 值的數字時才有意義。我將在另一個例子中展示它。
每個選項都準確地說明了它們將替換的內容,因此如果我們對其中一個選項感到滿意,我們只需重新運行腳本並將替換選項添加到命令列即可。
例如,如果我們選擇-r
作為要使用的選項,因為我們想簡單地將“FunkBG”替換為“PunkBG”,則這將是命令及其結果輸出:
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 個「Punk 序列檔案」中的 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)
可以取代音訊軌道 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