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!
相反,朋克会被发现,我们将有与上面的第一次搜索类似的选项:
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