Cov txheej txheem:
- Khoom siv
- Kauj Ruam 1: Nkag Siab Qhov Flow
- Kauj ruam 2: Teeb Tus Neeg rau zaub mov - Ngrok
- Kauj Ruam 3: Teeb Tus Neeg rau zaub mov - Node -Red
- Kauj Ruam 4: Teeb Tus Server - MQTT (Mosquitto)
- Kauj ruam 5: Txoj Cai
- Kauj Ruam 6: Luam Tus Qauv 3D
- Kauj Ruam 7: Sib dhos thiab Vuam
- Kauj Ruam 8: Ua Si Ib Loops Nrog Koj Cov Phooj Ywg
Video: Melody: 8 Kauj Ruam (nrog Duab)
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Nrog rau ntau qhov txiaj ntsig thiab kev daws teeb meem thev naus laus zis uas tso cai ua haujlwm hauv tsev, qhov nyuaj ntawm kev teeb tsa thiab tsim kev txhawb nqa lub neej ntawm cov neeg ua haujlwm tseem nyob. MELODY yog lub cuab yeej digital-lub cev uas ua rau tsim kev sib koom ua suab paj nruag luv luv. Cov neeg ua haujlwm sib koom tes ua haujlwm lub sijhawm thiab lub cuab yeej teeb tsa kev sib tham nrog tig thiab suab sib txawv. Thawj tus neeg koom nrog teeb tsa lub suab sib dhos tshwj xeeb, tom qab uas txhua tus neeg koom nrog ntxiv lawv tus kheej cov suab paj nruas sib xws rau cov lus sib dhos. Txhawm rau ua kom yooj yim rau cov neeg siv uas tsis muaj keeb kwm yav dhau los suab paj nruag, lub software pab lawv ua kom nrawm los ntawm kev ntsuas lawv qhov kev nyem thiab kho kom haum raws li qhov tsim nyog. Qhov kev sib tham xaus tom qab kwv yees li 3 feeb thaum txhua tus neeg koom nrog tau sau tiav lawv ib feem.
Nws ua haujlwm li cas?
Melody yog ua raws ESP2866 kho vajtse, uas sib txuas lus nrog Node-Red server hla MQTT raws tu qauv. Cov cuab yeej txhais cov neeg ua si cov ntawv sau rau hauv cov hlua ntawm cov cim uas tau xa mus rau tus neeg rau zaub mov thiab los ntawm tus neeg rau zaub mov rov qab mus rau lwm tus neeg ua si. Qhov no tso cai rau txhua tus ua si thiab hnov lub suab tsis cuam tshuam los ntawm lawv cov kev sib txuas hauv network.
Melody muaj ob lub ntsiab qhov muag pom. Thawj yog LED sawb uas qhia rau tus neeg ua si paub thaum Loop pib thiab thaum nws xaus thiab qhia tias yog nws yog tus neeg uas ua ntawv tig. Qhov thib ob yog LED zaub nyob hauv nruab nrab ntawm cov khoom, uas yog siv los pom qhov pom ntawm qhov qhib uas twb muaj lawm. Kev suav rov qab los ntawm 3 txog 1 qhia kom pib ua si thiab lub sijhawm teev qhia ncaj qha rau tus neeg siv thaum twg thiab yuav ua li cas nws xav koom nrog pab pawg Melody. Cov kaw cia tau txais kev cawmdim rau lub tuam txhab huab rau kev siv yav tom ntej.
Txoj haujlwm no tau tsim los ntawm plaub tus tub ntxhais kawm ntawv ntawm Media innovation lab (MiLab) ntawm Lub Chaw Haujlwm Sib Koom Tes Herzliya (IDC): Shahar Agassy, Eden Bar-Tov, Gal Eshchar, thiab Gad Stern. Nrog kev pab los ntawm Zvika Markfeld, Netta Ofer thiab Michal Leschinsky thiab kev qhia ntawm Noa Morag thiab Oren Zuckerman.
ua tsaug rau Tom Granot rau kev tsim cov lus qhia zoo uas tau pab kuv kawm paub yuav ua li cas siv qee yam ntawm no (qee cov kauj ruam ntawm no yog ua qauv tom qab cov lus qhia zoo no).
Khoom siv
- 3D tshuab luam ntawv
- ESP8266
- 7 nyuv
- 8X8 LED matrix
- WS2812B LED Sawb
- I2S amplifier
- Poj niam 1/8 "(3.5mm) 4 Pole Audio Jack
- 4 X 1K resistor
- 1 X3K resistor
Kauj Ruam 1: Nkag Siab Qhov Flow
Hauv txoj haujlwm no peb tau sim daws qee qhov teeb meem:
- Peb tuaj yeem ua nws li cas online, yog li cov players tuaj yeem ua si tib lub sijhawm?
- Peb tuaj yeem nyob ib puag ncig internet latencies thiab tsim kev paub zoo li cas?
- Peb tuaj yeem ua lub suab paj nruag zoo li cas txawm tias rau cov neeg tsis muaj suab paj nruag yav dhau los?
Sijhawm thiab ua suab paj nruag
Txhawm rau daws thawj qhov teeb meem peb tau saib ntawm MIDI cov txheej txheem thiab sim siv nws, tab sis peb pom tias nws muaj zog dua tom qab qhov peb xav tau tiag tiag peb tseem xav ua kom yooj yim yog li peb tuaj yeem tsim thawj qhov qauv ua haujlwm. Yog li peb tau txais kev tshoov siab los ntawm MIDI thiab ua rau peb lub suab paj nruas sawv cev los ntawm txoj hlua ntawm tus lej (los ntawm 0-5) lub sijhawm loops loj npaum li cas cov neeg ua si (peb yuav piav qhia txhua yam suab paj nruas tom qab).
Hauv suab paj nruag, peb faib cov lus sib dhos ua suab paj nruag. Txhua qhov bar yog qhov me me ntu ntu peb xaiv siv 4/4 (lub ntsiab lus 4 ntaus hauv lub suab paj nruas bar) - feem ntau yog ib qho.
Txhua qhov kev ntaus yog tom qab ntawd muab faib ua 4 qhov piv txwv qhov rai yog li txhua qhov kev ceeb toom ua si yuav pib ua haujlwm mus rau txoj haujlwm zoo thiab tseem tso cai rau peb los sawv cev ib zaj nkauj ua kab ntawm cov lej kom xa mus rau tus neeg rau zaub mov.
Txhawm rau ua phooj ywg rau cov neeg uas tsis muaj keeb kwm suab paj nruag peb tau ua peb yam:
- Txwv tus naj npawb ntawm cov yuam sij kom cov neeg ua si tsom mus rau xaiv ntau dua.
- Peb khaws cov ntawv ntawm tib qhov ntsuas uas ua si tau zoo ua ke yog li yuav tsis muaj lub suab tsis sib xws.
- Txhua qhov xovxwm tau teeb tsa rau "lub qhov rais" ntawm kev sib dhos yog li cov neeg txawv teb chaws cov nkauj ua suab paj nruag
Cov kev sib txuas lus
Yog li tom qab peb nkag siab cov laj thawj tom qab suab paj nruag, peb tuaj yeem sib txuas lus nws ntawm peb cov neeg ua si li cas?
rau qhov ntawd, peb siv MQTT, tshaj tawm-tso npe network raws tu qauv uas xa xov ntawm cov khoom siv.
txhua tus neeg ua si tau sau npe rau ob lub ncauj lus: lub voj (tau txais lub voj tam sim no tshaj plaws) thiab tig (tau txais tus lej ntawm tus neeg uas ua ntawv tam sim no rau lub hom phiaj sib txuas).
Lawv tig thaum tus neeg ua si tau ua tiav lub suab nws yuav nias lub pob UP thiab lub voj (qhov hloov kho tshiab) yuav raug xa mus rau MQTT tus broker, uas yuav xa nws rov qab mus rau txhua tus neeg ua si ntawm lub voj voj.
lub voj no yuav nyob "nyob twj ywm" kom txog thaum lub voj tam sim no ua tiav thiab tom qab ntawd yuav hloov nws. yog li nws yuav pob tshab rau tus neeg uas ua ntawv. kuj vim tias lub voj tshiab tam sim no tau khaws tseg hauv zos ntawm cov khoom siv ntaus ntawv tsis muaj internet latency rau cov nkauj yog li peb tau daws qhov teeb meem thib ob.
Kauj ruam 2: Teeb Tus Neeg rau zaub mov - Ngrok
ngrok yog kev pabcuam hauv qhov av. Nws tso cai rau peb nthuav tawm cov kev pabcuam hauv ib cheeb tsam (hauv peb qhov xwm txheej, Node -RED) mus rau ntiaj teb sab nrauv - yam tsis muaj teeb meem teeb tsa server lossis cuam tshuam nrog DNS cov ntaub ntawv. Koj yooj yim khiav Node-RED ntawm koj lub computer, thiab tom qab ntawd khiav ngrok ntawm tib lub chaw nres nkoj Node-RED tau ua haujlwm.
Qhov ntawd yog - koj yuav tau txais URL uas koj tuaj yeem siv nkag mus rau Node -RED los ntawm txhua qhov chaw hauv ntiaj teb, tsis hais txog lub network twg nws txuas nrog.
Kev teeb tsa & teeb tsa
- Rub tawm ngrok rau koj lub operating system los ntawm no.
- Ua raws cov theem ntawm nplooj ntawv rub tawm, kom txog rau thaum "Hluav Taws nws" kauj ruam.
- Hauv "Hluav Taws nws nce qib", pauv 80 rau 1883 - thiab http rau tcp raws li hauv,./ngrok tcp 1883 nyob ntawm koj tus kheej
- tseg qhov URL thiab tus lej chaw nres nkoj (tau pom hauv daim duab) peb yuav xav tau, tom qab.
Kauj Ruam 3: Teeb Tus Neeg rau zaub mov - Node -Red
Tus neeg rau zaub mov logic ntawm txoj haujlwm, Node-RED yog qhov pom kev ib puag ncig uas tso cai rau koj txuas ntau yam software (thiab kho vajtse!).
Ntawm no peb tau ua lub logic ntawm kev sib txuas lus ntawm txhua tus neeg ua si (sib koom thiab tau txais cov loops thiab sib koom tes)
Nruab Node-Red
ua raws cov theem hauv qab no txhawm rau thauj peb Node-RED ntws ntawm koj lub computer hauv zos:
- Node-RED xav tau Node.js, nruab nws los ntawm no
- nruab Node-RED nws tus kheej siv cov lus qhia ntawm no.
Tam sim no koj tau Node-RED teeb tsa, khiav nws siv cov lus qhia ntawm cov kauj ruam saum toj no thiab siv tau koj tuaj yeem pom nplooj ntawv khoob. Nws yuav tsum nyob hauv
Tam sim no koj yuav tsum tau xa cov khoom ntws uas peb siv rau txoj haujlwm no, koj tuaj yeem pom nws ntawm no thiab tsuas yog nias ntshuam ntxiv JSON cov ntawv thiab nias Deploy.
Nruab Node-Red:
yog tias koj saib cov duab uas txuas nrog rau theem no koj tuaj yeem pom peb muaj 2 lub ntsiab "kev ua" peb tau txais lub voj tam sim no los ntawm ib tus ntawm peb cov neeg ua si thiab tom qab ntawd peb xa nws mus rau txhua lwm tus players. ntxiv rau, peb tshaj tawm txoj kev hloov tshiab rau txhua tus neeg ua si. yog li qhov kev ua si nyob hauv sync.
Kauj Ruam 4: Teeb Tus Server - MQTT (Mosquitto)
Txij li Node-RED tsis muaj nws tus kheej MQTT tus broker, thiab peb yuav xav tau kev sib txuas lus nrog peb lub ntsuas cua thiab tus ua haujlwm dhau MQTT, peb yuav siv tus kws tshaj lij MQTT broker. Txij li Node-RED pom zoo Mosquitto, qhov no yog qhov peb yuav siv. Saib ntawm no txhawm rau qee cov ntaub ntawv hais txog MQTT thiab vim li cas nws thiaj siv feem ntau hauv IoT cov phiaj xwm.
Kev teeb tsa & teeb tsa
- Rub tawm Mosquitto los ntawm no thiab nruab nws, txhua yam raws li koj lub operating system.
- Feem ntau, koj yuav tsum tau ua raws cov lus qhia ntawm no txhawm rau txuas Node-RED rau Mosquitto. Txawm li cas los xij, yog tias koj siv peb cov ntws, nws twb tau teeb tsa ua ntej rau koj. Tsuav koj txhim kho qhov ntws thiab Mosquitrro kom raug, thiab Mosquitto khiav ntawm chaw nres nkoj 1883 (uas nws khiav los ntawm lub neej ntawd), nws yuav tsum ua haujlwm tawm ntawm lub thawv.
- Nco ntsoov tias qhov no txhais tau tias MQTT broker thiab koj Node-RED server khiav ntawm tib lub tshuab. Qhov no muaj txiaj ntsig zoo rau kev sib txuas lus yooj yim hauv cov kab ke. Saib daim ntawv hauv qab no kom paub ntau ntxiv.
Saib xyuas MQTT kev mus los
Kuv siv MQTTfx los tshuaj xyuas cov tsheb, nws yog cov cuab yeej zoo nrog GUI yooj yim heev.
Kauj ruam 5: Txoj Cai
koj tuaj yeem pom cov cai hauv GitHub (nrog txhua cov ntaub ntawv cov ntaub ntawv thiab teeb tsa.h)
Kev vam khom:
ua ntej thauj cov cai rau esp2866 koj yuav tsum tau teeb tsa ob peb lub tsev qiv ntawv:
- libmad-8266 (txiav suab paj nruag los ntawm SPIFF thiab rau hauv I2S)
- EspMQTTClient
- ESP8266WiFi
- Adafruit_NeoPixel
Tshaj tawm lub suab rau ESP siv SPIFF:
- ua raws li cov lus qhia zoo no.
- ntxiv cov ntaub ntawv tais ceev tseg rau cov npe kab ntawv.
- Hauv Arduino IDE hauv Cov Cuab Yeej hloov Flash loj rau "4MB (FS: 3MB TOA: ~ 512KB)"
- Kuj tseem nyob hauv Cov Cuab Yeej Nias ESP2866 Cov Ntaub Ntawv Teev Npe Tso Tawm
Teeb qhov tsis:
tom qab ntawd mus rau cov ntaub ntawv config.h thiab ntxiv cov ntaub ntawv xav tau xws li daim ntawv pov thawj WIFI thiab ngrok URL thiab chaw nres nkoj los ntawm cov kauj ruam dhau los (kos daim duab txuas rau siv).
p.s-Kuv tseem tsis tau ntxiv qhov pib-txuas ua haujlwm los pab koj teeb tsa WIFI thiab ngrok cov ntaub ntawv los ntawm koj lub xov tooj ntse, vim nws tsuas yog thawj qhov pov thawj ntawm lub tswv yim, kuv xav ntxiv qee hnub.
Teeb tus lej ntawm cov neeg uas koj xav tau (qhov kev ua si no ua haujlwm zoo tshaj plaws rau 2-3 tus neeg thiab tawm ntawm lub thawv nws tau ntim nrog cov suab nrov rau 2 tus neeg ua si). tab sis tuaj yeem hloov kho tau yooj yim rau ntau ntxiv:
rau txhua tus neeg ua si ntxiv lwm qhov ntws hauv lub node-liab kom tshaj tawm lub voj nyob hauv qab cov ncauj lus tshwj xeeb ntawm cov neeg siv.
kuj, koj tuaj yeem kho cov suab paj nruas suab los ntawm canging cov kab no rau koj cov suab nrov:
ntawm no koj tuaj yeem pom 3 yam cuab yeej (Chrods rau tus neeg ua si 0, Ua rau tus neeg ua si 1, thiab Bass rau tus neeg ua si 2)
const char* paths [NUMofNotes] = {"/blank1.wav", "/Chords_Am.wav", "/Chords_F.wav", "/Chords_C.wav", "/Chords_G.wav", "/Chords_Dm.wav", "/blank2.wav", "/Lead_C.wav", "/Lead_D.wav", "/Lead_E.wav", "/Lead_G.wav", "/Lead_A.wav", "/blank0.wav", "/Bass_C3.wav", "/Bass_D3.wav", "/Bass_F3.wav", "/Bass_G3.wav", "/Bass_A3.wav"};
Kauj Ruam 6: Luam Tus Qauv 3D
Rau thawj kauj ruam, rub tawm STL thiab luam tawm.
tom qab tshem cov kev txhawb nqa thiab tej zaum me ntsis ntawm cov xuab zeb (nyob ntawm qhov kev daws teeb meem ntawm lub tshuab luam ntawv)
pleev xim rau xim uas xav tau
Kauj Ruam 7: Sib dhos thiab Vuam
Yog li hauv paus ntawm no yog qhov twg khawv koob tiag tshwm sim.
koj tuaj yeem ua raws cov txheej txheem no thiab txuas txhua yam ua ke.
siab tias koj tuaj yeem hloov txoj haujlwm ntawm tus lej PIN tsuas yog nco ntsoov hloov nws hauv cov cai ib yam.
A0 thiab I2S tau kho zoo nyob hauv qhov chaw:
txij li A0 yog rau tus choj tiv thaiv (peb siv qhov sib txawv hauv qhov tam sim no kom paub tias khawm tawm ntawm 5 tau nias - zoo ib yam li Cov Lus Qhia no.
I2S muaj cov cim tshwj xeeb uas koj tuaj yeem pom nws ntawm no
Kauj Ruam 8: Ua Si Ib Loops Nrog Koj Cov Phooj Ywg
Pom zoo:
Kev Tsim Qauv Duab Duab/Duab Duab Duab: 4 Kauj Ruam
Kev Tsim Qauv Duab Duab/Duab Duab Duab: Nyob zoo txhua tus, Hauv qhov kev qhia no, Kuv yuav qhia koj cov txheej txheem ntawm yuav ua li cas thiaj tsim 3D qauv siv cov duab digital. Cov txheej txheem hu ua Photogrammetry, tseem hu ua Image-Based Modeling (IBM). Tshwj xeeb, hom txheej txheem no tau siv los rov ua dua
Cov Duab Duab Duab thiab Cov Duab 1: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Cubes thiab Cov Duab 1: Thaum sim nrog qee cov ntoo ntoo thiab cov duab los qhia, kuv pom ob peb txoj hauv kev los ua cov voos thiab lwm yam duab los ntawm cov khoom siv yooj yim. Los ntawm kev muab cov no los ua Cov Ntawv Qhia, Kuv vam tias yuav txhawb nqa kev ua si thiab kev kawm. Kev hloov pauv ntawm qhov kev qhia no
Yuav Ua Li Cas Thiaj Li Tshem Tawm Lub Computer Nrog Cov Kauj Ruam Yooj Yim thiab Duab: 13 Kauj Ruam (nrog Duab)
Yuav Tsum Tshem Tawm Lub Khoos Phis Tawj Li Cas Nrog Cov Kauj Ruam Yooj Yim thiab Duab: Nov yog cov lus qhia txog yuav ua li cas tshem lub PC. Feem ntau ntawm cov khoom siv yooj yim yog hloov pauv thiab tshem tawm tau yooj yim. Txawm li cas los xij nws yog ib qho tseem ceeb uas koj tau koom nrog nws. Qhov no yuav pab tiv thaiv koj kom tsis txhob poob ib feem, thiab tseem ua rau kev rov ua dua tshiab
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: 4 Cov Kauj Ruam (nrog Duab)
Cov Duab Duab Duab Duab, WiFi Txuas - Raspberry Pi: Nov yog txoj hauv kev yooj yim heev thiab tus nqi qis mus rau cov duab thav duab digital - nrog qhov zoo ntawm kev ntxiv /tshem cov duab hla WiFi ntawm 'nyem thiab luag' siv (pub dawb) xa cov ntaub ntawv . Nws tuaj yeem siv tau los ntawm qhov me me £ 4.50 Pi Zero. Koj tseem tuaj yeem hloov pauv
Melody Box: 4 Kauj Ruam (nrog Duab)
Melody Box: Nyob zoo! Kuv tau ua ib lub thawv uas muaj 3 lub nyees khawm nrog rau txhua lub suab nkauj sib txawv.Muaj ib lub suab nkauj muaj cov xim LED sib txawv thiab mus ntxiv thaum sau ntawv raug ntaus. Thaum twg los xij koj thawb lub "tom ntej" khawm lub suab nkauj mus nrawm dua.Qhov uas koj xav tau: