Cov txheej txheem:

Mac OS Taw Hloov Los Ntawm Guitar Amp Pedal: 12 Kauj Ruam
Mac OS Taw Hloov Los Ntawm Guitar Amp Pedal: 12 Kauj Ruam

Video: Mac OS Taw Hloov Los Ntawm Guitar Amp Pedal: 12 Kauj Ruam

Video: Mac OS Taw Hloov Los Ntawm Guitar Amp Pedal: 12 Kauj Ruam
Video: Musicians talk about Buckethead 2024, Kaum ib hlis
Anonim
Mac OS Taw Hloov Los Ntawm Guitar Amp Pedal
Mac OS Taw Hloov Los Ntawm Guitar Amp Pedal

Xav tau tus ko taw taw rau koj Mac? Tau txais ob lub hloov guitar pedal thiab thiab arduino board dag ib ncig? Ob peb ntawm cov xov hlau, peb qhov txuas 1/4 jack thiab koj tau teeb tsa tag nrho. Kuv yuav tsum tau ua qee qhov hloov pauv suab thiab siv kuv lub pedal los ua si/ncua thiab hla rov qab cov vis dis aus. Macintosh khoos phis tawj siv Arduino thiab 2 hloov guitar amp pedal. Koj yuav tsum paub me ntsis nrog cov laug thiab sau cov lej yooj yim. Yog tias koj xav tau guitar amp pedal hloov, koj tuaj yeem yuav ib lossis ua ib qho nrog lwm qhov kev qhia lossis nrog qhov no.

Kauj Ruam 1: Cov khoom siv

Khoom siv
Khoom siv
Khoom siv
Khoom siv
Khoom siv
Khoom siv

1) Guitar Pedal (Kuv siv ob txoj kev hloov pedal) 2) Arduino (Kuv siv Diecimila) 3) Breadboard (lossis pawg thawj coj saib yog tias koj nyiam) 4) Peb Tus Thawj Coj 1/4 Stereo Phone Jack (tau txais ib qho) ntawm RadioShack) 5) 2 1k ohm resisters6) Hlau (koj paub txhua yam koj tau dag ib ncig) 7) Soldering Iron (thiab Solder yuav pab tau ib yam)

Kauj ruam 2: Solder Jack

Solder Jack
Solder Jack
Solder Jack
Solder Jack
Solder Jack
Solder Jack

Lub jack (thiab qhov sib txuas sib txuas) muaj peb lub ntsiab lus sib txuas: Ntiv Nplhaib, Ntsis, Tes Tsho. Koj yuav tsum tau xaim xov hlau mus rau txhua qhov txuas. Ua kom cov xov hlau sib txawv xim kom nyob zoo. Lub Tes Tsho (txuas rau cov xaim dub hauv kuv daim duab) yog cov kab ib txwm khiav mus rau txhua qhov hloov pauv ntawm tus ko taw. Yog tias peb muab nws (cov xaim dub) qhov hluav taws xob, hloov #1 yuav qhib/tua Cov Lus Qhia Hlau (ntsuab hauv kuv daim duab). Ib yam nkaus, hloov #2 tig Lub Nplhaib rau thiab tawm (daj hauv kuv daim duab). Yog koj tsis meej pem (Kuv ua tau zoo) tsuas yog xaim xim sib txawv xaim rau txhua tus hlau lead ntawm lub nkaus. Koj tuaj yeem siv lub ntsuas ntsuas hluav taws xob los ntsuas qhov txuas ntxiv mus (lossis xaim nws mus rau lub khob cij nrog lub LED ntawm nws) txhawm rau txiav txim siab nws. Kuv kinda ntsia ntawm txhua tus hlau lead thiab xam tawm dab tsi ib feem ntawm lub ntsaws nws ua rau kev sib cuag nrog.

Kauj Ruam 3: Hlau Jack mus rau Breadboard

Hlau Jack rau ntawm Breadboard
Hlau Jack rau ntawm Breadboard
Hlau Jack rau ntawm Breadboard
Hlau Jack rau ntawm Breadboard
Hlau Jack rau ntawm Breadboard
Hlau Jack rau ntawm Breadboard
Hlau Jack rau ntawm Breadboard
Hlau Jack rau ntawm Breadboard

