Crea il tuo Visuals MIDI in tempo reale generati con openFrameworks

Do you want to create a simple desktop app that generates realtime animations using MIDI data? Then you're in the right place and Liam Lacey is here to show how using openFrameworks.  

Come musicista, incorporando elementi visivi proiettati all'interno delle vostre performance è un modo infallibile per migliorare l'esperienza per il pubblico. Ci sono molte applicazioni Video Jockey e Projection Mapping software progettate per fare questo, come Resolume Arena o ArKaos GrandVJ, che permette agli artisti di attivare il controllo e il video, la grafica e le animazioni in tempo reale, così come li sincronizzare la musica. La maggior parte di queste applicazioni possono essere gestite tramite MIDI, che li rende estremamente utile per i musicisti che già utilizzano MIDI nei loro spettacoli. Tuttavia, l'integrazione MIDI è spesso molto limitato e non potrebbe consentire di controllare esattamente come si desidera che le immagini. Un modo per aggirare questo sarebbe quello di creare la propria applicazione software personalizzato

In questo tutorial,

Resolume Arena 4 projection mapping software 

Resolume Arena software di mappatura 4 proiezione.

La piattaforma useremo qui si chiama openFrameworks (spesso abbreviato in oF)

Live Visuals at Roskilde Festival 2014, Denmark, by Johan Bichel Lindegaard, partly made using openFrameworks

Live Visuals a Roskilde Festival 2014, la Danimarca, da Johan Bichel Lindegaard, in parte realizzati con openFrameworks.

Prima di iniziare, qui è un semplice esempio di quello che ci sarà fare

Che cosa hai bisogno:

Step 1—Installing your IDE

In primo luogo è necessario installare il vostro IDE. Installazione di Xcode su OS X è facile

Step 2—Installing openFrameworks and ofxMidi

Per installare oF, è sufficiente spostare la scaricata di cartella in qualsiasi posizione sul computer. Per installare ofxMidi, spostare la cartella ofxMidi scaricato nella directory addons all'interno della cartella oF.

Step 3—Setting up the oF Project

Successivamente sarà necessario impostare un progetto per il vostro IDE in modo da poter sviluppare l'applicazione oF. Per fare questo si utilizzerà oF

  1. Impostato
  2. Assicurarsi
  3. Assicurarsi
  4. Clicca su
  5. Fare clic

openFrameworks Project Generator application

applicazione openFrameworks Generator Project.

Adesso è presente una nuova cartella nella directory openFrameworks / apps / MyApps per il progetto appena creato.

Step 4—Adding the Code

Dopodiché è necessario aprire il progetto appena creato e aggiungere del codice a esso:

  1. Aprite l'applicazione IDE (Xcode o Code :: Blocks).
  2. Andare a
  3. Selezionare il file di progetto (file .xcodeproj per Xcode o .workspace per Code :: Blocks) e fare clic su
  4. Nell'IDE passare alla sinistra della colonna / riquadro dove ci dovrebbe essere una icona accanto al tuo nome progetti. Fare clic sul triangolo o

The Xcode (left image) and Code::Blocks (right image) project navigator where you will find the source code files

L'Xcode (immagine a sinistra) e Code :: Blocks (immagine a destra), navigazione di progetto in cui si trovano i file di codice sorgente.

  1. Scarica il codice per questo progetto da qui.
  2. Sostituire il contenuto della ofApp.cpp e ofApp.h all'interno del vostro IDE con il contenuto dei file appena scaricati. Per aprire questi file in Xcode solo semplice clic su di loro dalla vista ad albero, ma in Code :: Blocks è necessario fare doppio-clic su di essi.

Vi insegna come funziona il codice per questo progetto è un po 'oltre la portata di questo articolo, in modo da

Step 5—Building and Running the Code

Siete quasi pronti per provare l'applicazione visualizzatore MIDI, comunque prima che è necessario per costruire il codice in un pezzo di software. Per fare questo effettuare le seguenti operazioni:

In Xcode su OS X:

  1. Nella barra degli strumenti in alto a sinistra accanto al gioco e fermare le icone vi è un menu a discesa
  2. Dalla barra dei menu selezionare
  3. Dalla barra dei menu selezionare
  4. L'applicazione visualizzatore dovrebbe ora sono apparsi, e un file di applicazione dovrebbe essere stato creato nel

The Xcode IDE running the MIDI visualiser application

L'IDE Xcode che esegue l'applicazione visualizzatore MIDI.

In Code :: Blocks in Windows:

  1. Dalla barra dei menu selezionare
  2. Dalla barra dei menu selezionare
  3. L'applicazione visualizzatore dovrebbe ora essere apparso (con una seconda applicazione utility che appare alle spalle), e un file di applicazione dovrebbe essere stato creato nel

