Want to help with slash notation changes, but....

• Apr 17, 2013 - 13:12

One of the ideas suggested by Marc Sabatella for the Google Summer of Code is to implement true slash notation support. Our fearless leader Lasconic suggested it might be too small a project for SoC.

So I thought it might be nice to contribute a small project myself :-)

In any case, I've followed the compilation instructions here:

http://musescore.org/en/developers-handbook/compilation/compile-instruc…

with one small change... I prefer using homebrew to macports (and I think this might be the problem and have an easy solution too). The project doesn't compile correctly. I get the following error:


CompileC build.release/fluid/mscore.build/Release/fluid.build/Objects-normal/x86_64/sfont3.o fluid/sfont3.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/carney/src/MuseScore/MuseScore
setenv LANG en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -Wno-trigraphs -fpascal-strings -O2 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions "-DCMAKE_INTDIR=\"Release\"" -DQT_DESIGNER_LIB -DQT_DECLARATIVE_LIB -DQT_SVG_LIB -DQT_WEBKIT_LIB -DQT_XMLPATTERNS_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NO_DEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.7 -Wno-sign-conversion -I/Users/carney/src/MuseScore/MuseScore/build.release/fluid/Release/include -I/Users/carney/src/MuseScore/MuseScore/build.release/fluid -I/Users/carney/src/MuseScore/MuseScore/fluid -I/Library/Frameworks/QtDesigner.framework/Headers -I/Library/Frameworks/QtDeclarative.framework/Headers -I/Library/Frameworks/QtSvg.framework/Headers -I/Library/Frameworks/QtWebKit.framework/Headers -I/Library/Frameworks/QtXmlPatterns.framework/Headers -I/Library/Frameworks/QtGui.framework/Headers -I/Library/Frameworks/QtXml.framework/Headers -I/Library/Frameworks/QtNetwork.framework/Headers -I/Library/Frameworks/QtCore.framework/Headers -I/Users/carney/src/MuseScore/MuseScore -I/Users/carney/src/MuseScore/MuseScore/build.release -I/usr/local/Cellar/jack/1.9.7/include -I/usr/local/Cellar/portaudio/19.20111121/include -I/Users/carney/src/MuseScore/MuseScore/build.release/fluid/mscore.build/Release/fluid.build/DerivedSources/x86_64 -I/Users/carney/src/MuseScore/MuseScore/build.release/fluid/mscore.build/Release/fluid.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/carney/src/MuseScore/MuseScore/build.release/fluid/Release -F/Library/Frameworks -std=c++0x -stdlib=libc++ -DNDEBUG -g -Wall -Wextra -Winvalid-pch -include /var/folders/j5/nbj06h9x41zbtmp57b3bn47m0000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/all-gifcddqedrhjvmczwbhxklmyuyep/all.h -MMD -MT dependencies -MF /Users/carney/src/MuseScore/MuseScore/build.release/fluid/mscore.build/Release/fluid.build/Objects-normal/x86_64/sfont3.d --serialize-diagnostics /Users/carney/src/MuseScore/MuseScore/build.release/fluid/mscore.build/Release/fluid.build/Objects-normal/x86_64/sfont3.dia -c /Users/carney/src/MuseScore/MuseScore/fluid/sfont3.cpp -o /Users/carney/src/MuseScore/MuseScore/build.release/fluid/mscore.build/Release/fluid.build/Objects-normal/x86_64/sfont3.o
/Users/carney/src/MuseScore/MuseScore/fluid/sfont3.cpp:4:10: fatal error: 'vorbis/codec.h' file not found
#include
^
1 error generated.

** BUILD FAILED **

I've checked, and the needed include file is in /usr/local/include/vorbis/codec.h (I made sure that libogg and libvorbis were installed so the header files are there), which makes me suspect that "/usr/local/include" is not on the include path with a -I argument to the C++ compiler... and sure enough, if you look at the code above, there's no "-I/usr/local/include."

So, the first step in my tackling this project is to get past this... then I can follow the git workflow and checkout a branch to develop the "slash_notation" feature on, and then I'll need a bit of help understanding the layout of the code and the areas that would be affected by such a change.

So, if anyone has an idea of how to get past this compile time error to start off with, I'd really appreciate it.

Thanks.

- Mike.


Comments

This is the main reason why I'm still using macports for MuseScore :) I think the good way to solve this would be to check for the ogg/vorbis dependency at the start and populate the include path accordingly. I didn't investigate this yet but I did find a Cmake module to do so. See attachment.

Attachment Size
FindOggVorbis.cmake_.txt 2.54 KB

In reply to by [DELETED] 5

I successfully compiled everything.... linking, however...

I ran into this (related to the above compile problem I'm sure):


Ld build.release/mscore/Release/mscore.app/Contents/MacOS/mscore normal x86_64
cd /Users/carney/src/MuseScore/MuseScore
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -L/Users/carney/src/MuseScore/MuseScore/build.release/mscore/Release -F/Users/carney/src/MuseScore/MuseScore/build.release/mscore/Release -F/Library/Frameworks -filelist /Users/carney/src/MuseScore/MuseScore/build.release/mscore/mscore.build/Release/mscore.build/Objects-normal/x86_64/mscore.LinkFileList -mmacosx-version-min=10.7 -stdlib=libc++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Users/carney/src/MuseScore/MuseScore/build.release/libmscore/Release/liblibmscore.a /Users/carney/src/MuseScore/MuseScore/build.release/awl/Release/libawl.a /Users/carney/src/MuseScore/MuseScore/build.release/mstyle/Release/libmstyle.a /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/diff/Release/libdiff_match_patch.a /Users/carney/src/MuseScore/MuseScore/build.release/bww2mxml/Release/libbww.a /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/rtf2html/Release/librtf2html.a /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/singleapp/src/Release/libqtsingleapp.a /Users/carney/src/MuseScore/MuseScore/build.release/synthesizer/Release/libsynthesizer.a /Users/carney/src/MuseScore/MuseScore/build.release/midi/Release/libmidi.a /Users/carney/src/MuseScore/MuseScore/build.release/fluid/Release/libfluid.a /Users/carney/src/MuseScore/MuseScore/build.release/effects/Release/libeffects.a -lvorbisfile /Users/carney/src/MuseScore/MuseScore/build.release/zerberus/Release/libzerberus.a /Users/carney/src/MuseScore/MuseScore/build.release/synthesizer/Release/libsynthesizer.a /Users/carney/src/MuseScore/MuseScore/build.release/aeolus/aeolus/Release/libaeolus.a -lvorbis -logg /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/ofqf/Release/libofqf.a -framework QtDesigner -framework QtDeclarative -framework QtScript -framework QtSvg -framework QtWebKit -framework QtXmlPatterns -framework QtGui -framework QtXml -framework QtSql -framework QtNetwork -framework QtCore -lz -ldl -lpthread -L/usr/local/Cellar/portaudio/19.20111121/lib -lportaudio -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -lsndfile /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/portmidi/Release/libportmidi.a -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework CoreMIDI -framework SystemConfiguration -framework CoreServices -o /Users/carney/src/MuseScore/MuseScore/build.release/mscore/Release/mscore.app/Contents/MacOS/mscore
ld: library not found for -lvorbisfile
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Similar to the above, libvorbisfile.dylib is in /usr/local/lib, so I just need to get the -L in the proper place. I'm looking through the top level CMakeLists.txt file for the right setting, but no luck so far. Any help would be appreciated.

- Mike.

In reply to by [DELETED] 5

I already made that change. That got me past the compilation problems. That seems to be what got the include path set up properly, but didn't help with the link path.

I just tried adding "OGGVORBIS_LIBRARIES" to that area... I'll post here what happens.

Also, once I get this up and building properly, should I update the MacOSX build page?

UPDATE: No luck... will continue trying.

I can't help with the compilation issues, or really help with any code internals, but I can offer a few overall design suggestions on this feature.

If you are just looking atMuseScore imternals for the first time, realize that what you might think of a note is actually considered a "chord" - because of course, any note can potentially have more notes added to the stem. That is, a plain note is a chord consisting of just a single note. The code associated with slash notation will probably work primarily at the chord level.

The quick-and-dirty method I mentioned "should" be pretty trivial. Add a new property to chords called "fixed". Expose this property in the Inspector along with other chord properties like stemless. Also, allow it to be set in the plugin framework and update the slash plugin to set that property. Then, find everywhere that notes are transposed: in the "concert pitch" mode code, also the transpose command - and have it check for this property before transposing. I'm not sure what would make sense regarding transposition via up/down arrow - maybe it should affect slashes when only only a single chord is selected, or in a group of only slashes, but in a mixed group, slashes would be left alone. Also, this wouldn't handle clef changes unless you also added logic to the clef change code to hunt through the music up to the next clef change and adjusted the pitch of all "fixed" notes. I'm not sure that's really a good idea, though - seems like too much work for what was intended to be a a simple hack.

The *real* solution, though, is to definte slash notation as a "measure style" a la MusicXML See this:

http://musescore.org/en/node/17468

I don't know the details of how MusicXML defines this style, but in order to be truly useful, it would have to work on partial measures (so a measure could contain a couple of beats of regular notes well as a couple of beats of slashes), also be staff-specific (so there could be slashes in the piano part but not saxophone part at a given measure) and also voice-specific (so there could be regular notes in one voice but slashes in another within a single measure of a single staff). There would need to be separate modes for slashes versus rhythmic notation, a way of specifying which staff line the slashes are to be displayed on for each mode, and then of course, the rendering code woild have to deal with all of that. It's definitely a *much* more involved change than the first method, but it's the right way to go long term, I think.

It's really this version I was thinking might make a decent GSoC project - the quick-and-dirty method is definitely no more than a weekend hack. But with a sufficiently generalized "measure style" facility, I could imagine this being used to allow a staff to switch between regular and percussion notation, or regular and tab, or five line and three line. Could also be used to allow transposition overrides, so a part ostensibly for alto saxophone could have a passage defined to transpose for clarinet instead. 2.0 allows mid-staff instrument changes for playback, but transposition is not affected, unfortunately.

In reply to by Marc Sabatella

Hi Marc, and thanks for chiming in.

I'm not familiar with MusicXML and how it defines slash notation (thanks for the link to the other thread). I'm a little familiar with Finale, and not at all with Sibelius.

Wouldn't this have to be a property on all of the following: Staff, Measure, and Note? By that I mean... it should be able to be defined anywhere, and overridden at the lower levels so you could say that the ENTIRE staff is slash notation, EXCEPT for these two measures which are normal notation, EXCEPT for these two beats which are still slash notation.

Does this make sense as a description of the kind of flexibility we'd ultimately want?

- Mike

In reply to by carneyweb

Finale and MusicXML have kind of a special relationship. MakeMusic (owners of Finale) actually controls the MusicXML definition now, but even before that was the case, it seems MusicXML often emulated Finale and/or vice versa. So one can often start by assuming MusicXML will probably resemble Finale.

The way slash notation works in Finale is through what it calls a "staff style" (that I gather is called a "measure style" in MusicXML). A staff is created by selecting a region and applying the staff style from a menu of different choices. The region itself might be a single measure or multiple (contiguous) measures, it might start or end with a partial measure. It might be within one staff or span several. But the style applies to everything in the selected region, and Finale displays this on screen with a blue horizontal bar over the affected measures (or portions of measures) so you can see what has been affected by a staff style, and the name of the staff style displays within the blue bar. There are several different predefined staff styles to choose from, and you can also define your own. Within the definition of the specific style you are applying, you control what effect the style should have - choice include ordinary slashes, rhythmic notation, blank, I forget what else - and what "voices" (layers, in Finale) this should apply to.

So I think a starting point would be to create a file in Finale with the predefined slash notation style for a number of full measures, also a region that starts and/or ends mid measure, also using the rhythmic notation style somewhere, then export to MusicXML and examine. I have only an old version of Finale and its not installed on my main computer, so I can't easily do that for you. The version I have does not support what I called "accent notation" in my MuseScore slash notation plugin - small rhythmic notation placed above the staff in conjunction with normal notes on the staff - but I wouldn't be surprised if more recent versions of Finale included such a feature, or if MusicXML supported it directly.

My sense is that ordinary slashes are not represented individually in Finale or MusicXML - there is just a "start" and "end" marker for the style. Rhythmic notation in Finale is just ordinary notes that are marked with the "rhythmic notation" style, so I'd expect the MusicXML to *look* like ordinary notes, except the for the "start" and "end" markers to define the region.

Still no joy. Getting a link problem with vorbisfile... I checked and this file is in /usr/local/lib/libvorbisfile.dylib, but I can't figure out how to get the /usr/local/lib file on the link path:

Ld build.release/mscore/Release/mscore.app/Contents/MacOS/mscore normal x86_64
cd /Users/carney/src/MuseScore/MuseScore
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -L/Users/carney/src/MuseScore/MuseScore/build.release/mscore/Release -F/Users/carney/src/MuseScore/MuseScore/build.release/mscore/Release -F/Library/Frameworks -filelist /Users/carney/src/MuseScore/MuseScore/build.release/mscore/mscore.build/Release/mscore.build/Objects-normal/x86_64/mscore.LinkFileList -mmacosx-version-min=10.7 -stdlib=libc++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Users/carney/src/MuseScore/MuseScore/build.release/libmscore/Release/liblibmscore.a /Users/carney/src/MuseScore/MuseScore/build.release/awl/Release/libawl.a /Users/carney/src/MuseScore/MuseScore/build.release/mstyle/Release/libmstyle.a /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/diff/Release/libdiff_match_patch.a /Users/carney/src/MuseScore/MuseScore/build.release/bww2mxml/Release/libbww.a /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/rtf2html/Release/librtf2html.a /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/singleapp/src/Release/libqtsingleapp.a /Users/carney/src/MuseScore/MuseScore/build.release/synthesizer/Release/libsynthesizer.a /Users/carney/src/MuseScore/MuseScore/build.release/midi/Release/libmidi.a /Users/carney/src/MuseScore/MuseScore/build.release/fluid/Release/libfluid.a /Users/carney/src/MuseScore/MuseScore/build.release/effects/Release/libeffects.a -lvorbisfile /Users/carney/src/MuseScore/MuseScore/build.release/zerberus/Release/libzerberus.a /Users/carney/src/MuseScore/MuseScore/build.release/synthesizer/Release/libsynthesizer.a /Users/carney/src/MuseScore/MuseScore/build.release/aeolus/aeolus/Release/libaeolus.a -lvorbis -logg /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/ofqf/Release/libofqf.a -framework QtDesigner -framework QtDeclarative -framework QtScript -framework QtSvg -framework QtWebKit -framework QtXmlPatterns -framework QtGui -framework QtXml -framework QtSql -framework QtNetwork -framework QtCore -lz -ldl -lpthread -L/usr/local/Cellar/portaudio/19.20111121/lib -lportaudio -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -lsndfile /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/portmidi/Release/libportmidi.a -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework CoreMIDI -framework SystemConfiguration -framework CoreServices -o /Users/carney/src/MuseScore/MuseScore/build.release/mscore/Release/mscore.app/Contents/MacOS/mscore
ld: library not found for -lvorbisfile
clang: error: linker command failed with exit code 1 (use -v to see invocation)

In reply to by [DELETED] 5

No luck.

I wish I was more familiar with cmake... I'm an old school make "expert", and for the life of me, I can't figure out how the command gets built up with the link line and where the -L and -I options come from.

Here's the link line that gets generated... no -L/usr/local/lib.

- Mike.


Ld build.release/mscore/Release/mscore.app/Contents/MacOS/mscore normal x86_64
cd /Users/carney/src/MuseScore/MuseScore
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -L/Users/carney/src/MuseScore/MuseScore/build.release/mscore/Release -F/Users/carney/src/MuseScore/MuseScore/build.release/mscore/Release -F/Library/Frameworks -filelist /Users/carney/src/MuseScore/MuseScore/build.release/mscore/mscore.build/Release/mscore.build/Objects-normal/x86_64/mscore.LinkFileList -mmacosx-version-min=10.7 -stdlib=libc++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names /Users/carney/src/MuseScore/MuseScore/build.release/libmscore/Release/liblibmscore.a /Users/carney/src/MuseScore/MuseScore/build.release/awl/Release/libawl.a /Users/carney/src/MuseScore/MuseScore/build.release/mstyle/Release/libmstyle.a /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/diff/Release/libdiff_match_patch.a /Users/carney/src/MuseScore/MuseScore/build.release/bww2mxml/Release/libbww.a /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/rtf2html/Release/librtf2html.a /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/singleapp/src/Release/libqtsingleapp.a /Users/carney/src/MuseScore/MuseScore/build.release/synthesizer/Release/libsynthesizer.a /Users/carney/src/MuseScore/MuseScore/build.release/midi/Release/libmidi.a /Users/carney/src/MuseScore/MuseScore/build.release/fluid/Release/libfluid.a /Users/carney/src/MuseScore/MuseScore/build.release/effects/Release/libeffects.a -lvorbisfile /Users/carney/src/MuseScore/MuseScore/build.release/zerberus/Release/libzerberus.a /Users/carney/src/MuseScore/MuseScore/build.release/synthesizer/Release/libsynthesizer.a /Users/carney/src/MuseScore/MuseScore/build.release/aeolus/aeolus/Release/libaeolus.a -lvorbis -logg /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/ofqf/Release/libofqf.a -framework QtDesigner -framework QtDeclarative -framework QtScript -framework QtSvg -framework QtWebKit -framework QtXmlPatterns -framework QtGui -framework QtXml -framework QtSql -framework QtNetwork -framework QtCore -lz -ldl -lpthread -L/usr/local/Cellar/portaudio/19.20111121/lib -lportaudio -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -lsndfile /Users/carney/src/MuseScore/MuseScore/build.release/thirdparty/portmidi/Release/libportmidi.a -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework CoreMIDI -framework SystemConfiguration -framework CoreServices -o /Users/carney/src/MuseScore/MuseScore/build.release/mscore/Release/mscore.app/Contents/MacOS/mscore

I finally got e erythema to compile and link properly. Now... Time to dig into the code a bit.

Thanks for all your help everyone!

- Mike.

Do you still have an unanswered question? Please log in first to post your question.