Cov txheej txheem:

Arduino Synth / Tone Generator: 5 Cov Kauj Ruam
Arduino Synth / Tone Generator: 5 Cov Kauj Ruam

Video: Arduino Synth / Tone Generator: 5 Cov Kauj Ruam

Video: Arduino Synth / Tone Generator: 5 Cov Kauj Ruam
Video: Arduino Polyphonic Sound Synthesis - 8-bit Music and DTMF Tone Generator 2024, Hlis ntuj nqeg
Anonim
Arduino Synth / Tone Generator
Arduino Synth / Tone Generator

Nov yog Synth / Tone Generator uas siv Tone hais kom ua uas yog ib txwm nyob rau Arduino. Nws muaj 12 tus yuam sij tus kheej uas tuaj yeem teeb tsa los ua si txhua zaus ntawm cov xwm txheej yoj. Nws muaj peev xwm nce thiab nqis octaves nrog lub pob. Nws kuj tseem muaj Arduino thib ob uas yuav ua rau "ntaus" thiab koj tuaj yeem hla dhau txhua qhov kev ntaus thiab kho lub suab nrawm ntawm kev ntaus nrog lub zog. Nws tawm mus rau ib tus neeg hais lus nkaus xwb. Nws yuav zoo li nyuaj tab sis nws yog qhov yooj yim zoo nkauj los ua thiab koj tuaj yeem hloov kho koj lub suab los ntawm kev hloov pauv txoj cai.

Kauj ruam 1: Cov ntaub ntawv

  • 2 Arduino UAS
  • 171kΩ Cov neeg tiv taus
  • 1 50kΩ Potentiometer
  • 16 Tact Hloov (Pushbuttons)
  • 14Ω Hais Lus
  • 19V Roj Teeb
  • Ntau cov xov hlau

Yog tias koj xav ua kom lub rooj sib tw zaum kawg thiab ua cov khoom kawg zoo li kuv koj tseem yuav xav tau

  • 1 Protoboard
  • 228 Pin Qhov
  • Txiv neej thiab Poj Niam Headers
  • 15V Regulator
  • 1 47 uF Capacitor
  • 2 16 Mhz Crystals
  • 2 On/Off Hloov
  • Cov khoom ua si keyboard tshem cov yuam sij los ntawm

Kauj Ruam 2: Hlau Breadboard

Hlau Breadboard
Hlau Breadboard
Hlau Breadboard
Hlau Breadboard
Hlau Breadboard
Hlau Breadboard

Siv cov duab saum toj no tsim lub Circuit Court ntawm lub khob cij.

Rau thawj arduino nuv 12 tact hloov mus rau tus pin 13-2 txhua nrog lawv tus kheej rub tawm resistor. Txuas 2 qhov hloov pauv ntxiv rau A5 thiab A4 tib txoj kev. Qhov kawg los txuas yog tus hais lus. Txuas ib kawg rau hauv av thiab lwm qhov kawg rau tus pin 0.

Rau qhov thib ob arduino nuv 2 hloov mus rau tus pin 9 thiab 10 tib yam nkaus li ua ntej. Txuas lub 50k potentiometer rau tus pin A0, 5V, thiab nrog 1k resistor rau hauv av. Thaum kawg txuas tus pin 8 rau tib lub xov tooj ntawm tus hais lus uas koj tau pin 0 ntawm thawj arduino. Tsis txhob hnov qab txuas thaj chaw ntawm ob lub arduinos ua ke.

Kauj Ruam 3: Txoj Cai

Txoj Cai
Txoj Cai

Tom ntej upload Tone Keyboard code rau thawj arduino thiab Rhythm Section code mus rau qhov thib ob ardunio. Yog tias txoj cai tsis xav upload sim txuas tus neeg hais lus ib ntus thiab sim dua.

Kuv piav qhia ntau yam hauv txoj cai nws tus kheej yog li kuv tsuas yog qhia koj yuav hloov pauv yam sib txawv kom ua tiav lub suab sib txawv li cas.

