filmov
tv
Another Arduino drum sequencer with minimum hardware drumseq81212 (with schematic)
Показать описание
Another Arduino drum sequencer with minimum hardware (schematic and code included). The interface is composed of two rotary encoders with switch and a 128x64 I2C OLED display. The display presents a grid with twelve rows x eight columns, rows are ticks, subdivisions of a beat, columns are tracks, each pattern can have a maximum of twelve beats. Rotary encoders are used to navigate through the grid coordinates. The X encoder switch is used to choose between Cursor, Write, or Beat mode. In Cursor mode the selected rectangular slot on the grid is highlighted by thicker lines. When the cursor passes over an actived slot (On) the slot is erased (Off). In Write mode a filled square is drawn inside the next selected slot on the grid, indicating it is On. In Beat mode the X encoder is used to select which beat will be edited, while the Y encoder is used to set the pattern size (beats per measure). The Y encoder switch selects four modes: Edit, Tempo, Play, and Load. In Edit mode, both X and Y encoders are used to navigate the grid and create or edit a pattern, as described earlier. In Tempo mode the Y encoder sets the sequencer BPM (Beats Per Minute). Entering Play mode starts playing the current pattern. Load mode allows the Y encoder to select and load preset patterns previously stored in the Arduino internal EEPROM. The right side of the display shows BPM tempo and the current modes. The left side shows the row numbers, which beat is being edited, the pattern size (beats per measure) and preset number. Each track fires a gate using eight Arduino pins and also sends MIDI notes through TX pin (channel 10, GM drum notes 35, 38, 42, 46, 45, 50, 64, 76). I am using the MIDI output to control an analog drum module, the eight gates are serving as LED drivers. A ninth LED (dual) serves as the metronome beat indicator. This version has some improvements over the earlier one: each pattern can have a maximum of 144 steps divided in twelve beats. Pattern is still arranged in a bi-dimensional array, this time a 12x12 array containing the twelve beats and twelve subdivisions, the eight tracks are represented as the bits in a byte (kind of a bitmap). The clock now is more robust, using TimerOne library instead of the currentMillis previousMillis approach. There is no OLED activity during play. Code is a bit less messy (it is in the video comments).Libraries do all the hard work: Luni64 Encoder Tool, Adafruit_SSD1306 and GFX, Paul Stoffregen's TimerOne, EEPROM and Wire. I just connected the dots.Hardware:- Arduino Nano.- One 128x64 I2C OLED, connected to Arduino GND, +5V, SCL (A5) and SDA (A4).- Two rotary encoders with switch, the Y encoder terminal connections: A to Arduino pin 4, B to pin 2, C to GND, one switch terminal to pin 6, the other to GND. The X encoder terminal connections: A to Arduino pin 5, B to pin 3, C to GND, one switch terminal to pin 7,- Eight red LEDs, cathode to ground, anode to Arduino pins 8,9,10,11,12, A0,A1,A2 through current limiting resistors (below).- Eight 1K resistors limiting current (5mA) to the red LEDs.- One dual color LED (green and red), common cathode to GND, green to Arduino pin A3 through 680R resistor, red to pin 13 through 680R resistor.- Two 680R resistors, mentioned above.- Two 220R resistors for the MIDI out connector, next.- One 5 pin DIN female connector (MIDI), pin 5 connected to Arduino TX pin through a 220R resistor, pin 4 to +5V through another 220R resistor. Pin 2 and shield connected to GND.- One 100µF/10V electrolytic capacitor connected to +5V and GND.Power supply can be through USB, or a battery or PSU connected to Vin pinand GND. Voltage connected to Vin should be equal or greater than 7V and less than 12V.In order to use the track outputs as gates to directly control non MIDIthings, the red LEDs should be removed, keeping the 1K resistors. Theoutputs will be 0V off, +5V on, this will work with most modular synththings.
Join this channel:
Thanks for watching.
Join this channel:
Thanks for watching.
Комментарии