My second milestone for the MIDI Controller was to convert my serial messages from the code in the Arduino IDE into intelligible MIDI signals and have both my digital and analog inputs play sounds on FL Studio 20 when pressed or twisted.
First, I had to download MIDI code from recent MIDI Controller projects — with the help of my instructor — that would read the Arduino’s digital and analog inputs. The digital input is the button interface and the analog input is the potentiometer. After modifying this code and testing it on the Arduino IDE’s Serial Monitor, I then proceeded to download the Hairless MIDI software to see if the code was legitimately sending readable MIDI messages and, in the end, it was! The Hairless MIDI was able to detect when the button press turned on and off as well as when the potentiometer knob twisted clockwise and counterclockwise. After this, I connected the Hairless MIDI program to FL Studio 20 which ultimately linked the Arduino itself to FL Studio 20 where I could play myriads of musical instruments and sounds.
Finally, I had to gain fundamental knowledge of the components of FL Studio 20 in order to play some sounds. On the left sidebar of any project file on FL Studio 20, there is a module titled “Plugin Presets.” Inside of this, there is another tab named “Generators” where there are hundreds of different sounds where I could test if my button press was functioning. Once I right-clicked on a sound of my choice, I “opened a new channel” and pressed the button on the Breadboard which then played the specific sound on my Macbook! To test if my potentiometer worked, I still was under the “Generators” tab, but I clicked on the default channel of “MiniSynth.” In this channel, there were already potentiometers shown on my computer. To connect it to my physical potentiometer, I just right-clicked on a specific potentiometer and linked it to my controller . . . and it worked! With the potentiometer, I could adjust the pitch, sound, speed, reverb, and filters of any sound that was played through FL Studio 20!
My first milestone for the MIDI Controller was to have my circuits for the button press and potentiometer work with the Arduino. To complete these tasks, I had to learn how the breadboard functioned with the Arduino. I was overwhelmed by these devices at first, but when I figured out how the breadboard was set up, I was able to wire up the circuits for the button interface and potentiometer much more efficiently. After this, I uploaded the code from the Arduino IDE to see from both the Serial monitor as well as the Arduino itself that the button press and potentiometer were registering.
How to customize the modules
All the customization is done in the config.js file within the MagicMirror folder. However, if I wanted to use a third party module, I would have to clone the repository into the MagicMirror/modules folder first. In the config.js file, I can choose where to display the module (top_left, center, bottom_bar, etc), the header, and the configurations specific to the individual modules. The configurations can be found at the GitHub repository.
Most modules use an Application Programming Interface. An API is set of protocols and routines to build software applications. For example, I use Twitter’s API. There are two types: Rest API (Data Base) and Search API (Connects to my account). In order to use an API, I needed an API key. API keys are used to track and control how to the API is being used i.e to prevent malicious use of the API. It also acts as unique identifier and as a secret token for authentication.
Every single module on my MagicMirror uses an API because I wanted a customized interface that suited my personal needs.