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.


  • Moderators

    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!



  • @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.


  • Moderators



  • 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.


  • Qt Champions 2017

    @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.



  • @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.


  • Moderators

    @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.



  • @Annabelle

    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 path c:\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 path c:\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:

    @Annabelle

    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 path c:\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 path c:\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?



  • If, by chance, there may be an error when compiling, how would I fix it?


  • Lifetime Qt Champion

    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?


  • Moderators

    @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?



  • @Annabelle

    • 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.


  • Lifetime Qt Champion

    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.


  • Lifetime Qt Champion

    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.



  • @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.html

    I 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.html

    I 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.



  • @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.


  • Moderators

    @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.



  • @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?


  • Moderators

    @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.



  • If anyone is interested, when I complete the manual, I can send it along, so you can get an idea of what the interface will look like. The manual will include keyboard commands, and basic descriptions of the components of the user interface. Will this help in figuring out how to program the different components?


  • Qt Champions 2017

    @Annabelle
    Hi
    Yes it's a very good idea to write manual first.
    It gives a overview of the components needed and what functions they must have.



  • @mrjj said in Creating a Virtual Instrument with Qt:

    @Annabelle
    Hi
    Yes it's a very good idea to write manual first.
    It gives a overview of the components needed and what functions they must have.

    After completing the manual, how would I post it for anyone to read? Is there a way to post attachments on this forum?


  • Qt Champions 2017

    @Annabelle
    Yes there is but it only likes images and .c files.
    Maybe we can cheat and rename it doc to say .cpp
    and people can just rename it back.



  • I could try that, but I still wonder how I would post it? Is there a button on the message page that is designed for posting attachments?


  • Qt Champions 2017

    @Annabelle
    Hi
    it only allows images and not doc or pdf.
    So to post here you would have to use some other site and post the link here so people can download and watch.



  • Would I be able to post it with something like Yousendit?


  • Qt Champions 2017

    @Annabelle
    Only if it gives a link and not want email.
    https://wetransfer.com/ can do it but you have to click on a blue button to make it show
    the option. not sure how well that works with screen reader.

    Alternatively, you can use free dropbox and put file there and right click to get link.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.