Produce midi sound with rtMidi in Ubuntu - c++

I have a problem playing a midi sound on my linux machine. Using RtMidi and C/C++ I generate three midi messages, and even though I try all the possible ports(I probed for all output ports) I cannot seem get a sound out of it. Should I manually connect one of these timidity ports to the speakers and how?
Thanks beforehand
EDIT 1:
I am trying to implement the solution by Chris Arndt described
here as:
"Have a look at the RtMidi library. It is cross-platform (Win, OS X, Linux, SGI), written in C++ and easy to compile and include in your project.
Then start Timidity as a server (Ubuntu includes an init script for this), which will create several ALSA sequencer client ports for Timidity. Open one of these ports as an output in RtMidi and start sending midi messages."

The problem derived from the online example of rtMidi, when I used the example from the documentation, it worked fine.

Related

Difference between USB Serial in Windows and Linux

I bought a Variense VMU931 inertial measurement unit (IMU) for a robotics project at school, and I am struggling to get it to reliably communicate with my laptop in Ubuntu. I am using C++ with termios to connect to it using 8n1 no parity blah blah blah. I've tried EVERY permutation of settings I can think of, and I still cannot reliably send commands to the IMU.
I called Variense support and spoke to the engineer that wrote their software, and he said it is a known issue. Evidently it works perfectly in Windows (and the Windows demo software worked fine with my device), but neither of us is aware of a significant difference between the USB Serial emulation in Windows and in Linux.
The constructor at the top of this file shows how I am opening and configuring the port:
https://github.com/jsford/FFAST/blob/master/VMU931/src/vmu.cpp
Any help would be great. I've been tearing my hair out over this!
Thanks!
Use the cu utility for running tests with different parameters.
To debug the issue: run the USB packet capture with Wireshark on Linux directly and also on a Windows VM running in VirtualBox/VmWare. Compare the traffic.
Check which kernel module is chosen and loaded for that USB device. Use /sys/ filesystem for that: this virtual fs has information from kernel about what's used. Also, the lsmod-kind of commands show the kernel module usage. The driver choice for USB depends on something like <usb-manufacturer-id>:<usb-product-id>.
Put some printfs into the kernel module to see where is fails. Use the DKMS build system for rebuilding the kernel module. There is a config file somewhere in Linux to blacklist/whitelist the kernel modules - useful to make sure that the right one is loaded.
That's what I was doing to fix a driver of an USB-serial device.

How to use wmi in Ubuntu with C++

I want to get information from my Client's that running Windows through Linux.
I have several clients that running Windows, and I'm running Ubuntu. I want to make a C++ code, and get information like CPU usage, disk space, etc from my client's.
Is there any way to do that?
I know I can use WMIC (WMI Client) and execute query (WQL) from terminal, but I want to use some libraries in C++ (I use Qt Creator).
First Create an application using the following library
http://msdn.microsoft.com/en-us/library/aa390423(v=vs.85).aspx
and send this information back to the ubuntu either using sockets or any other ports or simply save it into a txt file and access that file using ftp.
http://msdn.microsoft.com/en-us/library/aa394558(v=vs.85).aspx
Is there any C++ library to work with WMI?

using QMediaPlayer on Windows system with code compiled on Linux

A project of mine is written with Qt5/c++, using the QMediaPlayer class to read audio files. Everything's ok as long as I run this project on Linux.
Since I want to run my program on Windows, I use MXE to compile my code and create a binary file for Windows systems.
The program seems ok, except this problem with the QMediaPlayer class. When the program runs on a Windows system, I read this message :
defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer".
By googling around, I came to understand that the QMediaPlayer used several plugins, different on each platform. On Windows, The WMF plugin is Microsoft-only, DirectShow seems useless; others suggest to use other external plugins like portaudio, SdlAudio ou OpenAI.
How may I solve this problem ?
I found the problem and know how to fix it : according to this thread, just add the following line to your .pro file :
QTPLUGIN += dsengine qtmedia_audioengine

PortAudio shows a device count of zero for both Asio and WDM-KS

PortAudio is showing a deviceCount of 0 and a defaultOutputDevice of -1 for both the ASIO and Windows WDM-KS host APIs. I did successfully build PortAudio to include support for both ASIO and Windows WDM-KS and both options do show up when iterating over the available hosts. I have also verified that I do have ASIO4All installed. What am I doing wrong? I am running windows inside a virtual machine (vmware) on a Mac. Is that causing issues?
I found the solution. Luckily, I had a friend who had a project working using ASIO. He let me try running his code on my box and it was able to find the ASIO devices correctly. From there it was a matter of working backwards until I found the thing that was different between the 2 projects.
Both projects used a c# application to host a managed c++ assembly that made the calls into PortAudio. The issue ended up being that my projects static void Main(string[] args) didn't have an [STAThread] attribute. Once I added that, the ASIO devices started showing up. Hope this helps someone.
The first obvious test would be to quickly install a host on the vm that supports ASIO. You can try Reaper http://www.reaper.fm/ as it is free to download and use while evaluating it.
If the 3rd party host software supports the device via asio4all, then you know that you have some error using port audio.
If the 3rd party audio host does not recognise the device either, then look into your asio4all setup.

Launching applications silently?

My C++ application calls VLC as a subprocess. Is there a way to avoid having the GUI pop-up? I am looking for a Mac and a Windows solution. Hackish workarounds are welcome too.
PS: I know there is such a thing as cvlc (command-line version of VLC), but I haven't found any builds for it online. You do get it when you make the build yourself, but that hasn't worked out yet on my Snow Leopard machine. I also need a Windows version, but I don't feel courageous enough to attempt making a VLC build myself on this platform.
Solved
All I had to do was add the "-I dummy" parameters.
I found the answer. VLC allows you to start without GUI by using:
VLC -I dummy
Starts the "dummy" interface.
VLC -I rc
Starts the "remote control" interface, which allows you to send commands using the stdin channel.
There are a few options in this thread
When you create the VLC instance using the libvlc_new function you have a VLC arguments to not display VLC interface. See this small example.