Créez vos visuels propres MIDI généré en temps réel avec 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.  

En tant que musicien performant, intégrant visuels projetés au sein de vos performances est un moyen infaillible d'améliorer l'expérience pour votre auditoire. Il existe de nombreuses applications Video Jockey et Projection Mapping logiciels conçus pour ce faire, comme Resolume Arena ou ArKaos GrandVJ, qui permettent aux artistes de commande et de déclenchement vidéo, graphiques et animations en temps réel, ainsi que les synchroniser de la musique. La plupart de ces applications peuvent être contrôlés par MIDI, ce qui les rend extrêmement utile pour les musiciens qui utilisent déjà MIDI dans leurs spectacles. Cependant, l'intégration de MIDI est souvent très limitée et peut ne pas vous permettre de contrôler les visuels exactement comment vous voulez. Une façon de contourner ce serait de créer votre propre application de logiciels personnalisés

Dans ce tutoriel, je

Resolume Arena 4 projection mapping software 

Resolume Arena 4 projection logiciel de cartographie.

La plate-forme que nous allons utiliser ici est appelé openFrameworks (souvent abrégé à oF)

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

Visuals live au Festival de Roskilde 2014, Danemark, par Johan Bichel Lindegaard, partiellement fabriqués en utilisant openFrameworks.

Avant de commencer, voici un exemple simple de ce que nous allons faire

Qu'est-ce que vous aurez besoin:

  • La boîte à outils openFrameworks
  • Un IDE (environnement de développement intégré)
  • ofxMidi
  • Un contrôleur MIDI ou des applications
  • Télécharger le code source pour ce projet ICI.

Step 1—Installing your IDE

D'abord, vous aurez besoin d'installer votre IDE. Installation Xcode sur OS X est facile

Step 2—Installing openFrameworks and ofxMidi

Pour installer oF, déplacez simplement le téléchargée de dossier dans un autre emplacement sur votre ordinateur. Pour installer ofxMidi, déplacer le dossier ofxMidi téléchargé dans le répertoire addons au sein de votre dossier oF.

Step 3—Setting up the oF Project

Ensuite, vous aurez besoin de mettre en place un projet pour votre IDE de sorte que vous pouvez développer votre application de oF. Pour cela, vous allez utiliser de Do

  1. Ensemble
  2. Assure-toi
  3. Assure-toi
  4. Cliquer sur
  5. Cliquez

openFrameworks Project Generator application

l'application Générateur openFrameworks projet.

Il devrait maintenant y avoir un nouveau dossier dans le répertoire / apps / OpenFrameworks myapps pour votre projet nouvellement créé.

Step 4—Adding the Code

Ensuite, vous devez ouvrir votre projet nouvellement créé et ajouter du code à elle:

  1. Ouvrez votre application IDE (Xcode ou Code :: Blocks).
  2. Aller à
  3. Sélectionnez le fichier de projet (le fichier de .xcodeproj pour Xcode ou .workspace pour Code :: Blocks) et cliquez sur
  4. Dans l'IDE accédez à la colonne de gauche / volet où il devrait y avoir une icône à côté de votre nom de projets. Cliquez sur le triangle ou

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

Le Xcode (image de gauche) et Code :: Blocks (première image de droite) __gVirt_NP_NN_NNPS<__ navigateur de projet où vous trouverez les fichiers de code source.

  1. Télécharger le code pour ce projet à partir d'ici.
  2. Remplacez le contenu de ofApp.cpp et ofApp.h votre IDE avec le contenu des fichiers récemment téléchargés. Pour ouvrir ces fichiers dans Xcode tout seul clic sur eux de l'arborescence, mais dans Code :: Blocks vous devez double-cliquer sur eux.

Vous enseigner comment le code pour les travaux de ce projet est un peu au-delà de la portée de cet article, donc je

Step 5—Building and Running the Code

Vous êtes presque prêt à essayer l'application de visualiseur MIDI, mais avant que vous avez besoin pour construire le code dans un morceau de logiciel. Pour ce faire, procédez comme suit:

Dans Xcode sur OS X:

  1. Sur la barre d'outils sur le côté gauche à côté du jeu et arrêter icônes il ya un menu déroulant
  2. Dans la barre de menu, sélectionnez
  3. Dans la barre de menu, sélectionnez
  4. L'application de visualiseur devrait maintenant sont apparus, et un dossier de candidature doit avoir été créé dans le

The Xcode IDE running the MIDI visualiser application

L'IDE Xcode exécutant l'application de visualiseur MIDI.

Dans Code :: Blocks sous Windows:

  1. Dans la barre de menu, sélectionnez
  2. Dans la barre de menu, sélectionnez
  3. L'application de visualiseur devrait maintenant sont apparus (avec une seconde application utilitaire apparaissant derrière elle), et un dossier de candidature doit avoir été créé dans le

The Code::Blocks IDE running the MIDI visualiser application

L'IDE Code :: Blocks exécutant l'application de visualiseur MIDI

Félicitations à vous

Step 6—Using the application

Utilisation de l'application MIDI de visualiseur est facile. Comme l'indiquent les instructions, il suffit de sélectionner l'entrée MIDI que vous souhaitez utiliser avec les numéros sur votre clavier d'ordinateur, en appuyant

The MIDI visualiser application

L'application de visualiseur MIDI

Télécharger le code source pour ce projet ICI

Conclusion

De sorte que

 

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!