Creating a Virtual Instrument with Qt
-
I want to create something I'd like to call the "Way-Cool Advanced Sample Engine", an interactive player that will load all the virtual instruments I'm in the process of making. Most important of all, this player has buttons, sliders, knobs and dials that can be assigned to MIDI Continuous Controllers and values. And better yet, it will be fully accessible to screenreaders! Now that brings up my question. How do I create the widgets to make this new sample engine? I want to pattern it after the Play Advanced Sample Engine from http://www.soundsonline.com, however, the difference between Play and this engine is that, not only will it be accessible just for those who are sighted. I want to make my player accessible to anyone and everyone! Whether you are sighted, blind or visually impaired, deaf or hearing-impaired, or even have learning difficulties, this virtual instrument is designed for musicians from all walks of life! In addition to graphical controls, I want to make controls that have text-based icons and values. Also, I want to make my player work with all platforms, as well as have both 32 bit and 64 bit capability. I'd like to make it standalone as well as a plugin version that will work in any digital audio workstation.
-
I want to create something I'd like to call the "Way-Cool Advanced Sample Engine", an interactive player that will load all the virtual instruments I'm in the process of making. Most important of all, this player has buttons, sliders, knobs and dials that can be assigned to MIDI Continuous Controllers and values. And better yet, it will be fully accessible to screenreaders! Now that brings up my question. How do I create the widgets to make this new sample engine? I want to pattern it after the Play Advanced Sample Engine from http://www.soundsonline.com, however, the difference between Play and this engine is that, not only will it be accessible just for those who are sighted. I want to make my player accessible to anyone and everyone! Whether you are sighted, blind or visually impaired, deaf or hearing-impaired, or even have learning difficulties, this virtual instrument is designed for musicians from all walks of life! In addition to graphical controls, I want to make controls that have text-based icons and values. Also, I want to make my player work with all platforms, as well as have both 32 bit and 64 bit capability. I'd like to make it standalone as well as a plugin version that will work in any digital audio workstation.
Hi @Annabelle,
For accessibility features, start by reading through http://doc.qt.io/qt-5/accessible.html
For everything else, start by breaking your project into smaller chunks. Post questions about individual chunks in different forum posts. Make a simple proof-of-concept first and then add more features later.
-
Hi @Annabelle,
For accessibility features, start by reading through http://doc.qt.io/qt-5/accessible.html
For everything else, start by breaking your project into smaller chunks. Post questions about individual chunks in different forum posts. Make a simple proof-of-concept first and then add more features later.
@JKSH said in Creating a Virtual Instrument with Qt:
Hi @Annabelle,
For accessibility features, start by reading through http://doc.qt.io/qt-5/accessible.html
For everything else, start by breaking your project into smaller chunks. Post questions about individual chunks in different forum posts. Make a simple proof-of-concept first and then add more features later.
Proof of concept? I'm confused!
-
@JKSH said in Creating a Virtual Instrument with Qt:
Hi @Annabelle,
For accessibility features, start by reading through http://doc.qt.io/qt-5/accessible.html
For everything else, start by breaking your project into smaller chunks. Post questions about individual chunks in different forum posts. Make a simple proof-of-concept first and then add more features later.
Proof of concept? I'm confused!
@Annabelle Hi A. I'm presuming you visited http://doc.qt.io/qt-5/qtmultimedia-index.html
It may not be exactly what you want, I have a feeling you might be interested in the JUCE libs. I tried integrating it into Qt and got it working on a very basic level. https://juce.com/ But don't take my word for it, I'm a gnoblar. -
@Annabelle Hi A. I'm presuming you visited http://doc.qt.io/qt-5/qtmultimedia-index.html
It may not be exactly what you want, I have a feeling you might be interested in the JUCE libs. I tried integrating it into Qt and got it working on a very basic level. https://juce.com/ But don't take my word for it, I'm a gnoblar.@Ian-Bray said in Creating a Virtual Instrument with Qt:
@Annabelle Hi A. I'm presuming you visited http://doc.qt.io/qt-5/qtmultimedia-index.html
It may not be exactly what you want, I have a feeling you might be interested in the JUCE libs. I tried integrating it into Qt and got it working on a very basic level. https://juce.com/ But don't take my word for it, I'm a gnoblar.Gnoblar? Never heard that word before. Sounds like a type of fairy who makes magic.
-
@JKSH said in Creating a Virtual Instrument with Qt:
Hi @Annabelle,
For accessibility features, start by reading through http://doc.qt.io/qt-5/accessible.html
For everything else, start by breaking your project into smaller chunks. Post questions about individual chunks in different forum posts. Make a simple proof-of-concept first and then add more features later.
Proof of concept? I'm confused!
@Annabelle said in Creating a Virtual Instrument with Qt:
Proof of concept? I'm confused!
-
The player I want to make isn't web-based. It will be more like something one would install on their computer, along with any virtual instruments they would purchase from me.
@Annabelle
I'll say one thing from reading your first post: you're nothing if not grandly ambitious in your requirements specification! :) Best of luck. -
The player I want to make isn't web-based. It will be more like something one would install on their computer, along with any virtual instruments they would purchase from me.
@Annabelle
Hi
@JKSH links to a page / google search telling what proof of concept is.
It just mean a mini application with the base structure and very limited functionality to
get a feeling on how it should be structured and programmed. -
The player I want to make isn't web-based. It will be more like something one would install on their computer, along with any virtual instruments they would purchase from me.
@Annabelle
hi, a bit off topic, sry,but it's great that you're back. A new thread about a new project probably means you managed to get Qt running. Your other thread kind of ended.
Great that you managed it, despite the difficulties your disability brings in this field of work. Keep it up.
-
@Annabelle
hi, a bit off topic, sry,but it's great that you're back. A new thread about a new project probably means you managed to get Qt running. Your other thread kind of ended.
Great that you managed it, despite the difficulties your disability brings in this field of work. Keep it up.
@J.Hilk said in Creating a Virtual Instrument with Qt:
@Annabelle
hi, a bit off topic, sry,but it's great that you're back. A new thread about a new project probably means you managed to get Qt running. Your other thread kind of ended.
Great that you managed it, despite the difficulties your disability brings in this field of work. Keep it up.
Even I still don't know if I managed to get Qt running. I'm trying everything I can. My other thread didn't end, I just haven't replied since someone decided to put me down by saying that I want someone to "spoon-feed the answers" to me. I want you to know that I never implied anything of that sort. Whoever said that sounded very unprofessional.
-
@J.Hilk said in Creating a Virtual Instrument with Qt:
@Annabelle
hi, a bit off topic, sry,but it's great that you're back. A new thread about a new project probably means you managed to get Qt running. Your other thread kind of ended.
Great that you managed it, despite the difficulties your disability brings in this field of work. Keep it up.
Even I still don't know if I managed to get Qt running. I'm trying everything I can. My other thread didn't end, I just haven't replied since someone decided to put me down by saying that I want someone to "spoon-feed the answers" to me. I want you to know that I never implied anything of that sort. Whoever said that sounded very unprofessional.
@Annabelle said in Creating a Virtual Instrument with Qt:
Even I still don't know if I managed to get Qt running.
I recommend you try to build a small "Hello World" project. Does that work?
Back when I talked about a proof-of-concept, the main idea is to create small, simple things first. Once you've succeeded with those, you'll have the tools you need to create bigger and more interesting programs.
-
@J.Hilk said in Creating a Virtual Instrument with Qt:
@Annabelle
hi, a bit off topic, sry,but it's great that you're back. A new thread about a new project probably means you managed to get Qt running. Your other thread kind of ended.
Great that you managed it, despite the difficulties your disability brings in this field of work. Keep it up.
Even I still don't know if I managed to get Qt running. I'm trying everything I can. My other thread didn't end, I just haven't replied since someone decided to put me down by saying that I want someone to "spoon-feed the answers" to me. I want you to know that I never implied anything of that sort. Whoever said that sounded very unprofessional.
Ok, to build up on what @JKSH said, lets create a Small
HelloWorld
-Project together.First of, I asume you installed Qt on your PC and a compatible compiler, I'll asume mingw as this one actually come with the Qt installation.
For a basic Hello World example we'll need 4 files, all editable by Notepad.
A "pro" file, a "main.cpp", and a QWidget based class, that means one header and a complementary cpp file.The HelloWorld.pro
QT += core gui TARGET = HelloWorld TEMPLATE = app SOURCES += \ main.cpp \ widget.cpp HEADERS += \ widget.h
The main.cpp
#include "widget.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); return a.exec(); }
The widget.h
#ifndef WIDGET_H #define WIDGET_H #include <QWidget> class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent = nullptr); signals: public slots: }; #endif // WIDGET_H
The widget.cpp
#include "widget.h" #include <QLabel> #include <QHBoxLayout> Widget::Widget(QWidget *parent) : QWidget(parent) { QLabel *label = new QLabel(this); label->setText("Hello World"); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(label); }
Make sure that all 4 files are in the same folder, lets asume the folder name
HelloWorldFolder
with the pathc:\HelloWorldFolder
Your program is basically done, we'll now need to make a file out of it, that any PC can interpret. For that open your
Command Line Tool
.If it's your very fist time doing this, we should create a "shadow build folder" where the compiler and qmake will create any and all temporary files. We want to keep that separate from the folder that contains our *.h and *.cpp files
So create a shadowBuild folder with the following command
mkdir c:\HelloWorldBuildFolder
than enter that Shoadowbuild folder
cd c:\HelloWorldBuildFolder
Next we need to execute qmake. If you installed qt to the default path, the qmake path should be the following:
c:\Qt\5.9.3\mingw53_32\bin\qmake.exe
5.9.3 is the version name of your qt installation, this may vary.Assuming the previous path. enter the following line in your Command Line Tool:
c:\Qt\5.9.3\mingw53_32\bin\qmake.exe c:\HelloWorldFolder\HelloWorld.pro
The next step would be to run make.
Again asuming a standart Qt installation, make should have the following path:
c:\Qt\Tools\mingw530_32\bin\mingw32-make.exe
Assuming the previous path. enter the following line in your Command Line Tool:
c:\Qt\Tools\mingw530_32\bin\mingw32-make.exe --makefile=Makefile
If everything compiles without error, you should have successfully created a
HelloWorld.exe
that can be found within this pathc:\HelloWorldBuildFolder\release\HelloWorld.exe
As Qt is not statically build by default, that exe will not run out of the box. We'll have to copy the necessary dlls into the release folder. Thankfully qt comes with a tool that does that for us.
Again asuming a standart Qt installation, the tool windeployqt.exe should be found under this path:
C:\Qt\5.9.3\mingw53_32\bin\windeployqt.exe
That said, enter the following in your Command Line Tool
C:\Qt\5.9.3\mingw53_32\bin\windeployqt.exe c:\HelloWorldBuildFolder\release\HelloWorld.exe
After the tool is finished, you should be able run/execute
HelloWorld.exe
like any other exe on your pc.I hope this helps, and hopefully I made no mistakes in my "guide" x)
Greetings
-
Ok, to build up on what @JKSH said, lets create a Small
HelloWorld
-Project together.First of, I asume you installed Qt on your PC and a compatible compiler, I'll asume mingw as this one actually come with the Qt installation.
For a basic Hello World example we'll need 4 files, all editable by Notepad.
A "pro" file, a "main.cpp", and a QWidget based class, that means one header and a complementary cpp file.The HelloWorld.pro
QT += core gui TARGET = HelloWorld TEMPLATE = app SOURCES += \ main.cpp \ widget.cpp HEADERS += \ widget.h
The main.cpp
#include "widget.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); return a.exec(); }
The widget.h
#ifndef WIDGET_H #define WIDGET_H #include <QWidget> class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent = nullptr); signals: public slots: }; #endif // WIDGET_H
The widget.cpp
#include "widget.h" #include <QLabel> #include <QHBoxLayout> Widget::Widget(QWidget *parent) : QWidget(parent) { QLabel *label = new QLabel(this); label->setText("Hello World"); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(label); }
Make sure that all 4 files are in the same folder, lets asume the folder name
HelloWorldFolder
with the pathc:\HelloWorldFolder
Your program is basically done, we'll now need to make a file out of it, that any PC can interpret. For that open your
Command Line Tool
.If it's your very fist time doing this, we should create a "shadow build folder" where the compiler and qmake will create any and all temporary files. We want to keep that separate from the folder that contains our *.h and *.cpp files
So create a shadowBuild folder with the following command
mkdir c:\HelloWorldBuildFolder
than enter that Shoadowbuild folder
cd c:\HelloWorldBuildFolder
Next we need to execute qmake. If you installed qt to the default path, the qmake path should be the following:
c:\Qt\5.9.3\mingw53_32\bin\qmake.exe
5.9.3 is the version name of your qt installation, this may vary.Assuming the previous path. enter the following line in your Command Line Tool:
c:\Qt\5.9.3\mingw53_32\bin\qmake.exe c:\HelloWorldFolder\HelloWorld.pro
The next step would be to run make.
Again asuming a standart Qt installation, make should have the following path:
c:\Qt\Tools\mingw530_32\bin\mingw32-make.exe
Assuming the previous path. enter the following line in your Command Line Tool:
c:\Qt\Tools\mingw530_32\bin\mingw32-make.exe --makefile=Makefile
If everything compiles without error, you should have successfully created a
HelloWorld.exe
that can be found within this pathc:\HelloWorldBuildFolder\release\HelloWorld.exe
As Qt is not statically build by default, that exe will not run out of the box. We'll have to copy the necessary dlls into the release folder. Thankfully qt comes with a tool that does that for us.
Again asuming a standart Qt installation, the tool windeployqt.exe should be found under this path:
C:\Qt\5.9.3\mingw53_32\bin\windeployqt.exe
That said, enter the following in your Command Line Tool
C:\Qt\5.9.3\mingw53_32\bin\windeployqt.exe c:\HelloWorldBuildFolder\release\HelloWorld.exe
After the tool is finished, you should be able run/execute
HelloWorld.exe
like any other exe on your pc.I hope this helps, and hopefully I made no mistakes in my "guide" x)
Greetings
@J.Hilk said in Creating a Virtual Instrument with Qt:
Ok, to build up on what @JKSH said, lets create a Small
HelloWorld
-Project together.First of, I asume you installed Qt on your PC and a compatible compiler, I'll asume mingw as this one actually come with the Qt installation.
For a basic Hello World example we'll need 4 files, all editable by Notepad.
A "pro" file, a "main.cpp", and a QWidget based class, that means one header and a complementary cpp file.The HelloWorld.pro
QT += core gui TARGET = HelloWorld TEMPLATE = app SOURCES += \ main.cpp \ widget.cpp HEADERS += \ widget.h
The main.cpp
#include "widget.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); return a.exec(); }
The widget.h
#ifndef WIDGET_H #define WIDGET_H #include <QWidget> class Widget : public QWidget { Q_OBJECT public: explicit Widget(QWidget *parent = nullptr); signals: public slots: }; #endif // WIDGET_H
The widget.cpp
#include "widget.h" #include <QLabel> #include <QHBoxLayout> Widget::Widget(QWidget *parent) : QWidget(parent) { QLabel *label = new QLabel(this); label->setText("Hello World"); QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(label); }
Make sure that all 4 files are in the same folder, lets asume the folder name
HelloWorldFolder
with the pathc:\HelloWorldFolder
Your program is basically done, we'll now need to make a file out of it, that any PC can interpret. For that open your
Command Line Tool
.If it's your very fist time doing this, we should create a "shadow build folder" where the compiler and qmake will create any and all temporary files. We want to keep that separate from the folder that contains our *.h and *.cpp files
So create a shadowBuild folder with the following command
mkdir c:\HelloWorldBuildFolder
than enter that Shoadowbuild folder
cd c:\HelloWorldBuildFolder
Next we need to execute qmake. If you installed qt to the default path, the qmake path should be the following:
c:\Qt\5.9.3\mingw53_32\bin\qmake.exe
5.9.3 is the version name of your qt installation, this may vary.Assuming the previous path. enter the following line in your Command Line Tool:
c:\Qt\5.9.3\mingw53_32\bin\qmake.exe c:\HelloWorldFolder\HelloWorld.pro
The next step would be to run make.
Again asuming a standart Qt installation, make should have the following path:
c:\Qt\Tools\mingw530_32\bin\mingw32-make.exe
Assuming the previous path. enter the following line in your Command Line Tool:
c:\Qt\Tools\mingw530_32\bin\mingw32-make.exe --makefile=Makefile
If everything compiles without error, you should have successfully created a
HelloWorld.exe
that can be found within this pathc:\HelloWorldBuildFolder\release\HelloWorld.exe
As Qt is not statically build by default, that exe will not run out of the box. We'll have to copy the necessary dlls into the release folder. Thankfully qt comes with a tool that does that for us.
Again asuming a standart Qt installation, the tool windeployqt.exe should be found under this path:
C:\Qt\5.9.3\mingw53_32\bin\windeployqt.exe
That said, enter the following in your Command Line Tool
C:\Qt\5.9.3\mingw53_32\bin\windeployqt.exe c:\HelloWorldBuildFolder\release\HelloWorld.exe
After the tool is finished, you should be able run/execute
HelloWorld.exe
like any other exe on your pc.I hope this helps, and hopefully I made no mistakes in my "guide" x)
Greetings
I'll try your steps, and hopefully, with a little time, and most important of all, a lot of patience, I'll succeed! After I make the "Hello World" project, will that help in creating my first virtual instrument engine?
-
That depends highly on the error.
You have to be more specific.
-
@SGaist said in Creating a Virtual Instrument with Qt:
That depends highly on the error.
You have to be more specific.
As you can see in the first post of this topic, I'm trying to create my first virtual instrument player. Not a video player, but a virtual instrument player, loosely patterned after this one at: http://www.soundsonline.com. In addition to graphical controls, mine will include controls that have text-based icons. Someone on here told me to start by making a simple "Hello World" project. I've created the four basic files for that one, but what I wonder is, how would I fix it if there may be an error in compiling the finished .exe file?
-
@SGaist said in Creating a Virtual Instrument with Qt:
That depends highly on the error.
You have to be more specific.
As you can see in the first post of this topic, I'm trying to create my first virtual instrument player. Not a video player, but a virtual instrument player, loosely patterned after this one at: http://www.soundsonline.com. In addition to graphical controls, mine will include controls that have text-based icons. Someone on here told me to start by making a simple "Hello World" project. I've created the four basic files for that one, but what I wonder is, how would I fix it if there may be an error in compiling the finished .exe file?
@Annabelle said in Creating a Virtual Instrument with Qt:
how would I fix it if there may be an error in compiling the finished .exe file?
If there is an error in compiling, the compiler will produce an error message. You should read the error message carefully, because it tells you what's wrong. Once you understand the error, you can fix it or ask for specific assistance.
-
When I make the "Hello World" project, will this help me in basic practices for creating my virtual instrument player? Also, another question I have, what steps would I take to make this virtual instrument available across all operating systems? Is a Windows version designed the same as a Mac version? Windows 32 Bit the same as Windows 64 Bit? And how about Linux? Are there any other operating systems I should know about?
-
When I make the "Hello World" project, will this help me in basic practices for creating my virtual instrument player? Also, another question I have, what steps would I take to make this virtual instrument available across all operating systems? Is a Windows version designed the same as a Mac version? Windows 32 Bit the same as Windows 64 Bit? And how about Linux? Are there any other operating systems I should know about?
-
Yes, "Hello World" will give you a start toward what you are trying to achieve, and is where you need to start from. Put it this way: if you cannot get "Hello World" project done & working, you won't get anywhere with the virtual instrument player.
-
One of the huge points of Qt is precisely that it does allow you to design a single program & an interface which runs on different operating systems. If you were not using Qt (or something similar), you'd have to design separately for each platform.
-
Qt supports Windows (all bit-nesses), Linux (all variants), and MacOS. It allows development for Android devices. That's enough of an operating system list for you to deal with.
There are variations in what is needed to get Qt installed and get your code compiled for each platform, but essentially once you have the running program it will behave to the end user the same on all platforms.
I would find your specification for your first program daunting. and I have been programming for too many years, and am fully sighted. So you should start with very small steps toward your very lofty goal.
-