أداة سطر أوامر ملف تسلسل AKAI MPC 1000
غالبًا ما أستخدم MPC 1000 الخاص بي كمشغل لدعم المسارات أو حلقات الطبل عند ممارسة الموسيقى أو فقط أريد أن يتم تشغيل شيء ما بسرعة. عادةً ما أقوم بإنشاء حلقة طبلة في DAW التي أختارها ثم أقوم بتصدير العديد من ملفات wav بسرعات مختلفة. أود بعد ذلك نسخ هذه الملفات إلى MPC الخاص بي وحفظ تسلسل واحد لكل ملف wav. في المرة القادمة التي أرغب فيها في التدرب أو التشويش، يجب علي فقط تحميل مجلد من ملفات التسلسل وملفات wav بسرعة ويمكنني التبديل بسهولة بين عدة سرعات.
يعد إنشاء جميع التسلسلات على MPC نفسها مهمة شاقة للغاية، ولهذا السبب كتبت هذه الأداة. علي الآن فقط إنشاء "تسلسل قالب" واحد على MPC، ونسخه إلى الكمبيوتر، وإنشاء عدة ملفات (أعيدت تسميتها) منه. ثم أسمح للأداة بمساعدتي في عرض المعلومات التعريفية لملفات التسلسل والقيام بمهام متكررة مثل استبدال اسم الملف في مسارات الصوت أو استبدال تسلسلات BPM.
على الرغم من أنني كتبته لملفات التسلسل التي تم إنشاؤها من MPC 1000 الذي يقوم بتشغيل JJOS، إلا أنني أفترض أن الأداة ستعمل مع ملفات 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
لاحظ أن هذا اختراق قذر. إذا كنت لا تريد القيام بذلك أو ليس لديك الامتيازات اللازمة للقيام بذلك، في موجه الأوامر الخاص بك، يمكنك دائمًا فقط "القرص المضغوط" إلى المكان الذي تم فيه حفظ seq.exe وتنفيذه من هناك :-)
تأكد من أنك مقيم داخل الدليل حيث تم حفظ التسلسل. يحتاج المستخدم الخاص بك إلى الحصول على امتيازات المسؤول. سيُطلب منك كلمة المرور الخاصة بك عند تنفيذ الأمر التالي:
sudo cp seq /usr/local/bin/
يرجى فقط اتباع الخطوات الواردة في الفصل التالي!
قم بتخطي هذا الفصل إذا كنت تستخدم الملفات التنفيذية كما هو موضح أعلاه
أولاً، تحقق مما إذا كان لديك بالفعل إصدار Python على نظامك باستخدام python --version
أنت بحاجة إلى بايثون 2.7.x
استنساخ جيثب الريبو والانتقال إلى الدليل.
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
الأنظمة المبنية على دبيان
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 فقط ولا يحتوي على نهاية ملف
تأتي الأداة كأداة مساعدة لسطر الأوامر على نمط 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 في اسم الملف (عادةً قيم 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" .
اعرض جميع ملفات .SEQ في الدليل الحالي ( .
) التي تحتوي على 80 في اسم الملف ( -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" وهو على الأرجح بداية اسم ملف wav في مسار صوتي.
لنفترض أننا نرغب في استبدال جزء من اسم ملفات wav التي تم تكوينها في الملف seq. يتم حفظ اسم ملف wav بشكل غريب في قطعتين بحجم 8 بايت في أماكن مختلفة. يحاول البرنامج النصي مساعدتنا في معرفة ما إذا كان قد عثر للتو على جزء من اسم ملف wav أو أي شيء آخر (مثل اسم ملف pgm أو سلسلة أخرى).
فيما يلي إمكانياتنا لاستبدال هذه السلسلة:
--replace (-r)
هو أبسط شكل من أشكال الاستبدال، فهو يضع فقط REPLACETERM في الموضع الذي وجد فيه SEARCHTERM. إذا كان REPLACETERM أطول من SEARCHTERM فإنه سيحل محل الجزء المتبقي.
--correct-wav (-w)
هو الخيار الذي يمكن استخدامه عندما تتم تسمية ملفات wav الخاصة بنا بشكل متطابق تمامًا مع ملفات wav الخاصة بنا (باستثناء نهاية الملف بالطبع). هذا هو الخيار الذي أستخدمه أكثر. في حالة مثال ملف seq من github repo، فإن أسماء ملفات 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
حسنًا، نود الآن تعيين اسم ملفات wav في جميع "ملفات تسلسل Punk" الثلاثة على نفس اسم الملف. نبحث أولاً عن Punk ونرى ما لدينا. من المحتمل أن تكون هناك ملفات تسلسلية أخرى في هذا المجلد، لذلك نختار بشكل خاص ملفاتنا الثلاثة باستخدام خيار --filter (-b)
:
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!
إذا قمنا بفحص مخرجات الملفات الثلاثة عن كثب فسنجد هذه الاحتمالات المفيدة
--correct-bpm (-c)
يمكنه تصحيح BPM للتسلسل في الملفين 2 و3 (النسخ)--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