The Code::Blocks IDE running the MIDI visualiser application

Il Code :: Blocks IDE che esegue l'applicazione visualizzatore MIDI

Complimenti

Step 6—Using the application

Utilizzando l'applicazione visualizzatore MIDI è facile. Come lo stato istruzioni, è sufficiente selezionare l'ingresso MIDI che si desidera utilizzare con i numeri sulla tastiera del computer, premendo

The MIDI visualiser application

L'applicazione visualiser MIDI

Scarica il codice sorgente per questo progetto QUI

Conclusion

Affinché

 

Liam is the Head Of Development specialising in software development at Modal Electronics, the company behind the 002, 008, CRAFT and SKULPT synthesisers, and was previously the lead software developer at nu desine, the developers of the AlphaSphere MIDI controllers. He was also an Associate Lecturer at UWE, Bristol, UK where he gradua... Read More

Discussion

cuticulamusic
can you specify for which OS X this should work, cause I guess in 10.9 it is not working. I get tons of debugging errors like "gluBuild2DMipmaps is deprecated" use xxx instead. ???
Liam Lacey
Hey cuticulamusic,
These messages are actually just openFrameworks build warnings that can be ignored in this case, so it should still be possible to build and run the application. Is this true for you, or are they coming up as red errors that prevent you from building? With the latest version of oF (0.8.4) this project should work on OS X 10.6 and above.
cuticulamusic
Hi, I found out that I didn't " On the top toolbar on the left-hand side next to the play and stop icons there is a dropdown menu—select the ‘[project name] Debug’ option." set it right. But after doing that I got like 18 real errors. all of them "Apple Match-O Linker (id) Error". Do you have any idea what that could be? and thanks for your help already and putting up this tutorial (even tough its not working for me, haha).
Liam Lacey
Can you give examples of the exact "Apple Match-O Linker (id) Error" errors?
Xac
Tried this on OS X 10.11.1 Xcode says build failed.
Liam Lacey
Hey XacWj,
I haven't been able to test this on OS X 10.11 yet. What errors are you getting?
Bonzo
I'm so confused. You linked to a version of Code Blocks, yet the installation guide for Windows you linked to recommends another completely different version. They're nowhere near the same size and the version numbers are completely different. It asks that i 'install' it, but all i find is an install.md file which i can't open.
Bonzo
Thanks for deleting my comment, i figured out where i went wrong anyway. It would have helped if you had explained that oF and code::blocks are two separate programs.
Bonzo
So now i've done all the steps but at the end i just get the grey screen and an empty command prompt box with no instructions. The build had no errors. Any advice?
Liam Lacey
Hey Bonzo,

Code::Blocks is the piece of software used for developing software applications, whereas oF is just a library of files used to make software development a lot easier. Sorry if that wasn't clear in the tutorial.

Since releasing this tutorial there has been a newer release of oF (0.9.0), and unfortunately they no longer suggest Code::Blocks to be the best IDE to use on Windows. Also I have not yet tested this tutorial using version 0.9.0 - just 0.8.4 (which can be downloaded from http://www.openframeworks.cc/download/older.html). Which version of oF did you try this tutorial with?
Stefan Hetzel
@Liam Lacey: Thanks for the great tutorial, it was (almost) no problem to install the app :-) (Win 7 64-bit, using oF 0.8.4)
Eric
This is exactly what I've been looking for. Thank you so much!!!
Alex
Please, what portions of midi_visualizer source code gets copied into CodeBlocks. Think I'm ok with ofx files (h and C++). Does MAMA file go as well. How??
Mapt
Hi, thanks for this article. With your help, I managed to create music videos for my musical project. Here is the first one if anyone is interested :
https://youtu.be/AAL9CR8_tJ8
VoyagesLuna
Hi, thank you so much for this awesome tutorial!! It actually worked for me! On macOS Catalina 10.15.5 may 2020. Only small detail at first the build failed, it said midi thing did not have a method getPortsList and asked me if I meant getInPortList instead... I changed it for getInPortList where the error was flagged and now it is working!!

Only thing that I still need to figure out though is how can I route the midi from my song in Ableton Live to the program? Right now I am able to chose between my drum pad, my midi synth or my audio interface as MIDI input and if I chose the drumpad or the midi synth it totally works and I can see the circles on the app!

Could you share how you got the midi from your Ableton coming out in the app? Thanks!
A
For those trying to run this code in VS on Windows
change line 158 from
vector midi_port_strings = midiIn.getPortList();
to
vector midi_port_strings = midiIn.getInPortList();
If it can't compile try to switch Solution Platform from Win32 to x64 (and optionally back)

Want to join the discussion?

Create an account or login to get started!