My Little Project

Pages: 123
As some of you may know, I've been working on a virtual musical instrument. Some of you (as in one or two people) have asked about it, and I may at several points have said that I'd provide links later.

Well... I've gotten far enough with the project that I thought I'd share it. It's not anywhere near completion, but I think it's far enough that nobody will smirk and be like "cool toy, sis" (except those few of you who'll say it just because I said I wasn't expecting it).

If anyone's curious about what I've been working on recently or if you'd just like to laugh at my evil coding habits, the Sourceforge link is here:
http://sourceforge.net/projects/soundbench/

Though it should theoretically compile on all three major platforms, I haven't yet been able to compile it for Windows or Mac (partially because I don't have either platform available to me). On Ubuntu Linux, though, it should compile just fine after installing the necessary packages, which IIRC are:
libqt4-dev
portaudio19-dev
libsndfile1-dev


The git version also has a dependency on libportmidi-dev.

-Albatross
Last edited on
Please invest in some directories, I think the OCD part of my brain had a heart attack (a very neat and orderly one) when I saw all the files in one place.

Other than that, I couldn't build it:
make: *** No rule to make target `Soundbench.pro', needed by `Makefile'.  Stop.

I installed the following libraries (Fedora 17):
qt qt-devel
libsndfile libsndfile-devel
portaudio portaudio-devel

but no dice.

[quote=ProgrammingStyleRegulations.txt]Juxtapositioning of words is permitted as long as the juxtaposition is understandable. (i.e. filepoint).[/quote]
What about superpositioning words? Is that okay?

p.s. is Amaya an Islamic name?
chrisname wrote:
Please invest in some directories

That's a good idea, especially for when the file count increases a bit more. I'll see what I can do about that for the next version. :)

make: *** No rule to make target `Soundbench.pro', needed by `Makefile'. Stop.

...oddness. I couldn't reproduce your error... can you provide any more information?

What about superpositioning words? Is that okay?

*shrug* If you can tell what it means and it's not a misnomer. I have yet to see a superposition that fulfills both conditions. :)

p.s. is Amaya an Islamic name?

It can be, but in my case it's Japanese. Thanks for asking.

-Albatross
Last edited on
Albatross wrote:
That's a good idea, especially for when the file count increases a bit more. I'll see what I can do about that for the next version. :)

I had the same problem with Qemu. It's strange, because I'm very disorganised in real life, but on computers, I take it to an extreme.

...oddness. I couldn't reproduce your error... can you provide any more information?

