ein AKAI MPC 1000-Sequenzdatei-Befehlszeilenprogramm
Ich nutze meine MPC 1000 oft als Abspielgerät für Backing-Tracks oder Drum-Loops, wenn ich Musik übe oder einfach schnell etwas zum Mitjammen möchte. Normalerweise erstelle ich in der DAW meiner Wahl einen Drum-Loop und exportiere dann mehrere WAV-Dateien in unterschiedlichen Geschwindigkeiten. Ich würde diese Dateien dann auf meinen MPC kopieren und eine Sequenz für jede WAV-Datei speichern. Wenn ich das nächste Mal üben oder jammen möchte, muss ich nur schnell einen Ordner mit Sequenz- und WAV-Dateien laden und kann problemlos zwischen mehreren Geschwindigkeiten wechseln.
Das Erstellen aller Sequenzen auf dem MPC selbst ist eine sehr mühsame Aufgabe, deshalb habe ich dieses Tool geschrieben. Jetzt muss ich nur noch eine „Vorlagensequenz“ auf dem MPC erstellen, diese auf den Computer kopieren und daraus mehrere (umbenannte) Dateien erstellen. Dann lasse ich mir vom Tool dabei helfen, Metainformationen der Sequenzdateien anzuzeigen und sich wiederholende Aufgaben wie das Ersetzen des Dateinamens in den AUDIO-Spuren oder das Ersetzen des BPM der Sequenzen zu erledigen.
Obwohl ich es für Sequenzdateien geschrieben habe, die auf der MPC 1000 unter JJOS erstellt wurden, gehe ich davon aus, dass das Tool auch mit den Dateien der MPC 2500 funktionieren würde, da sie das gleiche Format haben. Vielleicht würden auch die vom MPC 500 funktionieren, da bin ich mir nicht sicher. Ich würde mich auf jeden Fall über Tests und Rückmeldungen zur Verwendung dieser MPC-Modelldateien freuen.
Wenn Sie sich nicht mit der Installation von Python auf Ihrem Betriebssystem herumschlagen möchten und kein Interesse daran haben, die neueste Entwicklungsversion auszuführen, verwenden Sie einfach die eigenständigen ausführbaren Dateien, die seit Version 1.2 verfügbar sind: https://github.com/JOJ0/ mpc1k-seq/releases/tag/v1.2
seq.exe
herunterseq
Um seq
von überall auf Ihrem System ausführen zu können, kopieren Sie es an einen Ort, nach dem gesucht wird:
Verwenden Sie den Windows Explorer, um die Datei seq.exe nach c:windowssystem32 zu kopieren.
Beachten Sie, dass dies ein schmutziger Hack ist. Wenn Sie dies nicht tun möchten oder nicht über die entsprechenden Berechtigungen verfügen, können Sie an Ihrer Eingabeaufforderung jederzeit einfach mit „cd“ zu dem Speicherort wechseln, an dem seq.exe gespeichert ist, und es von dort aus ausführen :-)
Stellen Sie sicher, dass Sie sich in dem Verzeichnis befinden, in dem seq gespeichert ist. Ihr Benutzer muss über Administratorrechte verfügen. Sie werden nach Ihrem Passwort gefragt, wenn Sie den folgenden Befehl ausführen:
sudo cp seq /usr/local/bin/
Bitte befolgen Sie einfach die Schritte im folgenden Kapitel!
Überspringen Sie dieses Kapitel, wenn Sie die ausführbaren Dateien wie oben beschrieben verwenden
Überprüfen Sie zunächst mit python --version
, ob Sie bereits eine Python-Version auf Ihrem System haben
Sie benötigen Python 2.7.x
Klonen Sie das Github-Repo und springen Sie in das Verzeichnis.
git clone https://github.com/JOJ0/mpc1k-seq.git
cd mpc1k-seq
Laden Sie hier ein MSI-Installationsprogramm herunter
Installieren Sie das Tool, indem Sie das geklonte Repo-Verzeichnis zur Systemvariablen %path% hinzufügen.
oder kopieren Sie es einfach schnell und schmutzig in einen Pfad, der sich bereits im Suchpfad des Systems befindet
copy seq.py c:windowssystem32
Mac OS OX X 10.8 hatte Python 2.6, was wahrscheinlich auch funktionieren würde. 10.9 und neuere Versionen verfügen alle über 2.7.x, was in Ordnung sein sollte.
Wenn Sie nicht über das oben genannte verfügen, installieren Sie das neueste 2.7-Paket von hier oder verwenden Sie Homebrew, um es herunterzuladen.
Installieren Sie das Tool
cp seq.py /usr/local/bin/
Sie haben höchstwahrscheinlich bereits eine laufende Python-Version! Prüfen Sie wie oben beschrieben!
Einige moderne Linux-Distributionen verwenden standardmäßig bereits Python 3.x, Sie müssten ein Python2-Paket installieren
Debian-basierte Systeme
apt install python2.7
Basierend auf Redhat
yum install python27
und stellen Sie die erste Zeile des Skripts so ein, dass diese Python-Version verwendet wird (z. B. #!/usr/bin/python2.7
).
Installieren Sie abschließend das Tool
cp seq.py /usr/local/bin/
Falls Sie die Entwicklungsversion verwenden, müssten Sie seq.py anstelle von seq ausführen. Beachten Sie außerdem, dass die seq.exe von Windows ohne die Endung .exe ausgeführt werden kann. Die ausführbare MacOS-Datei heißt einfach seq und hat keine Dateiendung
Das Dienstprogramm wird als Befehlszeilendienstprogramm im UNIX-Stil geliefert und zeigt als solches alle seine Fähigkeiten, wenn es mit den typischen Optionen --help oder -h ausgeführt wird:
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
Zeigen Sie einfach die Metainformationen aller seq-Dateien im aktuellen Verzeichnis an
seq .
Informationen zu allen seq-Dateien anzeigen, deren Dateiname 64 oder 512 enthält (normalerweise BPM-Werte)
seq -b "64 512" .
Zeigt Werte auch in Hex an
seq -b "64 512" -x .
Suche nach einer Zeichenfolge
seq -b "64 512" -x -s "FunkBG" .
Ersetzen Sie das erste Vorkommen von SEARCHTERM durch REPLACETERM (führen Sie das Skript erneut aus, um die nächste Instanz von SEARCHTERM zu ersetzen)
FIXME – „replacecount“ kann in zukünftigen Versionen möglicherweise konfiguriert werden
seq -b "64 512" -x -s "FunkBG" -r "Blues01" .
Alle .SEQ-Dateien im aktuellen Verzeichnis ( .
) anzeigen, die 80 im Dateinamen haben ( -b "80"
oder --filter "80"
und nach dem Begriff "FunkBG"
in der Datei suchen
Normalerweise ist dies nützlich, wenn wir den Namen einer WAV-Datei in einer Audiospur suchen und ersetzen möchten, aber wir könnten es wahrscheinlich auch verwenden, um den Namen einer MPC-„Programmdatei“ (.PGM) irgendwo in der (binären) Sequenz zu ersetzen Datei.
Werfen wir einen Blick auf die Befehlszeile und ihre Ausgabe:
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!
Der erste Abschnitt der Ausgabe zeigt uns im Datei-Header gespeicherte Metainformationen wie Version, Anzahl der Takte und den BPM der Sequenz.
Nach der Markierung „Ende des Headers“ sehen wir, dass unser Suchbegriff „FunkBG“ gefunden wurde und es sich höchstwahrscheinlich um den Anfang des Namens einer WAV-Datei in einer AUDIO-Spur handelt.
Nehmen wir an, wir möchten einen Teil des in der SEQ-Datei konfigurierten WAV-Dateinamens ersetzen. Der Name einer WAV-Datei wird seltsamerweise in zwei 8-Byte-Blöcken an verschiedenen Orten gespeichert. Das Skript versucht uns dabei zu helfen, herauszufinden, ob es gerade einen Teil eines WAV-Dateinamens oder etwas anderes (wie einen PGM-Dateinamen oder eine andere Zeichenfolge) gefunden hat.
Als nächstes sind unsere Möglichkeiten, diese Zeichenfolge zu ersetzen:
--replace (-r)
ist die einfachste Form der Ersetzung, sie setzt den REPLACETERM einfach an die Position, an der er SEARCHTERM gefunden hat. Wenn REPLACETERM länger als SEARCHTERM ist, wird der verbleibende Teil überschrieben.
--correct-wav (-w)
ist die zu verwendende Option, wenn unsere WAV-Dateien genau den gleichen Namen wie unsere WAV-Dateien haben (außer natürlich der Dateiendung). Dies ist die Option, die ich am häufigsten verwende. Im Fall der Beispiel-SEQ-Datei aus dem Github-Repo waren die WAV- und SEQ-Dateinamen bereits identisch, daher ist diese Option derzeit nicht sehr nützlich.
--correct-wav-bpm (-p)
ist nur sinnvoll, wenn SEARCHTERM Zahlen enthält, die BPM-Werte darstellen. Ich zeige es an einem anderen Beispiel.
Jede der Optionen gibt genau an, was sie ersetzen würde. Wenn wir also mit einer davon zufrieden sind, führen wir das Skript einfach erneut aus und fügen der Befehlszeile zusätzlich die Option „Ersetzen“ hinzu.
Wenn wir beispielsweise -r
als zu verwendende Option auswählen, weil wir einfach „FunkBG“ durch „PunkBG“ ersetzen möchten, wäre dies der Befehl und die resultierende Ausgabe:
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 ...
Wenn wir nun erneut nach FunkBG suchen, werden wir es mit Sicherheit nicht mehr finden:
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!
Stattdessen würde Punk gefunden und wir hätten ähnliche Möglichkeiten wie bei unserer ersten Suche oben:
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!
Dies ist der Anwendungsfall, für den ich dieses Skript tatsächlich geschrieben habe. Nehmen wir die Datei aus dem obigen Beispiel, in dem wir Funk durch Punk ersetzt haben, kopieren sie aber und benennen sie um. Sie können das Kopieren/Umbenennen nach Belieben durchführen, z. B. verfügt der iOS X Finder über ein nettes Tool zum Massenumbenennen. Ich mache es jetzt direkt auf der Kommandozeile, wenn wir schon dabei sind:
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
Ok, jetzt möchten wir den WAV-Dateinamen in allen drei „Punk-Sequenzdateien“ auf den gleichen Namen wie den Dateinamen setzen. Wir suchen zuerst nach Punk und schauen, was wir haben. Wahrscheinlich befinden sich in diesem Ordner noch andere seq-Dateien, daher wählen wir unsere 3 Dateien insbesondere mit der Option --filter (-b)
aus:
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!
Wenn wir die Ausgabe für die drei Dateien genau untersuchen, würden wir diese nützlichen Möglichkeiten finden
--correct-bpm (-c)
könnte den BPM der Sequenz in den Dateien 2 und 3 (den Kopien) korrigieren--correct-wav (-w)
könnte den Namen der WAV-Datei der AUDIO-Tracks ersetzen, sodass er mit dem Namen der seq-Datei übereinstimmt. Auch in den Akten 2 und 3 (den Kopien) Wenn wir nun die Optionen -w
und -c
verwenden würden, erhalten wir die folgende Ausgabe:
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 ...
Eine letzte Überprüfung zeigt uns, dass der WAV-Dateiname und auch der BPM korrigiert wurden:
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... Beispiel für die Verwendung von --correct-wav-bpm