Txhawm rau hloov qhov zaus ntawm txhua tus yuam sij ntawm cov keyboard koj yuav tsum hloov tus lej hauv Tone hais kom ua hauv Tone Keyboard code (Kuv muab tus lej koj hloov ua tus lej hauv qab no)

yog tias (cN == HIGH)

{lub suab (0, (16.35 * octave)); }

Los ntawm lub neej ntawd kuv tau tso lub hauv paus zaus ntawm cov suab paj nruag sau tseg tab sis koj tuaj yeem hloov lawv mus rau qhov koj xav tau.

Txhawm rau hloov Beats/Rhythms koj yuav tsum hloov Txoj Cai Rhythm Section. Zoo ib yam rau Tone code txhua yam koj yuav tsum tau ua yog hloov pauv zaus (Bolded hauv qab) thiab nws yuav hloov qhov kev ceeb toom ua si. Koj tuaj yeem ntxiv lwm qhov ncua sij hawm thiab suab nrov yog tias koj xav ntxiv cov ntawv sau tseg rau qhov sib dhos.

yog (qauv == 1) {suab (8, 55, sensorHalf);

ncua (sensorValue);

suab nrov (8, 58.27, sensorFourth);

ncua (sensorHalf);

suab nrov (8, 58.27, sensorFourth);

ncua (sensorHalf); }

Koj tuaj yeem xa mus rau daim duab saum toj no uas muaj cov zaus rau txhua qhov cim suab paj nruag ntawm txhua lub octave yog li koj tuaj yeem tsim koj tus kheej kev sib dhos.

Kauj Ruam 4: Tsim Yam Khoom Kawg

Tsim Yam Khoom Kawg
Tsim Yam Khoom Kawg
Tsim Yam Khoom Kawg
Tsim Yam Khoom Kawg
Tsim Yam Khoom Kawg
Tsim Yam Khoom Kawg

Cov kauj ruam no yog nyob ntawm yeem tab sis yog tias koj xav ua qhov kuv tau ua koj yuav tau muab cov laug cam nrog ob tus tswj hwm micro rau nws. Txhua yam koj yuav tsum tau ua yog tshem IC tawm ntawm lub rooj tsav xwm arduino thiab muab lawv tso rau hauv pcb dawb (koj yuav tsum siv lub qhov). Tsuas yog yam ntxiv uas koj yuav tsum tau ua yog txuas 16Mhz siv lead ua ntawm tus pin 9 thiab 10 ntawm txhua IC. Koj yuav tsum siv tus tswj hwm 5V txhawm rau nqis 9V los ntawm lub roj teeb txhawm rau ua kom muaj zog hauv Circuit Court. Muab 47uF capacitor nruab nrab ntawm 5V thiab hauv av los pab ua kom cov zis ruaj khov. Hauv av yog tus pin 8 thiab 5V yog tus pin 7 ntawm IC. Xa mus rau Pinout daim duab kom pom cov pins ntawm IC sib raug rau cov koob digital. Feem ntau nws tsuas yog siv lub Circuit Court ntawm lub khob cij thiab txav nws mus rau pcb. Kev siv lub taub hau yuav siv sijhawm ntxiv rau lub vijtsam tab sis lawv yuav ua rau daws teeb meem yooj yim dua yog li kuv yuav qhia siv lawv. Txhawm rau tsim cov yuam sij Kuv tau sib cais ib qho khoom ua si qub keyboard thiab muab lub tswv yim hloov pauv hauv qab txhua tus yuam sij. Thaum koj ua tiav kev tsim txhua daim koj tuaj yeem tsim rooj plaub rau nws. Kuv tsuas yog kub txhua yam rau qee cov ntoo tab sis koj tuaj yeem ua kom nws zoo dua li kuv yog tias koj xav tau.

Kauj Ruam 5: Xeem Nws

Image
Image

Tam sim no koj tuaj yeem muaj kev lom zem nrog koj cov synth tshiab. Nws tsuas muaj 1 daim ntawv polyphony yog li koj tsuas tuaj yeem ua nkauj yooj yim tab sis nrog ntu kev sib dhos qhib koj tuaj yeem ua qee lub suab txias heev. Muaj kev lom zem!

Pom zoo: