Creating a Virtual Instrument with Qt
-
@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.
-
-
Building and playing a bit with a default project will help you get started.
You have the list of main Desktop OS, since you are a beginner, this should already be enough.
You’ll have to build your project for each OS you plan to support. And also follow the deployment procedure for them.
-
Building and playing a bit with a default project will help you get started.
You have the list of main Desktop OS, since you are a beginner, this should already be enough.
You’ll have to build your project for each OS you plan to support. And also follow the deployment procedure for them.
@SGaist said in Creating a Virtual Instrument with Qt:
Building and playing a bit with a default project will help you get started.
You have the list of main Desktop OS, since you are a beginner, this should already be enough.
You’ll have to build your project for each OS you plan to support. And also follow the deployment procedure for them.
So for example, the first part of my Way-Cool Advanced Sample Engine is the Main Window of the App. This includes the Menu Bar, the Player View button, the Browser View button, and the Mixer View button.
-
I was thinking more about getting used to the widgets themselves and how to work with them. Once you're used to them, you can start designing your GUI and implement it.
-
@SGaist said in Creating a Virtual Instrument with Qt:
Building and playing a bit with a default project will help you get started.
You have the list of main Desktop OS, since you are a beginner, this should already be enough.
You’ll have to build your project for each OS you plan to support. And also follow the deployment procedure for them.
So for example, the first part of my Way-Cool Advanced Sample Engine is the Main Window of the App. This includes the Menu Bar, the Player View button, the Browser View button, and the Mixer View button.
@Annabelle
Assuming you're still around. Although I do not use Qt 5.10 (the latest Release), I just noticed what I understand to be a whole new feature introduced there: https://doc.qt.io/qt-5.10/qtspeech-index.htmlI think/hope Qt text-to-speech might be a huge boon to your intended product!
-
@Annabelle
Assuming you're still around. Although I do not use Qt 5.10 (the latest Release), I just noticed what I understand to be a whole new feature introduced there: https://doc.qt.io/qt-5.10/qtspeech-index.htmlI think/hope Qt text-to-speech might be a huge boon to your intended product!
@JonB said in Creating a Virtual Instrument with Qt:
@Annabelle
Assuming you're still around. Although I do not use Qt 5.10 (the latest Release), I just noticed what I understand to be a whole new feature introduced there: https://doc.qt.io/qt-5.10/qtspeech-index.htmlI think/hope Qt text-to-speech might be a huge boon to your intended product!
Yeah I'm still here. I've just recently started school again, so that probably got in the way. QTt ext-To-Speech? Is that sort of like QAccessible? A boon? I'm confused!
-
@JonB said in Creating a Virtual Instrument with Qt:
@Annabelle
Assuming you're still around. Although I do not use Qt 5.10 (the latest Release), I just noticed what I understand to be a whole new feature introduced there: https://doc.qt.io/qt-5.10/qtspeech-index.htmlI think/hope Qt text-to-speech might be a huge boon to your intended product!
Yeah I'm still here. I've just recently started school again, so that probably got in the way. QTt ext-To-Speech? Is that sort of like QAccessible? A boon? I'm confused!
@Annabelle
"Boon" means "helpful or beneficial". I don't know any of the details, just from what you have written previously I thought that anything to incorporate in your wok which aids the hard-of-sight would be a good idea in your product. -
@Annabelle
"Boon" means "helpful or beneficial". I don't know any of the details, just from what you have written previously I thought that anything to incorporate in your wok which aids the hard-of-sight would be a good idea in your product.@JonB said in Creating a Virtual Instrument with Qt:
@Annabelle
"Boon" means "helpful or beneficial". I don't know any of the details, just from what you have written previously I thought that anything to incorporate in your wok which aids the hard-of-sight would be a good idea in your product.Since I believe strongly in diversity, my mission is to make products and services that are accessible to anyone and everyone, whether they are sighted, blind, visually impaired, hearing, deaf, hearing impaired, or even physically handicapped, speech impaired or have learning difficulties.
-
@JonB said in Creating a Virtual Instrument with Qt:
@Annabelle
"Boon" means "helpful or beneficial". I don't know any of the details, just from what you have written previously I thought that anything to incorporate in your wok which aids the hard-of-sight would be a good idea in your product.Since I believe strongly in diversity, my mission is to make products and services that are accessible to anyone and everyone, whether they are sighted, blind, visually impaired, hearing, deaf, hearing impaired, or even physically handicapped, speech impaired or have learning difficulties.
@Annabelle said in Creating a Virtual Instrument with Qt:
Since I believe strongly in diversity, my mission is to make products and services that are accessible to anyone and everyone, whether they are sighted, blind, visually impaired, hearing, deaf, hearing impaired, or even physically handicapped, speech impaired or have learning difficulties.
Yes, that is a very honourable principle.
Qt Text-to-Speech can be used to convert written text to spoken words.
You will need a variety of technologies to make your products and services accessible to everyone. Qt Text-to-Speech is one technology that is helpful to the blind or the visually impaired. However, it is not helpful to the deaf or the hearing impaired.
-
@JonB said in Creating a Virtual Instrument with Qt:
@Annabelle
"Boon" means "helpful or beneficial". I don't know any of the details, just from what you have written previously I thought that anything to incorporate in your wok which aids the hard-of-sight would be a good idea in your product.Since I believe strongly in diversity, my mission is to make products and services that are accessible to anyone and everyone, whether they are sighted, blind, visually impaired, hearing, deaf, hearing impaired, or even physically handicapped, speech impaired or have learning difficulties.
@Annabelle
My understanding, from your earlier posts, is that you are blind and are using text-to-speech technologies --- screen/page readers --- to do your development work.I would think that you would welcome the fact that Qt now offers to incorporate that kind of technology for your end-users into applications you develop with Qt. That is what the new Qt text-to-speech facility I mentioned provides.
-
So for example, in the Mixer Window, how would I create an accessible example of a microphone array?
@Annabelle said in Creating a Virtual Instrument with Qt:
So for example, in the Mixer Window, how would I create an accessible example of a microphone array?
First, describe how you want to let your users interact with the microphone array.
-
@Annabelle said in Creating a Virtual Instrument with Qt:
So for example, in the Mixer Window, how would I create an accessible example of a microphone array?
First, describe how you want to let your users interact with the microphone array.
@JKSH said in Creating a Virtual Instrument with Qt:
@Annabelle said in Creating a Virtual Instrument with Qt:
So for example, in the Mixer Window, how would I create an accessible example of a microphone array?
First, describe how you want to let your users interact with the microphone array.
Basically what happens is, the customer chooses a set of microphones (Close, Mid, Surround, Stage, Room, Overhead, Main Mix, Decka Tree), whichever microphones and mixes are presented in each instrument, by navigating to the Microphones menu and right-clicking or pressing the Applications Key, then left-clicking or pressing enter on the microphones they want to select. The instrument then loads the chosen samples, while the other mixes and microphones are either muted or unloaded from memory.