c h e a t e r – b o x
#diy cheater box shows the #midi notes going on, #keyboard layout and in #guitartab
) follow 4 more art music gizmos, share 2 support sorcery #🤖 (
#lofibeats and #futurebass goes in, gets split, and one output gets remapped the peculiar way the #volcasample needs. That remap job was all it did at first, with just an #arduino and a #midishield but then a deal on an LCD came by and it was time to stack ‘em. #🎚
We’re already finding strange new #guitar licks by just tumblin through the green indicated spots on-screen. and no one has to fully learn our bops to join in. it’s a cheap touch-screen so you’ll have to trust that it looks clearer in person. the clear box is what sony action cams are sold in. plastic animals as mounting hardware, for versatility.
#makersgonnamake#makersmovement#musichack#diymusic#homemademusic#midicontroller#studiogear#customaudio#musicgear#onlineisthenewfm
Code for Arduino Uno with midi shield and LCD shield
/* *******************************************************************************
Volca Sample Synth
Note to pitch enabled for Korg Volca Sample
Copyright 2015 Mauricio Maisterrena
modified by Woz Supposedly for DR-202 compatability
480x320 LCD notes display cheater thing also by Woz
Recomended: For better results when playing pitched notes always use samples tuned to midi note 60 (C4) as the "seed" sample.
*/
#include <MIDI.h>
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
#include <SPI.h> // f.k. for Arduino-1.5.2
#include "Adafruit_GFX.h"// Hardware-specific library
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;
//If you'r using a Mac and are getting a compilation error delete the next 3 lines of code
#ifdef MIDI_CREATE_DEFAULT_INSTANCE
MIDI_CREATE_DEFAULT_INSTANCE();
#endif
// -----------------------------------------------------------------------------
#define BLACK 0x0000
#define BLUE 0x0009
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
#ifndef min
#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
int keys[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int r;
int g;
int b;
//Note: Midi CC value 64 = Speed value 0
const int vSpeedValue[] = { //Pitches (speed) for each note
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 32, 34, 37, 40, 43, 45, 48, 51, 53, 56, 59, 61, 64, 67, 69, 72, 75, 78, 80, 83, 85, 88, 91, 93, 96, 97, 99, 100, 102, 103, 104, 106, 107, 108, 109, 111, 112
};
//Default Channel to send MIDI to Volca (Midi msg will be redirected to the corresponding channel on the Volca Sample)
#define vPolyChan 16
#define bassChan 11
int vFirstVoice = 5;
int vVoiceChan = vFirstVoice;
int vNote;
int prevNote;
// Range of notes that the Volca Sample can generate
int vPitchFirstNote = 36;
int vPitchLastNote = 84;
// Synth code, will assign the speed(pitch) depending on the note that was played
void fVoiceSend(int vVoiceChan, int vSpeed)
{
//MIDI.send(midi::NoteOff,60,0,vVoiceChan); //The Midi "Note Off" msg is not recognized by the volca Sample
MIDI.sendControlChange(43, vSpeed, vVoiceChan);
MIDI.send(MIDI.getType(), 60, MIDI.getData2(), vVoiceChan);
}
// -----------------------------------------------------------------------------
//This code will make it possibble to play each sample using a single midi channel (channel 16 by default) on mini notes 0 to 9 (the lowest notes)
void fChannelRedir(int vChan)
{
MIDI.send(MIDI.getType(),
MIDI.getData1(),
MIDI.getData2(),
vChan);
}
// -----------------------------------------------------------------------------
// This function will be automatically called when a NoteOn is received.
void handleNoteOn(byte channel, byte pitch, byte velocity)
{
if (MIDI.getChannel() != vPolyChan)
{
vVoiceChan = MIDI.getChannel();
}
vNote = MIDI.getData1();
if (MIDI.getChannel() == bassChan) {
if (vNote != prevNote) {
prevNote = vNote;
for (int l = 0; l < 12; l++) {
keys[l] -= 48;
if (keys[l] < 0) keys[l] = 0;
}
if (vNote < 12) {
keys[vNote] = 255;
} else if (vNote < 24) {
keys[vNote - 12] = 255;
} else if (vNote < 36) {
keys[vNote - 24] = 255;
} else if (vNote < 48) {
keys[vNote - 36] = 255;
} else if (vNote < 60) {
keys[vNote - 48] = 255;
} else if (vNote < 72) {
keys[vNote - 60] = 255;
} else if (vNote < 84) {
keys[vNote - 72] = 255;
} else if (vNote < 96) {
keys[vNote - 84] = 255;
} else if (vNote < 108) {
keys[vNote - 96] = 255;
}
disp();
}
}
if ( vNote < 10 & MIDI.getChannel() == vPolyChan)
{
fChannelRedir(vNote + 1);
}
/* Woz Supposedly added this part to map the DR-202 pads to the samples on the Volca Sampler on chan 16 */
else if ( vNote < 52 & MIDI.getChannel() == vPolyChan)
{
if (vNote == 36) {
fChannelRedir(1);
}
if (vNote == 35) {
fChannelRedir(3);
}
if (vNote == 38) {
fChannelRedir(2);
}
if (vNote == 40) {
fChannelRedir(4);
}
if (vNote == 42) {
fChannelRedir(9);
}
if (vNote == 46) {
fChannelRedir(10);
}
if (vNote == 50) {
fChannelRedir(5);
}
if (vNote == 51) {
fChannelRedir(7);
}
if (vNote == 47) {
fChannelRedir(6);
}
if (vNote == 49) {
fChannelRedir(8);
}
}
//Polyphonic 4 voices Synth
if ((vNote >= vPitchFirstNote && vNote <= vPitchLastNote) && (MIDI.getChannel() != vPolyChan) ||
(vNote >= 52 && vNote <= vPitchLastNote) && (MIDI.getChannel() == vPolyChan)) //Just notes on pitched range
{
fVoiceSend(vVoiceChan, vSpeedValue[vNote]);
if (vVoiceChan < vFirstVoice + 3 & MIDI.getChannel() == vPolyChan)
{
vVoiceChan++; //Go to the next voice
}
else
{
vVoiceChan = vFirstVoice; //Return to first voice channel
}
}
}
void setup()
{
uint16_t ID = tft.readID(); //
if (ID == 0xD3D3) ID = 0x9481; // write-only shield
tft.begin(ID);
tft.fillScreen(BLACK);
tft.setRotation(3);
tft.setTextColor(BLUE, BLACK);
tft.setCursor(3, 30);
tft.setTextSize(4);
tft.println("woz supposedly");
//strings
tft.drawLine(10, 289, 470, 289, tft.color565(255, 0, 0));
tft.drawLine(10, 290, 470, 290, tft.color565(255, 0, 0));
tft.drawLine(10, 291, 470, 291, tft.color565(255, 0, 0));
tft.drawLine(10, 269, 470, 269, tft.color565(255, 0, 0));
tft.drawLine(10, 270, 470, 270, tft.color565(255, 0, 0));
tft.drawLine(10, 271, 470, 271, tft.color565(255, 0, 0));
tft.drawLine(10, 249, 470, 249, tft.color565(255, 0, 0));
tft.drawLine(10, 250, 470, 250, tft.color565(255, 0, 0));
tft.drawLine(10, 251, 470, 251, tft.color565(255, 0, 0));
tft.drawLine(10, 230, 470, 230, tft.color565(255, 0, 0));
tft.drawLine(10, 210, 470, 210, tft.color565(255, 0, 0));
tft.drawLine(10, 190, 470, 190, tft.color565(255, 0, 0));
//frets
tft.drawLine(40, 300, 40, 180, tft.color565(192, 192, 192));
tft.drawLine(80, 300, 80, 180, tft.color565(255, 0, 255));
tft.drawLine(120, 300, 120, 180, tft.color565(255, 0, 255));
tft.drawLine(160, 300, 160, 180, tft.color565(255, 0, 255));
tft.drawLine(200, 300, 200, 180, tft.color565(255, 0, 255));
tft.drawLine(240, 300, 240, 180, tft.color565(255, 0, 255));
tft.drawLine(280, 300, 280, 180, tft.color565(255, 0, 255));
tft.drawLine(320, 300, 320, 180, tft.color565(255, 0, 255));
tft.drawLine(360, 300, 360, 180, tft.color565(255, 0, 255));
tft.drawLine(400, 300, 400, 180, tft.color565(255, 0, 255));
tft.drawLine(440, 300, 440, 180, tft.color565(255, 0, 255));
//dots
tft.fillCircle(20,260,4,tft.color565(64,64,255));
tft.fillCircle(20,220,4,tft.color565(64,64,255));
tft.fillCircle(140,240,4,tft.color565(64,64,255));
tft.fillCircle(220,240,4,tft.color565(64,64,255));
tft.fillCircle(300,240,4,tft.color565(64,64,255));
tft.fillCircle(380,240,4,tft.color565(64,64,255));
MIDI.turnThruOff();
// Connect the handleNoteOn function to the library,
// so it is called upon reception of a NoteOn.
MIDI.setHandleNoteOn(handleNoteOn); // Put only the name of the function
// Initiate MIDI communications, listen to all channels
MIDI.begin(MIDI_CHANNEL_OMNI);
//Set the pitch envelopes to 0 (Midi cc value of 64)
int counter = 1;
while (counter <= 10)
{
MIDI.sendControlChange(43, 64, vVoiceChan);
MIDI.sendControlChange(44, 64, vVoiceChan);
counter++;
}
vVoiceChan = vFirstVoice;
disp();
}
void loop()
{
// Call MIDI.read the fastest you can for real-time performance.
MIDI.read();
}
void disp() {
// E
tft.drawRect(10, 289, 20, 3, tft.color565(255 - keys[4], keys[4], 0));
tft.drawRect(50, 289, 20, 3, tft.color565(255 - keys[5], keys[5], 0));
tft.drawRect(90, 289, 20, 3, tft.color565(255 - keys[6], keys[6], 0));
tft.drawRect(130, 289, 20, 3, tft.color565(255 - keys[7], keys[7], 0));
tft.drawRect(170, 289, 20, 3, tft.color565(255 - keys[8], keys[8], 0));
tft.drawRect(210, 289, 20, 3, tft.color565(255 - keys[9], keys[9], 0));
tft.drawRect(250, 289, 20, 3, tft.color565(255 - keys[10], keys[10], 0));
tft.drawRect(290, 289, 20, 3, tft.color565(255 - keys[11], keys[11], 0));
tft.drawRect(330, 289, 20, 3, tft.color565(255 - keys[0], keys[0], 0));
tft.drawRect(370, 289, 20, 3, tft.color565(255 - keys[1], keys[1], 0));
tft.drawRect(410, 289, 20, 3, tft.color565(255 - keys[2], keys[2], 0));
tft.drawRect(450, 289, 20, 3, tft.color565(255 - keys[3], keys[3], 0));
// A
tft.drawRect(10, 269, 20, 3, tft.color565(255 - keys[9], keys[9], 0));
tft.drawRect(50, 269, 20, 3, tft.color565(255 - keys[10], keys[10], 0));
tft.drawRect(90, 269, 20, 3, tft.color565(255 - keys[11], keys[11], 0));
tft.drawRect(130, 269, 20, 3, tft.color565(255 - keys[0], keys[0], 0));
tft.drawRect(170, 269, 20, 3, tft.color565(255 - keys[1], keys[1], 0));
tft.drawRect(210, 269, 20, 3, tft.color565(255 - keys[2], keys[2], 0));
tft.drawRect(250, 269, 20, 3, tft.color565(255 - keys[3], keys[3], 0));
tft.drawRect(290, 269, 20, 3, tft.color565(255 - keys[4], keys[4], 0));
tft.drawRect(330, 269, 20, 3, tft.color565(255 - keys[5], keys[5], 0));
tft.drawRect(370, 269, 20, 3, tft.color565(255 - keys[6], keys[6], 0));
tft.drawRect(410, 269, 20, 3, tft.color565(255 - keys[7], keys[7], 0));
tft.drawRect(450, 269, 20, 3, tft.color565(255 - keys[8], keys[8], 0));
// D
tft.drawRect(10, 249, 20, 3, tft.color565(255 - keys[2], keys[2], 0));
tft.drawRect(50, 249, 20, 3, tft.color565(255 - keys[3], keys[3], 0));
tft.drawRect(90, 249, 20, 3, tft.color565(255 - keys[4], keys[4], 0));
tft.drawRect(130, 249, 20, 3, tft.color565(255 - keys[5], keys[5], 0));
tft.drawRect(170, 249, 20, 3, tft.color565(255 - keys[6], keys[6], 0));
tft.drawRect(210, 249, 20, 3, tft.color565(255 - keys[7], keys[7], 0));
tft.drawRect(250, 249, 20, 3, tft.color565(255 - keys[8], keys[8], 0));
tft.drawRect(290, 249, 20, 3, tft.color565(255 - keys[9], keys[9], 0));
tft.drawRect(330, 249, 20, 3, tft.color565(255 - keys[10], keys[10], 0));
tft.drawRect(370, 249, 20, 3, tft.color565(255 - keys[11], keys[11], 0));
tft.drawRect(410, 249, 20, 3, tft.color565(255 - keys[0], keys[0], 0));
tft.drawRect(450, 249, 20, 3, tft.color565(255 - keys[1], keys[1], 0));
// G
tft.drawRect(10, 229, 20, 3, tft.color565(255 - keys[7], keys[7], 0));
tft.drawRect(50, 229, 20, 3, tft.color565(255 - keys[8], keys[8], 0));
tft.drawRect(90, 229, 20, 3, tft.color565(255 - keys[9], keys[9], 0));
tft.drawRect(130, 229, 20, 3, tft.color565(255 - keys[10], keys[10], 0));
tft.drawRect(170, 229, 20, 3, tft.color565(255 - keys[11], keys[11], 0));
tft.drawRect(210, 229, 20, 3, tft.color565(255 - keys[0], keys[0], 0));
tft.drawRect(250, 229, 20, 3, tft.color565(255 - keys[1], keys[1], 0));
tft.drawRect(290, 229, 20, 3, tft.color565(255 - keys[2], keys[2], 0));
tft.drawRect(330, 229, 20, 3, tft.color565(255 - keys[3], keys[3], 0));
tft.drawRect(370, 229, 20, 3, tft.color565(255 - keys[4], keys[4], 0));
tft.drawRect(410, 229, 20, 3, tft.color565(255 - keys[5], keys[5], 0));
tft.drawRect(450, 229, 20, 3, tft.color565(255 - keys[6], keys[6], 0));
// B
tft.drawRect(10, 209, 20, 3, tft.color565(255 - keys[11], keys[11], 0));
tft.drawRect(50, 209, 20, 3, tft.color565(255 - keys[0], keys[0], 0));
tft.drawRect(90, 209, 20, 3, tft.color565(255 - keys[1], keys[1], 0));
tft.drawRect(130, 209, 20, 3, tft.color565(255 - keys[2], keys[2], 0));
tft.drawRect(170, 209, 20, 3, tft.color565(255 - keys[3], keys[3], 0));
tft.drawRect(210, 209, 20, 3, tft.color565(255 - keys[4], keys[4], 0));
tft.drawRect(250, 209, 20, 3, tft.color565(255 - keys[5], keys[5], 0));
tft.drawRect(290, 209, 20, 3, tft.color565(255 - keys[6], keys[6], 0));
tft.drawRect(330, 209, 20, 3, tft.color565(255 - keys[7], keys[7], 0));
tft.drawRect(370, 209, 20, 3, tft.color565(255 - keys[8], keys[8], 0));
tft.drawRect(410, 209, 20, 3, tft.color565(255 - keys[9], keys[9], 0));
tft.drawRect(450, 209, 20, 3, tft.color565(255 - keys[10], keys[10], 0));
// E
tft.drawRect(10, 189, 20, 3, tft.color565(255 - keys[4], keys[4], 0));
tft.drawRect(50, 189, 20, 3, tft.color565(255 - keys[5], keys[5], 0));
tft.drawRect(90, 189, 20, 3, tft.color565(255 - keys[6], keys[6], 0));
tft.drawRect(130, 189, 20, 3, tft.color565(255 - keys[7], keys[7], 0));
tft.drawRect(170, 189, 20, 3, tft.color565(255 - keys[8], keys[8], 0));
tft.drawRect(210, 189, 20, 3, tft.color565(255 - keys[9], keys[9], 0));
tft.drawRect(250, 189, 20, 3, tft.color565(255 - keys[10], keys[10], 0));
tft.drawRect(290, 189, 20, 3, tft.color565(255 - keys[11], keys[11], 0));
tft.drawRect(330, 189, 20, 3, tft.color565(255 - keys[0], keys[0], 0));
tft.drawRect(370, 189, 20, 3, tft.color565(255 - keys[1], keys[1], 0));
tft.drawRect(410, 189, 20, 3, tft.color565(255 - keys[2], keys[2], 0));
tft.drawRect(450, 189, 20, 3, tft.color565(255 - keys[3], keys[3], 0));
// keys
tft.drawRect(10, 60, 50, 100, tft.color565(255 - keys[0], keys[0], 0)); // C
tft.drawRect(78, 60, 50, 100, tft.color565(255 - keys[2], keys[2], 0)); // D
tft.drawRect(146, 60, 50, 100, tft.color565(255 - keys[4], keys[4], 0)); // E
tft.drawRect(214, 60, 50, 100, tft.color565(255 - keys[5], keys[5], 0)); // F
tft.drawRect(282, 60, 50, 100, tft.color565(255 - keys[7], keys[7], 0)); // G
tft.drawRect(350, 60, 50, 100, tft.color565(255 - keys[9], keys[9], 0)); // A
tft.drawRect(418, 60, 50, 100, tft.color565(255 - keys[11], keys[11], 0));//B
tft.drawRect(49, 10, 40, 100, tft.color565(255 - keys[1], keys[1], 0)); //C#
tft.drawRect(117, 10, 40, 100, tft.color565(255 - keys[3], keys[3], 0)); //Eb
tft.drawRect(253, 10, 40, 100, tft.color565(255 - keys[6], keys[6], 0)); //F#
tft.drawRect(321, 10, 40, 100, tft.color565(255 - keys[8], keys[8], 0)); //Ab
tft.drawRect(389, 10, 40, 100, tft.color565(255 - keys[10], keys[10], 0));//Bb
/*
tft.setTextColor(YELLOW, BLACK);
tft.setCursor(0, 25);
tft.setTextSize(8);
tft.println(vNote);
*/
}