Cov kauj ruam no yog qhov tsis meej pem. Ntawm no peb txuas lub jack rau lub rooj noj mov. Qhov tseeb, peb yuav siv lub zog los ntawm arduino thiab khiav nws mus rau taw kev hloov pauv (ntawm cov xaim dub ntawm kuv lub jack - kuv paub kuv paub tias kuv yuav tsum tau siv cov hlau liab). Tom qab ntawd txhua lub xaim tawm ntawm lub jack peb nqes mus rau 1k ohm resistor. Thiab los ntawm sab nraub qaum ntawm txhua tus tiv thaiv, rov qab mus rau hauv av. Tom qab ntawd peb xav tau ob lub xov hlau dav los coj tawm ntawm lub rooj tsavxwm los ntawm sab xub ntiag ntawm txhua tus tiv thaiv (tom ntej ntawm qhov twg lub jack coj rov qab rau hauv. Ob txoj xov hlau no peb yuav siv los ntsuas rau HIGH/ LOW ntawm Arduino.

Kauj Ruam 4: Txuas Jack

Txuas Jack
Txuas Jack
Txuas Jack
Txuas Jack

Txuas Jack kom lub tes tsho txuas mus rau RED 5v. Qhov Nplhaib thiab Cov Lus Qhia yuav tsum txuas rau txhua lub taub hau ntawm cov neeg tawm tsam. Koj saib ntawm lub thawv me me ntawm daim duab thib ob kom ntxaws.

Kauj Ruam 5: Txuas Ob Txoj Kev Tshawb Fawb

Txuas ob Txoj Kev Tshawb Fawb
Txuas ob Txoj Kev Tshawb Fawb

Peb xav tau 2 lub xov hlau kom khiav los ntawm sab saum toj (tsis yog sab txuas rau hauv av, lwm qhov) ntawm txhua tus tiv thaiv rau peb cov arduino. Look ntawm lub thawv ntev ntawm daim duab kom paub meej.

Kauj Ruam 6: Txuas Breadboard rau Arduino

Txuas Breadboard rau Arduino
Txuas Breadboard rau Arduino

Tam sim no peb txuas plaub lub xov hlau los ntawm daim phiaj rau peb Arduino. Txuas lub RED fais fab hlau rau hauv 5V Cov Kab Hluav Taws Xob ntawm Arduino. Plug BLACK av xaim rau hauv GND kab ntawm Arduino. Plug #1 hloov (GREEN kab) rau hauv #9 tus pin ntawm Arduino. Plug tus #2 hloov (YELLOW kab) rau hauv #8 tus pin ntawm Arduino. (Peb yuav sim pins 8 & 9 rau qhov hluav taws xob ntawm Arduino)

Kauj Ruam 7: Txuas rau Arduino rau Mac's USB Port

Txuas rau Arduino rau Mac's USB Port
Txuas rau Arduino rau Mac's USB Port

Txuas koj Arduino/Breadboard/Jack/Hloov combo thingie rau hauv koj lub USB chaw nres nkoj.

Kauj Ruam 8: Program Arduino

Program Arduino
Program Arduino

Yog li ntawm no, peb xav sau cov arduino. Koj tuaj yeem siv cov koob twg koj nyiam tiag tiag. Yeej, peb xav sau mus rau qhov chaw nres nkoj txuas thaum twg tus pin hloov pauv. Peb sau 1 rau hloov #2 thiab "2" rau hloov #2. Tiag tiag, koj tsis tuaj yeem chord nrog cov teeb tsa no (tab sis cov cai tuaj yeem hloov pauv kom tso cai rau qhov ntawd). Um, siv cov ntawv FootSwitch.pde kom tau txais txoj cai… tsis yog jpg.:)

Kauj ruam 9: Program Mac

Program Mac
Program Mac

Yog li, tam sim no peb muaj taw taw tham nrog peb Arduino. Arduino sau 1 lossis 2 rau cov khoom siv thaum peb nyem qhov hloov pauv. Peb xav tau qee yam ntawm Mac los nyeem nws. Ua rau Arduino ua txuj ua tus keyboard yog nyuaj me ntsis. Yog li, hloov peb yuav sau me me C program los ua peb tus tswj hwm rau Mac. Peb yuav pib los ntawm kev noj Tod E. Kurt qhov kev pabcuam tam sim no uas tau nyeem Arduino qhov chaw nres nkoj. Kuv tau ua ob peb qhov kev hloov kho me me kom ua tiav cov khoom thaum nws pom 1 lossis 2. Cov ntawv txuas nrog yuav tsum ua haujlwm zoo. Koj tuaj yeem nyeem cov lus pom yog tias koj xav pom dab tsi tshwm sim, tab sis nws tsis yog rau lub plawv tsaus muag. footswitch). Rub tawm nws thiab muab tso rau hauv daim nplaub tshev tshiab yog tias koj xav sau nws, kuv yuav xav tias koj paub yuav ua li cas: 1) Qhib iTerm thiab CD rau hauv phau ntawv ntawd 2) Sau nws los ntawm kev ntaus: gcc -o arduino -serial -footswitch arduino-serial-footswitch.c

