درست-MIDI تولید خود را بیدرنگ تصاویری با 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.  

به عنوان یک نوازنده، ترکیب تصاویری بینی در اجرای خود را راه مطمئن شوید که آتش برای ارتقاء تجربه برای مخاطبان خود را است. بسیاری از برنامه های کاربردی سوارکار اسب دوانی شدن ویدئو و نقشه برداری نرم افزار طراحی برای انجام این کار، مانند وجود دارد Resolume آرنا یا ArKaos GrandVJ، که اجازه می دهد هنرمندان را به دنبال و کنترل ویدئو، گرافیک و انیمیشن در زمان واقعی، و همچنین همگام سازی آنها را به موسیقی. بسیاری از این برنامه های کاربردی می توان با استفاده MIDI کنترل، ساخت آنها را بسیار به نوازندگان که در حال حاضر MIDI استفاده در خود نشان می دهد مفید است. با این حال، ادغام MIDI است که اغلب کاملا محدود است و ممکن است به شما اجازه تصاویری دقیقا چه می خواهید کنترل کنید. یک راه حل این خواهد بود برای ایجاد خود نرم افزار نرم افزار های سفارشی خود را

در این آموزش، من

Resolume Arena 4 projection mapping software 

Resolume آرنا 4 طرح ریزی نرم افزار نقشه برداری.

پلت فرم ما با استفاده از نامیده شده است. openFrameworks (اغلب به صورت مختصر از)

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

تصاویری زنده در جشنواره Roskilde 2014، دانمارک، توسط Johan Bichel Lindegaard، تا حدودی ساخته شده با استفاده openFrameworks.

قبل از شروع، در اینجا یک مثال ساده از آنچه که ما ساخت است

چه شما نیاز دارید:

Step 1—Installing your IDE

در ابتدا شما نیاز به نصب IDE خود را. نصب Xcode متعلق به در OS X آسان است

Step 2—Installing openFrameworks and ofxMidi

برای نصب از، به سادگی حرکت های دانلود شده از پوشه را به هر مکان بر روی کامپیوتر شما. برای نصب ofxMidi، در پوشه خود را حرکت پوشه ofxMidi دانلود را به دایرکتوری افزونه.

Step 3—Setting up the oF Project

بعدی شما نیاز به راه اندازی یک پروژه برای IDE خود را به طوری که شما می توانید استفاده از خود را توسعه. برای این کار شما را استفاده انجام

  1. تنظیم
  2. مطمئن شو
  3. مطمئن شو
  4. با کلیک بر روی
  5. کلیک

openFrameworks Project Generator application

نرم افزار openFrameworks ژنراتور پروژه.

وجود دارد در حال حاضر باید یک پوشه جدید در دایرکتوری openFrameworks / برنامه ها / myApps برای پروژه به تازگی ایجاد شده شما باشد.

Step 4—Adding the Code

بعد شما نیاز به باز کردن پروژه به تازگی ایجاد شده و اضافه کردن برخی از کد به آن:

  1. باز کردن نرم افزار IDE خود را (Xcode متعلق و یا کد :: بلوک)
  2. برو به
  3. فایل پروژه (فایل .xcodeproj برای Xcode متعلق به یا .workspace کد :: بلوک) انتخاب کنید و کلیک کنید
  4. در IDE حرکت به سمت چپ ستون / پنجره که در آن باید یک آیکون وجود دارد در کنار پروژه های خود را به نام. بر روی مثلث کلیک کنید و یا

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

Xcode متعلق به (تصویر سمت چپ) و کد :: بلوک (تصویر سمت راست) هدایتگر پروژه که در آن شما را به فایل های کد منبع پیدا کنید.

  1. دانلود کد برای این پروژه از اینجا.
  2. جایگزین محتویات ofApp.cpp و ofApp.h در IDE خود را با محتویات فایل های به تازگی دریافت کنید. برای باز کردن این فایل ها در Xcode متعلق به فقط یک کلیک بر روی آنها را از درخت، مشاهده، با این حال در کد :: بلوک شما نیاز به دوبار کلیک بر روی آنها.

آموزش به شما چگونه کد برای این پروژه کار می کند کمی فراتر از محدوده این مقاله است، بنابراین من

Step 5—Building and Running the Code

شما تقریبا آماده سعی کنید از برنامه رقص نور MIDI، با این حال قبل از آن شما نیاز به ساخت کد به یک قطعه از نرم افزار است. برای انجام این کار مراحل زیر را:

در Xcode متعلق به در OS X:

  1. در نوار ابزار بالا در سمت چپ در کنار بازی و متوقف کردن آیکون است یک منوی کرکره وجود دارد
  2. از نوار منو را انتخاب کنید
  3. از نوار منو را انتخاب کنید
  4. نرم افزار رقص نور باید در حال حاضر به نظر می رسد، و یک فایل نرم افزار باید در ایجاد شده است

The Xcode IDE running the MIDI visualiser application

Xcode متعلق به IDE حال اجرا نرم افزار رقص نور MIDI.

در کد :: بلوک در ویندوز:

  1. از نوار منو را انتخاب کنید
  2. از نوار منو را انتخاب کنید
  3. نرم افزار رقص نور باید در حال حاضر به نظر می رسد (با یک برنامه نرم افزاری دوم ظاهر می شود در پشت آن)، و یک فایل نرم افزار باید در ایجاد شده است

The Code::Blocks IDE running the MIDI visualiser application

کد :: بلوک IDE حال اجرا نرم افزار رقص نور MIDI

تبریک

Step 6—Using the application

استفاده از نرم افزار رقص نور MIDI آسان است. از آنجا که دولت دستورالعمل، به سادگی انتخاب ورودی MIDI می خواهید استفاده کنید با شماره های روی صفحه کلید کامپیوتر خود را، با فشار دادن

The MIDI visualiser application

نرم افزار رقص نور MIDI

دانلود کد منبع برای این پروژه در اینجا

Conclusion

به طوری که

 

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!