Dersler ve öğrenme oyunu

Dijital bir efekt pedalı yap

Uno üzerinde bir gitar efekt pedali, gitar için bir fonksiyon üreteciyle birlikte.

Bitmiş pedal

Dijital efekt pedalı yapmak her derste aynı kartı kullanır:

  • The guitar: a fonksiyon üreteci, 220 Hz sinüs, 2 V tepe, bir manyetik pickup sinyali gibi 0 V ortalamalı.
  • The input: a 1 uF capacitor into A0, held at 2.5 V by two 10 k resistors: öngerilim bu.
  • The brain: an Arduino Uno, ADC'si A0 üzerinde serbest çalışıyor ve Timer 2 saniyede 15.625 kez kesme yapıyor.
  • Çıkış: pin 9 üzerinde 62,5 kHz'de 8 bit PWM, 1 k ve 100 nF ile yumuşatılır, sonra 1 uF ile duyduğu perdeyi gösteren bir piezo'ya gider.
  • Controls: a potentiometer on A1, and two footswitch: MUTE on pin 2 stops the strings, FX on pin 3 switches the effect.

Bu bir dijital gitar pedalı. Load cell pedal yap içindeki sim yarış pedallarından farklı bir şeydir.

Nasıl çalışır

In and out. The capacitor blocks DC and the divider puts the swing in the middle of the ADC's 0 to 5 V; the code subtracts 128 to take the bias off. Each interrupt takes the latest sample, runs the effect and writes OCR1A. The knob is read eight times a second by borrowing the ADC for a sample.

Gain and clipping. Multiply, then limit: hard clipping cuts flat at the rails; soft clipping bends through y = 1.5t - 0.5t^3 first, from a 256-entry table.

Delay. A ring buffer of 1,280 bytes, all the Uno's 2 KB can spare beside the stack: 81 ms at most. Feedback writes some of the echo back for repeats, and MUTE measures the tail.

Tremolo. A slow phase accumulator, an LFO, scales every sample between 1 - depth and 1, as a triangle or a square.

Wah. Chamberlin's state-variable filter in fixed point, its band-pass output swept from 200 Hz to 2 kHz by the knob or by an LFO for auto-wah.

Latency. Sample by sample, the output follows the input within a tick. Working in blocks of 64 or 256 adds 4.1 or 16.4 ms, measured with MUTE.

Kurs

  1. Ses girişi ve çıkışı: öngerilim, salınım, örnekleme, Nyquist ve gerçek bir girişin neden tampona ihtiyaç duyduğu.
  2. Gain and clipping: clean gain, hard and soft clipping, and harmonics.
  3. Delay: a ring buffer, feedback, the tail, and the 2 KB limit.
  4. Tremolo: bir LFO'nun hızı, derinliği ve şekli.
  5. Wah: taranan bant geçiren, otomatik wah ve Q.
  6. Gecikme süresi: örnek örnek işleme ile blok işleme karşılaştırması.
  7. Proje: iki efektli pedal: zincirde drive ve tremolo, bypass ve sıra değişimi.

İşaretlenen her adım, çalışan devreye karşı test edilir.