Improve user experience on Windows for playback with a complete soundfont

• Apr 3, 2009 - 12:19
Type
Functional
Severity
S4 - Minor
Status
closed
Project

Currently, all first time users on Windows are confronted with the fact that MuseScore only plays one part with piano sound. We see this question popping up on the MuseScore forum, mailing list as well as many comments on several websites. So we are quite aware for some time that this is a serious user experience issue.

A proposal to solve this issue has been discussed on the mailing list. Unfortunately, lack of know-how has kept us from moving forward. Another idea might be to look at how Canorus has implemented a solution.


Comments

For the reference: Puedes consultar esta tabla comparativa entre Finale Notepad 2009 y MuseScore. Verás que MuseScore sale mejor parado como editor, pero su punto débil es la reproducción en la que gana Finale Notepad. Pero siempre se puede exportar en XML y abrir con Finale Reader para escuchar con más calidad el archivo final.

Source: tecnotaku.wordpress.com

In r.1809 the default piano sound plays all parts.

For future versions I may look at finding (or creating) a light-weight GM SoundFont to include with MuseScore but I think this is less critical.

>Another idea might be to look at how Canorus has implemented a solution.

To achieve realtime midi playback, Canorus has a CAMidiDevice based on RTMidi
It creates a CAPlayback object to link the CAMidiDevice to the score, and then runs it:

			myPlaybackObject->run()

It calculates when to send midi events, and then calls msleep as necessary

			if ( midiDevice()->isRealTime() )
				msleep( qRound(minLength*sleepFactor) );

I think that's right anyway....
The files are src/interface/mididevice.* and src/interface/playback.*

Hope to help
D

Great investigation David. Are you involved in the Canorus development somehow?
The MuseScore project is still looking for a developer who has experience with MIDI on Windows to implement a solution for this issue.

Hi Thomas - no, I'm not involved with Canorus, but I perused their code in the hope of being useful. As far as I can tell there is nothing special about MIDI in Windows - RTMidi will give a list of available ports (getPortCount(), getPortName()) - so you just choose one (or let the user choose as with Sibelius, version 2 anyway) - and then send the MIDI messages at the correct time. RTMidi handles all the platform dependent stuff, except the timing which Qt's msleep() seems to provide.

So it's probably simply a coding task. Presumably as Canorus is using this approach it also works with Linux and Mac too.

I'm not clear about why MuseScore uses sound fonts - is it simply because there wasn't anyone with MIDI experience on Windows? Long term presumably you want to be able to control volume during a held-note-crescendo, so MIDI will be inadequate - but portaudio can't do that either, can it?

Where's the playback code in MuseScore by the way?

D

Davidk, see Werner's (wschweer) replies in the discussion on the mailing list (see link above at the top of this thread). He explains the rational behind portaudio and possible move toward jack.

I am not a MIDI expert but I was under the impression that it is able to crescendo during a held note. Am I wrong?

I haven't worked directly with MIDI for many years, but there is an aftertouch controller which can be assigned to various effects, including volume.

Thanks David.

Canorus' CAPlayback object is in fact a thread, which seems to tie in with Werner's thoughts. The MuseScore code is quite difficult to get to grips with - definitions are spread through many different files and ( for me at least ;) ) it would be nice to have a few more comments. That's an observation, not a criticism - it's a stunning piece of software. So perhaps Werner might like to review the Canorus approach which seemingly already works? I suspect the MuseScore code could be vastly simplified.

Standard MIDI messages are 'note on (at a certain volume level)' and 'note off'. No crescendo. Aftertouch isn't available on all devices as far as I know, and I believe the function is often set at the device itself rather than through MIDI messages. A random link:


http://www.kvraudio.com/wiki/?id=aftertouch
"If the destination device is capable and enabled to recieve Aftertouch MIDI data, this information can be interpreted many number of ways"

Note the word 'if'. It used to be the case that PC audio cards had no standard aftertouch mechanism - I rather doubt that they do now, but I'll try to find out.

In practice using MIDI produces OK sounds - but not great. Choral music (and trumpet ;) etc ) suffer because the dynamic shapes can't be implemented - at least that's my experience with an early Sibelius version. I understand that Sibelius now has proper synthesis of sounds.

MuseScore is shaping up to be right at the class end of the score-writer spectrum, so it would be well to consider how/ when it might implement a similar system.

Another limitation of MIDI is that there are only a certain number of channels (effectively number of instruments).
D

MIDI uses 128 "levels", therefore there are 128 channels (voices) per MIDI stream. It is possible to use more than 1 MIDI stream.

I believe virtually all sound producing devices today are capable of interpreting after-touch - in the early days it was an issue. However, I am not totally certain of yhis as it is many years since I used MIDI extensively. Much more info can be found at the MMA site

Regards.

Thanks. I think the terminology can get in the way a bit - there are 128 'levels' of volume, for example, from 0 (off) to 127 (loudest) - but that's separate from 'channels'. And 'channels' aren't the same as 'voices'.

The MMA points to http://www.midi.org/techspecs/gm.php, which says:

"... GM1 remains a popular format for lower-cost synthesizers and is commonly used for music distributed as Standard MIDI Files.
.....
Voices: A minimum of either 24 fully dynamically allocated voices are available simultaneously for both melodic and percussive sounds, or 16 dynamically allocated voices are available for melody plus 8 for percussion. ...
Channels: All 16 MIDI Channels are supported. Each Channel can play a variable number of voices (polyphony). ... "

Looking at the spec of one of the current Creative soundblaster cards I see it has 64 voices - but I think many systems have on-motherboard sound, not a decent sound card - with much less, maybe just one voice per channel and 16 channels.

D

Thanks for the link to the samples, David. I did set up a GM soundfont, but I'm not entirely happy with it. Is there a free program you use to edit soundfont files, which I could use to add drum samples?

I searched my computer for files of type "*.sf2" and found a reasonable soundfont that came with my sound card. This strategy worked both at home and at work, both on Windows machines. The file is called 'ct2mgm.sf2.'

REdwards came across a 6 MB, General MIDI SoundFont from TiMidity: TimGM6mb.sf2
http://ocmnet.com/saxguru/Timidity.htm#sf2

After a very brief listen the SoundFont appears a little quiet and low-fidelity, but it includes the full range of instruments, the sounds are well balanced, the file size is relatively small, and it has an open source license. If others agree that it is a good match for MuseScore, I'll include it as the default for Windows.

Not being able to control held-notes/crescendos in MIDI is not entirely true. In older versions of CakeWalk and Finale, you were able to control the volume by adjusting the velocity levels manually. Now, Finale has real time crescendos that adjust them automatically across measures or beats (as marked by how wide you make the crescendo in your score) and if you want, you can still go old school and manipulate the velocities manually. My experience with this was in 2005 before they converted to their new digital symphonic instrument system. After that, their auto-crescendo system was smart enough that I had no need to edit them manually (and the pieces I was arranging for classes or personal composition didn't need the playback to be THAT precise as I'm not publishing, yet).

Not being a coder, how I would go about installing the Timidity files so that I could use them, if need be?

The problems with MIDI are that musical sounds are composed of 4 parts- attack, duration, ending, and space. Where brass instruments have been a long-time problem for MIDI as the attack stage of the sound is not easy to replicate in digital format and make it sound like someone is actually tonguing into a brass mouthpiece. Woodwinds go next in line for difficulty of replicating proper attack (and some woodwinds- like the double reeds- are harder than others to replicate), then strings. Percussion is it's own category. Also, replicating the proper ending and space in between notes depending on the style has always been a challenge of MIDI. But, newer versions of programs like Finale and Sibelius are improving on all of these issues (slowly, but surely) with each new release, making MIDI a more viable option than it ever has been before. Also, the type of MIDI keyboard you use can make a difference, too. Many come with pre-loaded voices (the Korg that my school has is VERY nice; I think it has over 3,000 different voices) that can be imported into some programs (I think it was Cakewalk on Mac that allowed us to do that). So, you guys have a lot of options open to you as far as what you choose to do with MuseScore for MIDI input/output.

I like the direction MuseScore is going thus far, but can't wait to see it get to the place of being able to compete with Finale and Sibelius. It will force these giants to overhaul their software. It seems like they want to make us pay 100's of dollars for small tweaks on year-to-year updates, while only giving us vast improvements or overhauls every 5 years or so. That's not worth my money to keep updating. Even though I know it's open source, I would still be willing to pay for this program- as long as it continue to be updated as often as it currently seems to be- once it's into a 2.0 version or better. Sorry if that's off topic, anywho, back to the regularly scheduled program....

* In my discussion on the four parts of the sound, I meant to use the term "release" instead of "ending". I couldn't think of the proper term at the time.

Thanks for your responses in both of the forums I posted in. The info was very helpful! I don't know why I didn't think about the + sign- that's the same command in Finale- DUH! lol Thanks, guys!!

Title Improve user experience on Windows for playback without having to install a soundfont Improve user experience on Windows for playback with a complete soundfont

Some terrific news from the TimGM6mb.sf2 soundfont creator (Tim Brechbill):
"Yes the soundfont is mine and public domain.
You are entitled to use it as you please."

We could use the CC public domain certification to correctly include the soundfont and I'm communicating further with Tim to find out how to attribute him in the release notes.

Status (old) active patch (ready to commit)

Tim came back to me with some more information about the soundfont: "I created some of the samples myself and all others are either public domain or fall under the terms of the GNU General Public License." For me this is enough to add his soundfont to the repository.

We shall attribute him in the 0.9.6 release notes with the following reference:
Tim Brechbill - http://www.timbrechbill.com

Right. I will probably switch the default on Ubuntu to this soundfont*, which as well as being 5% of the size of fluid-soundfont-gm, sounds more agreeable too on these small laptop speakers. Of course, users previously using FluidR3 will continue to do so; fluid-soundfont-gm will be dropped to a Suggests rather than a Depends.

* I will probably still make the change that the soundfont is not included in the mscore executable binary, but installed to /usr/share/sounds/sf2 via a separate package (probably called something like mscore-soundfont-gm or timgm6-soundfont, though). I think this is a better distributive choice, as it makes the soundfont available for other applications, and doesn't make the mscore executable unnecessarily large. Of course, how the preferences are set upstream are up to you; but naturally I would prefer to keep as few Debian-specific patches as possible.

Toby, I do not plan on adding the SoundFont to the mscore executable either. Currently on Windows, it is located at "C:/Program Files/MuseScore 0.9/sound/TimGM6mb.sf2"

Oh, could I just get some clarification on the copyright status? Thomas, you seem to be suggesting that Tim regards the file as "public domain", even though he says it may contain samples which "fall under the terms of the GNU General Public License", in which case it would be helpful to mention that the soundfont is therefore necessarily also under the terms of that licence. Further, could we clarify which version of the licence? For the purposes of the prereleases, I'm assuming version 2.

The response in comment #29 was a clarification after we asked specifically about the audio samples contained in the SoundFont. I think the SoundFont was created in 2004 or earlier so it wouldn't be version 3. Maybe Tim can clarify.

Thanks; it would be helpful if he could clarify. I think we can safely say it's not version 1, so the options to my mind are "v2 only" and "v2 or later". (I find this sort of thing particularly pedantic, especially when the likelihood of a derivative work seems so small, so I'm sorry if it's inconvenient, but it is important to ensure that our software is safely distributable.)

Hi Toby,

I feel stupid I missed the fact that derived work from GPL licensed work, can only be GPL as well.
I'm contacting Tim again to hunt down the GPL version number. Stay tuned.

Status (old) fixed active

This bug is still active and is "preventing" me to release a prerelease. Meaning I would prefer including this bug fix in the prerelease instead of making one just before and one just after.
Can I go ahead and do the necessary changes in the code and include a GPLv2 notice? or the license issue remains?

@newsome yes, it includes drumkit and the other GM instruments.

Tim came back to me and agreed to release his soundfont under GPLv2 knowing it was derived from other GPLv2 soundfonts.

aah, dang it, if only the issue would have been spotted earlier..... could the latest prerelease be replaced with this? :))
Also, I don't know if I should start a new task or feature request thread, but there is an option in MuseScore that I throughly believe needs reconsidering.
As program startup options, MuseScore has amongst other things, the start with new score choice. Shouldn't this feature provide the UI with the panel for starting a new score with title composer and all of that jazz?
I mean, having an empty score that is white looks weird when this choice is made. I have never seen any software has this as a startup feature when it claims to start with a new score/document.
And even worse, the new score seems to be grey in the latest prerelease. Create new score panel should be attached to the appropriate startup feature.

Thanks everyone for the hard work and public benefit you have brought to the whole world!!!!!

The soundFont is included in the prerelease. It just isn't set in the preferences. You can set it yourself. Go to Display > Synthesizer and replace :/data/piano1.sf2 with C:/Program Files/MuseScore 0.9/sound/TimGM6mb.sf2 (or where ever you installed MuseScore).

With regards to new topics it is better to start a new thread. Especially on the issue tracker which is very task oriented.

Status (old) active fixed

@seseberg open a new issue for your request.

The soundfont is in and working. Thanks a lot at lasconic, david & werner!

hola

y has podido lograr en musescore que los sonidos suenen con el ataque natural y no como si todo fuera una especie de cuerda, con ataque lento?