Skip to content

Commit

Permalink
Readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnpinciara committed Apr 2, 2024
1 parent 9dd2266 commit 92c5f2c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 19 deletions.
29 changes: 11 additions & 18 deletions Processing/MTK_MIDI/MTK_MIDI.pde
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,32 @@


/*
This example shows how to use "Multi-Touch Kit Processing library" in your code.
This example contains the most important options of the library and tries to explain what they do.
It is recommended that you also read the comments in the sourcecode/the documentation.
Please insert the correct Serial Port and number of RX and TX based on the size of the sensor
Implementation of a capacitive multi-touch MIDI surface instrument as a final bachelor essay by Shawn Pinciara. Suing the "Multi-Touch Kit Processing library".
*/


import gab.opencv.*;
import MultiTouchKitUI.*;
import processing.serial.*;
import blobDetection.*;
import themidibus.*; //Import the library
import themidibus.*;


Table table;
//Options:

//Here you will have to set the tx/rx numbers, as well as the serial port
int tx = 8; //number of transmitter lines (rx)
int tx = 8; //number of transmitter lines (tx)
int rx = 5; //number of receiver lines (rx)
//int tx = 4; //number of transmitter lines (rx)
//int rx = 4; //number of receiver lines (rx)
int serialPort = 1; //serial port that the Arduino is connected to
int serialPort = 1; //index of the serial port that the Arduino is connected to
int maxInputRange = 170; // set the brightness of touch points
float threshold = 0.8f; // set the threshold for blob detection
int gridSize = 80; // use this to scale the size of the output picture (with small sensors you might want to increase the number, with big sensors maybe you want to decrease it)


Table table;
boolean debounceB0press = true;
boolean debounceB0release = false;
int recordingIndex = 0;

Serial myPort;
MultiTouchKit mtk;
MidiBus midiBus;
Expand All @@ -49,10 +46,6 @@ BlobMidi midiBlob2;
BlobMidi midiBlob3;
BlobMidi midiBlob4;

int maxInputRange = 170; // set the brightness of touch points
float threshold = 0.8f; // set the threshold for blob detection
int gridSize = 80; // use this to scale the size of the output picture (with small sensors you might want to increase the number, with big sensors maybe you want to decrease it)

class BlobMidi {
private int id;
private Blob blob;
Expand Down
1 change: 1 addition & 0 deletions Processing/Processing MIDI Lib test/sketch.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main=ProcessingMIDI.pde
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,36 @@ A DIY capacitive multi-touch midi instrument, protoyped as a bachelor final essa
![The multi-touch surface](/Src/arduino_mega_surface.jpg)

# Tutorial:
Coming very soon
## How to:

**A detailed tutorial on making a surface with Arduino UNO can be found [here](https://github.com/HCI-Lab-Saarland/MultiTouchKitDoc/blob/master/MTK_Tutorial.pdf).**

The other pieces of software to be installed are:

- Processing MIDI library ([themidibus](https://github.com/sparks/themidibus))
- MIDI virtual ports ([LoopMIDI](https://www.tobias-erichsen.de/software/loopmidi.html))

Instead of using the Processing file cited in the tutorial, the file *Processing/MTK_MIDI/MTK_MIDI.pde* should be used instead.

## Structure:

The BlobMidi class handles the convertion from Blobs object (of the MultiTouchKit library) to MIDI events.

It is instantiated at setup() and his update() function called during the loop(), when the blob object (corresponding to the fingers’ touch) becomes non-null.

The update() function handles the blob in the 3 states:

- At push
- Usually sends a NoteOn
- At hold
- Usually sends a CC
- At release
- Usually sends a NoteOff

All the states are debounced.

To offer more customization for different use cases these capabilities are offered:

- Discrete Map functions: to convert X,Y of the blobs not array indexes of MIDI notes (mapToInt() )
- Modes: the variable *mode* let the user program different MIDI convertions to handle the different use cases and mapping (standard modes are 0 = drum , 1 = piano , 3 = pentatonic scale)
- Log: all data can be recorded on tables and saved as CSV on mouse click or finger release

0 comments on commit 92c5f2c

Please sign in to comment.