Cree sus propios MIDI generados por las representaciones visuales en tiempo real 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.  

Como músico de realizar, incorporando elementos visuales proyectados dentro de sus actuaciones es una manera segura de mejorar la experiencia de su público. Hay muchas aplicaciones Jockey vídeo y Projection Mapping software diseñados para hacer esto, como Resolume Arena o ArKaos GrandVJ, que permiten a los artistas para activar y video control, gráficos y animaciones en tiempo real, así como la sincronización con la música. La mayoría de estas aplicaciones se pueden manejar mediante MIDI, que les hace extremadamente útil para los músicos que ya utilizan MIDI dentro de sus espectáculos. Sin embargo, la integración MIDI es a menudo bastante limitado y no permite controlar las imágenes exactamente cómo desea. Una forma de evitar esto sería crear su propia aplicación de software a medida

En este tutorial,

Resolume Arena 4 projection mapping software 

Resolume Arena software de mapas 4 proyección.

La plataforma que utilizaremos aquí se llama openFrameworks (a menudo abreviado DE)

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

Visuales en directo en Roskilde Festival 2014, Dinamarca, por Johan Bichel Lindegaard, en parte, hacen usando openFrameworks.

Antes de empezar, aquí es un ejemplo sencillo de lo que vamos a hacer

Que necesitarás:

Step 1—Installing your IDE

Primero tendrá que instalar el IDE. Instalación de Xcode en OS X es fácil

Step 2—Installing openFrameworks and ofxMidi

Para instalar de, simplemente mueva el descargada de carpeta en cualquier lugar en el equipo. Para instalar ofxMidi, mover la carpeta ofxMidi descargado en el directorio addons dentro de su carpeta.

Step 3—Setting up the oF Project

A continuación, tendrá que establecer un proyecto para su IDE para que pueda desarrollar su aplicación de. Para hacer esto usted tendrá uso de

  1. Set
  2. Cerciorarse
  3. Cerciorarse
  4. Haga clic en
  5. Haga clic en

openFrameworks Project Generator application

aplicación openFrameworks Generador Proyecto.

Ahora debe haber una nueva carpeta en el directorio / apps / openFrameworks MyApps para su proyecto de nueva creación.

Step 4—Adding the Code

A continuación, tiene que abrir su proyecto de nueva creación y añadir algo de código a la misma:

  1. Abra su aplicación IDE (Xcode o Code :: Blocks).
  2. Ir
  3. Seleccione el archivo de proyecto (el archivo .xcodeproj para Xcode o .workspace de Code :: Blocks) y haga clic en
  4. En el IDE navegar a la izquierda la columna / panel donde debería haber un icono junto a su nombre de proyectos. Haga clic en el triángulo o

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

El Xcode (imagen izquierda) y Code :: Blocks (imagen derecha) navegador de proyecto donde se encuentran los archivos de código fuente.

  1. Descargue el código para este proyecto desde aquí.
  2. Reemplace el contenido de ofApp.cpp y ofApp.h dentro de su IDE con el contenido de los archivos recién descargados. Para abrir estos archivos en Xcode simplemente solo clic sobre ellos desde la vista en árbol, sin embargo, en Code :: Blocks usted necesita hacer doble clic en ellos.

La enseñanza de cómo el código para este proyecto que funciona es un poco más allá del alcance de este artículo, así que

Step 5—Building and Running the Code

Usted está casi listo para probar la aplicación visualizador MIDI, sin embargo antes de que usted necesita para construir el código en una pieza de software. Para ello siga los siguientes pasos:

En Xcode en OS X:

  1. En la barra de herramientas superior del lado izquierdo al lado de la jugada y dejar de iconos hay un menú desplegable
  2. Desde la barra de menú seleccione
  3. Desde la barra de menú seleccione
  4. La aplicación visualizador ahora debería haber aparecido, y un archivo de aplicación debería haber sido creado en el

The Xcode IDE running the MIDI visualiser application

El Xcode IDE ejecuta la aplicación visualizador MIDI.

En Código :: Blocks en Windows:

  1. Desde la barra de menú seleccione
  2. Desde la barra de menú seleccione
  3. La aplicación visualizador ahora debería haber aparecido (con una segunda aplicación de utilidad que aparece detrás de él), y un archivo de aplicación debería haber sido creado en el

The Code::Blocks IDE running the MIDI visualiser application

El IDE Code :: Blocks ejecutar la aplicación visualizador MIDI

Felicidades

Step 6—Using the application

El uso de la aplicación visualizador MIDI es fácil. A medida que el estado de instrucciones, sólo tiene que seleccionar la entrada MIDI que desea utilizar con los números en el teclado del ordenador, pulsando

The MIDI visualiser application

La aplicación visualizador MIDI

Descargar el código fuente de este proyecto AQUÍ

Conclusion

Así que eso

 

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!