That's what happens whenever I try 'make' or 'make all', unless I'm missing something out. I don't think there's anything else to mention... I open a terminal in the source directory and type "make" and it spits out that error. If I edit the Makefile by replacing all instances of Soundbench.pro to Soundbench-0.2.1.pro, it changes the error to
No rule to make target `/usr/share/qt4/mkspecs/linux-g++/qmake.conf'
. By the looks of it, it seems to be wrongly using those files as build targets or something.

It can be, but in my case it's Japanese. Thanks for asking.

Japanese was actually my first guess, but I google'd it and the Internet suggested it was Hindu or Islamic.
chrisname wrote:
It's strange, because I'm very disorganised in real life, but on computers, I take it to an extreme.

I know what you're talking about. :)

I open a terminal in the source directory and type "make" and it spits out that error.

Ah... I'm guessing you didn't type qmake first?

...the Internet suggested it was Hindu or Islamic.

Silly internet.

-Albatross
Albatross wrote:
Ah... I'm guessing you didn't type qmake first?

Ohhhhhhhhhh

Let me install qmake and then I'll get back.

[edit] I ran it for a while, but I didn't know what I was doing. There were a few error messages, and it crashed after a while because of a floating point exception. Hopefully the output will help you fix it:
$ ./Soundbench-0 
Gtk-Message: Failed to load module "pk-gtk-module"
Determining which audio backends will initialize...
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
Initializing a PortAudio audio backend...
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
PortAudio backend initialized.
Soundbench loaded.
ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred
Loading track #0...
Error switching tracks.
Floating point exception (core dumped)
Last edited on
chrisname wrote:
Loading track #0...
Error switching tracks.

/desk
I had been meaning to add a safety net there for if the MIDI file reader failed. That part of the code has been the bane of my existence recently.

I'll go patch that up and upload the fixed source code.

-Albatross
There's no README and I had to use my "initiative" to find BUILDING. Also, C++ 11? This isn't the year 2020 :( And finally, what's with the first person plural? Surely it's just you.

In other news, I've stolen my father's Alfa Romeo Spider. It's older than over half of my siblings, and a lot more fun.
What is the program meant to do?
Alright, I found the bug. It's fixed, and now the new version is uploaded, if anyone would like to download it.
http://sourceforge.net/projects/soundbench/files/0.2.2%20Alpha/

I really hated that file-reading part, but alas. It had to be done.

@NGen
It's meant to be a virtual instrument. Sadly it's not 100% there yet. Hopefully it will be soon, though.

-Albatross
Last edited on
Looks cool! I might give it a try soon...need something to make MIDIs with eventually.
Ah, a musical instrument, I thought you referring to a virtual data-gathering instrument.
@firedraco
Thanks! It's nowhere near where I'd like it to be, but... it's getting there.

@NGen
Ahaha. Whoops. I should probably clarify that. Thanks for pointing that out.

-Albatross
Last edited on
Hm, well I tried to compile it and apparently I'm missing some other libs that go with it. Got a bunch of missing header file errors.

Also...

It can be, but in my case it's Japanese. Thanks for asking.


You're Japanese? Were you born in the US or move here?
I've had a couple issues, I had to explicitly cast the calls to tellg() on lines 155 and 186 in midifio-readeropen.cpp to long long int which I dont understand as I thought the conversion to/from streampos was handled by the stream class. I can now run but segfaults after about 10 seconds, I am running Kubuntu in a virtual machine so I suppose that could be the problem.

Edit: I'd like to try it in windows but I'm having trouble getting portaudio to compile.
Edit2: Here is the console output.
Determining which audio backends will initialize...
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (MIXER,'IEC958 Playback Default',0,0,0): No such file or directory
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (MIXER,'IEC958 Playback Default',0,0,0): No such file or directory
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (MIXER,'IEC958 Playback Default',0,0,0): No such file or directory
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
Initializing a PortAudio audio backend...
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (MIXER,'IEC958 Playback Default',0,0,0): No such file or directory
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (MIXER,'IEC958 Playback Default',0,0,0): No such file or directory
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (MIXER,'IEC958 Playback Default',0,0,0): No such file or directory
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed : Input/output error(5)
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
PortAudio backend initialized.
Using soft limit on CPU usage as upper bound of CPU meter.
Soundbench loaded.

Last edited on
@firedraco
Actually, I'm not. My parents just decided that it was a really pretty name, gave it to me, and... here I am.

@naraku
Believe it or not that actually looks pretty normal to me, as PortAudio is very verbose when it initializes. The only thing that bugs me is this:
ALSA lib setup.c:565:(add_elem) Cannot obtain info for CTL elem (MIXER,'IEC958 Playback Default',0,0,0): No such file or directory

...which is not something I've ever seen before. Sorry.

@all (June 09 GMT - 8:00)
I won't be available for most of today. Thanks for all the support!

-Albatross
Last edited on
Actually, I'm not. My parents just decided that it was a really pretty name, gave it to me, and... here I am.


Ah, gotcha.

Well, I found QT and PortAudio pretty easily, but I tried a quick google for what libsndfile1-dev was but I didn't get anything that seemed related to it. What is it exactly?
You want to search for libsndfile if you're on Windows. "libsndfile" = "sound file library". It's a library for reading and writing audio files. Here's the website: http://www.mega-nerd.com/libsndfile/

libsndfile1-dev is just the name of the package on Ubuntu (edit: and Debian) Linux. "1" denotes the major version number (I think) and "-dev" means "development files" (headers & compile time libraries, rather than just a runtime library). Different Linux distros name packages in different ways (for example, on Fedora, it's libsndfile-devel instead); it's a bit like the way different C++ compilers might mangle function names differently.
Last edited on
For compilation, I had to add #include <unistd.h> to sbutilities.h, to ensure that _POSIX_VERSION existed.

@chrisname
And voila, some of the files now have folders in the git version.

@Moschops
Fixed by adding a few more compiler-defined macros which if present will define SB_ENV_POSIX (for the git version).

@naraku9333
I'll be putting in the explicit casts to streampos in the next commit. Say, might I ask what compiler were you using?

-Albatross
Last edited on
Pages: 123