Does anyone have MIDI playback working? One idea is that Haiku is missing midi sound fonts, which must be installed:
Has anyone tried installing sound fonts and then playing a midi file in MidiPlayer?
Yes I have it working. Took me 6 minutes to do it.
move the file to /boot/system/data/synth
create symlink to big_synth.sy
download midi and drop it on MidiPlayer
Some midi files here to get you started:
It’s working! A big kiss to you, Tones!
On a separate issue, do you have a makefile with an example of linking a GCC2 application?
Andrew, I only take kisses from pretty girls!
Pat on the back for guys.
g++ linking example (from Arora):
g++ -Wl,-O1 -Wl,-rpath,/boot/common/lib -o …/arora .obj/aboutdialog.o .obj/acceptlanguagedialog.o .obj/autosaver.o .obj/autofilldialog.o .obj/autofillmanager.o .obj/browserapplication.o .obj/browsermainwindow.o .obj/clearprivatedata.o .obj/clearbutton.o .obj/moc_webpageproxy.o .obj/qrc_clicktoflash.o .obj/qrc_data.o .obj/qrc_graphics.o .obj/qrc_searchengines.o .obj/qrc_htmls.o -L/boot/common/lib -lQtWebKit -L/boot/common/lib -lphonon -lQtScript -lQtGui -lbe -lfreetype -ltracker -lQtNetwork -lnetwork -lQtCore -lroot -lz
I removed lots of the objects (.o files) because there were too many. You use -L for library location. -l for library to link against (ie: -lnetwork, link against libnetwork, -lroot - libroot). -o for output file name, ie: -o …/arora. And then all the object files you want to link together.
General syntax for linking (gcc & g++):
g++ -o Output-File object1 object2 object3 … -llibrary1 -llibrary2 -llibrary3 …
Edit: two little changes to general syntax
I have one! open terminal and type g++ *.cpp -o appname -lGL -logg -lvorbis
good example Michael because yours does compiling + linking. Mine is linking (object files) only.
Andrew probably wanted compiling+linking because with my example, he would have to compile the object files first.
A Makefile usually compiles the objects first and then combines all the object files + links against libraries to make the binary program.
Extra info for midi.
TimGM6mb is only 1 sound font (well known). There are hundreds. Another very popular one is fluidR3 but very large, 150 MB download.
Websites with additional sound fonts to test out.
The ones with GM (General Midi) in the name are worth testing out. When I first bought SB Live card it came with 2, 4 & 8 MB sound fonts. I used the 4 MB back then and was happy with it.
Thanks for examples, guys. I actually do have experience compiling and using makefiles. My problem is specifically with linking on Haiku. For instance if I link with this line using gcc2:
g++ *.cpp -o MyApp -L/boot/system/lib -l"stdc++.r4.so" it returns:
ld: cannot find -l/boot/system/lib/stdc++.r4.so
If I link with:
g++ */cpp -o MyApp -l/boot/system/lib/libstdc++.r4.so it returns the same error. :-/
I’m missing something simple, but what?
Why you need to link with libstdc++ ???
it’s linked by default as libroot and libbe (implicit)…
only set ‘setgcc gcc2’ command before
sorry for confusing you Andrew.
You do not use the quotes - I put those in to show what you would replace.
gcc2 & gcc4 name libstdc++ a little differently.
gcc2: libstdc++.r4.so (-lstdc++.r4)
gcc4: libstdc++.so (-lstdc++)
you would check what gcc version you are using to know which to use.
I assume you use gcc4.
g++ *.cpp -o MyApp -lstdc++
if you have hybrid Haiku you can switch between gcc2&4 using setgcc command.
PS You should not need -L/boot/system/lib because Haiku should look in there. It may or may not look in /boot/common/lib so you may have to add -L/boot/common/lib (if the library is in that folder and not found).