Code Monkey home page Code Monkey logo

arduino-vcvrack's Introduction

Arduino - VCV Rack

Two way communication between an Arduino board and a VCV Rack module.

VCV Rack plugin

The VCV Rack modules are part of the plugin Arduino Modules located at /vcvrack/ArduinoModules.

First Arduino prototype

The first prototype is an Arduino Leonardo that communicates with a VCV Rack module using MIDI. The purpose of this prototype is to understand how to interact with different components. A basic set of components are connected to the Arduino:

  • 8 LEDs
    • Connected to Arduino digital pins 0 to 7
  • 1 push button
    • Digital pin 8
  • 1 potentiometer
    • Analog input 0
  • 1 rotary encoder with push button
    • Push button on digital pin 9
    • Rotary outputs on digital pins 10 and 11

The Arduino does nothing more than to send knob and button changes to the VCV Rack module in the form of MIDI Continuous Control data, and to switch the LEDs on or off based on MIDI CC data it receives from the module.

MIDI implementation chart

All MIDI communication uses Continuous Controllers 14 and 15 because they are 'officially' undefined in the MIDI specification.

CC 14
8 Pushbutton off
9 Pushbutton on
10 Encoder button off
11 Encoder button on
12 Encoder -1
13 Encoder +1
   
16 LED 0 off
17 LED 0 on
18 LED 1 off
19 LED 1 on
20 LED 2 off
21 LED 2 on
22 LED 3 off
23 LED 3 on
24 LED 4 off
25 LED 4 on
26 LED 5 off
27 LED 5 on
28 LED 6 off
29 LED 6 on
30 LED 7 off
31 LED 7 on
CC 15
0 - 127 Potentiometer value

First prototype images

Prototype 1

Prototype 1

Prototype 1

Arduino sketch and VCV Rack module 'Prototype 1A'

This first prototype just implements communication between the Arduino and the VCV Rack module, nothing more. So it's actually a MIDI controller with the added functionality that it can monitor 8 gate signals with the 8 LEDs.

  • Potmeter, pushbutton and rotary encoder changes are sent to the module, where their values are presented on four output connectors.
    • Potmeter value as 0 to 5 volts.
    • Potmeter value inverted, 5 to 0 volt.
    • Pushbutton state as 0 or 5 volt (5 is pushed state).
    • Encoder changes as de- or increments of 1/12th volt (or 1 note chromatically down or up, the V/Oct. scaling)
  • Eight inputs on the VCV Rack module show their input values on the Arduino panel's eight LEDs.
    • A LED switches on as soon as the input reaches 5 volt.
    • A LED switches off when the input reaches 0 volt.

Arduino sketch 'Prototype 1B'

The Prototype 1B sketch is a MIDI pattern generator. It sends MIDI notes over USB.

The uClock library generates a procise clock for the patterns.

uClock by Midilab:
website: http://midilab.co/
source: https://github.com/midilab/uClock

C test compile

gcc test.c patterns.c -o test

Notes

libusb

libusb is a library for communication with USB devices: https://libusb.info/
On Mac, use Homebrew to install libusb:

brew install libusb

On Mac libusb will be installed at:

/usr/local/Cellar/libusb/<version nr, example: 1.0.21>/lib/libusb-1.0.a

Connect a rotary encoder

Arduino Leonardo Mac OS Mojave

Arduino Leonardo USB port doesn't appear.
Possible fix: https://arduino.stackexchange.com/questions/57126/connect-to-ch340-on-macos-mojave

sudo rm -rf /Library/Extensions/usbserial.kext
sudo rm -rf /System/Library/Extensions/usb.kext

Then reboot.

<style> img { max-width: 480px; } </style>

arduino-vcvrack's People

Contributors

hisschemoller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

arduinominas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.