Kauj ruam 10: Tshem Mac ntawm Applescript

Tshem tawm Mac Via Applescript
Tshem tawm Mac Via Applescript
Tshem tawm Mac Via Applescript
Tshem tawm Mac Via Applescript

Yog li peb yuav tsum sau ob AppleScripts. Cov no yuav qhib lub app peb xav tau thiab ntaus lawv cov keyboard (luv) peb xav tau. Txuas nrog yog kuv tus qauv rau ua li ntawd. Koj tuaj yeem nyeem AppleScript. Yog li tsuas yog saib cov ntawv txuas nrog. Muaj peb hom xwm txheej tseem ceeb uas koj tuaj yeem ua los ntawm AppleScript: "'tus yuam sij nqis' ',"' tus lej yuam sij '", thiab" "keystroke" ". Koj cov mais yuav txawv, yog li sim "'keystroke'" ua ntej … yog tias qhov ntawd tsis ua haujlwm sim lwm qhov xwm txheej, ib zaug dhau ib zaug. Kuv yuav ua kom koj ntaus qhov no hauv txhais tes. Thov txim cov neeg.:) Txuag Raws li … txhua AppleScript ua hom "Thov". Muab lawv ib sab ntawm peb qhov ua tau zoo C code/app los ntawm cov kauj ruam kawg. Npe txhua tus 1.app thiab 2.app - ib qho rau txhua qhov hloov pauv.

Kauj ruam 11: Khiav

Khiav!
Khiav!
Khiav!
Khiav!

Lawd. Ok, yog li peb muaj Foot Hloov, uas yog xaim rau hauv lub khob cij, uas txuas nrog Arduino, uas txuas USB rau hauv Mac, uas tab tom ua haujlwm C program uas mloog rau footswitch thiab execs applescripts. Yog! Ok koj yuav tsum muaj daim nplaub tshev uas zoo li no:. |-1.app |-2.app |-arduino-serial-footswitch`-- arduino-serial-footswitch.cOpen koj lub davhlau ya nyob twg app. CD rau hauv phau ntawv teev npe uas koj tau ua. Koj tuaj yeem pib koj tsab ntawv me me xws li:./arduino-serial-footswitch -p `ls/dev/tty.usbserial*` `-b 9600 -R qhov no sau peb tsab ntawv los ntawm kev nrhiav peb pawg thawj coj Arduino … yog tias koj muaj ntau dua ib qho ntsaws hauv, hloov tag nrho ntawm 'ls /dev /tty.usbserial*' nrog txoj hauv kev rau lub cuab yeej (yog tias koj ua qhov no tsis siv cov lus hais!). Yog tias koj cov nyees khawm rov qab, koj tuaj yeem thim rov qab cov xov hlau khiav mus rau tus pin 8 & 9.:) Zoo Siab Stomping!

Kauj Ruam 12: Voila-A Video Demo

Voila – a Video Demo!
Voila – a Video Demo!

Nov yog qhov demo ntawm tus footswitch hauv kev nqis tes ua! Kuv hais txog muaj 500ms latency (uas yog AppleScript lag). Muaj qhov latency thib ob hauv kev thov tsab ntawv nws tus kheej, yog li koj yuav pom tag nrho kev lag luam ntawm ~ 60 vib nas this.

Pom zoo: