Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

other instruments ? #4

Closed
moodymudskipper opened this issue Apr 9, 2021 · 2 comments
Closed

other instruments ? #4

moodymudskipper opened this issue Apr 9, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@moodymudskipper
Copy link

Thanks for this package, I had fun with it all evening.

Is it possible to hear another instrument than the piano ?
I have looked at all function arguments but haven't found a way.

If it's not possible as is, could you indicate me where this is set in the code so I can find a way to hack it for myself ?

@flujoo flujoo added the enhancement New feature or request label Apr 9, 2021
@flujoo
Copy link
Owner

flujoo commented Apr 9, 2021

@moodymudskipper It's great you had fun!

This will be Implemented in the next minor version. If you still want to hack it:

  1. https://en.wikipedia.org/wiki/General_MIDI#Program_change_events lists the MIDI numbers corresponding to the default instruments.

  2. Make sure that you use the default virtual instruments library or SoundFont MuseScore_General.sf3. See https://musescore.org/en/handbook/3/soundfonts-and-sfz-files.

  3. The related MusicXML element:

<score-part id="P1">
  <part-name>Piccolo</part-name>
  <part-abbreviation>Picc.</part-abbreviation>
  <score-instrument id="P1-I1">
    <instrument-name></instrument-name>
  </score-instrument>
  <midi-device id="P1-I1" port="1"></midi-device>
  <midi-instrument id="P1-I1">
    <midi-channel>1</midi-channel>
    <midi-program>1</midi-program>
    <volume>78.7402</volume>
    <pan>0</pan>
  </midi-instrument>
</score-part>

In the MusicXML file, each part has it own score-part element, you can change the MIDI number in <midi-program>1</midi-program> to change its instrument. In my experience with MuseScore, <instrument-name></instrument-name> should be empty.

  1. In R/show.R, you may want to hack Score() and to_Score() to add $instruments component, and in to_Element.Score() add some code to convert $instruments to internal Element object (see Element.R), which is used to represent MusicXML.

@moodymudskipper
Copy link
Author

Many thanks for the fast and detailed answer, I will give it a go!

@flujoo flujoo closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants