Skip to content

Get MuseScore's source code

Hemant Antony edited this page Jan 10, 2022 · 18 revisions

Summary

  1. Fork MuseScore's repository (optional)
  2. Clone the repository
  3. Running subsequent commands
  4. Adding required dependencies

You must have Git installed on your computer (see Set up Developer Environment).

Fork MuseScore's repository (optional)

You can skip this step if you never plan to edit MuseScore's source code (you just want to compile it).

A fork is an online (remote) copy of a repository which can be different to the original (unlike a mirror which is the same as the original). You must make a fork if you want to edit the code, even if you plan to contribute your changes back to the official repository.

  1. Sign-in to GitHub (create a free account if necessary).
  2. Visit the official repository's page: https://github.com/musescore/MuseScore
  3. Click the "Fork" button in the top right to create your personal fork.

Your fork exists at https://github.com/[USERNAME]/MuseScore where [USERNAME] is your GitHub username (e.g. shoogle's fork is here).

Clone the repository

A clone is an offline (local) copy of a repository. If you made a fork then you should clone that, otherwise clone the official repository.

# Everybody should run these commands:
cd ~                # change (go) to your home directory
mkdir src           # create new directory for source repos
cd src              # change to the new directory
git clone https://github.com/[USERNAME]/MuseScore # add username to this command (see below)
cd MuseScore        # change to the MuseScore directory

# Run these only if you made a fork:
git remote add upstream https://github.com/musescore/MuseScore.git
git remote set-url upstream --push disabled # prevent accidental push to official repo (team members only)

# Run this only if you didn't make a fork:
git remote set-url origin --push disabled # prevent accidental push to official repo (team members only)

Replace [USERNAME] with your GitHub username in the git clone command. If you skipped the Fork step then you should use musescore as the username.

Tip: If you did make a fork, consider using its SSH URL git@github.com:[USERNAME]/MuseScore.git instead of the HTTPS URL with the git clone command. This requires additional setup, but it means that you don't have to enter your password every time you push code changes to GitHub.

Important information for multi-boot users: Git uses low-level system calls to increase filesystem performance. Always store Git repositories on a filesystem that is native to your operating system (NTFS for Windows, APFS for macOS, BTRFS or EXT4 for Linux). Do not attempt to use a single repository instance with multiple operating systems as doing so decreases Git performance and may lead to data corruptions. You have been warned!

Running subsequent commands

Commands on subsequent pages of the compilation guide start from inside your local copy of MuseScore's repository. Use the following command to get there:

cd ~/src/MuseScore  # or wherever you cloned the repo

You'll need to do this every time you open a new terminal window or use the cd command to move away from MuseScore's directory.

Adding required dependencies

For Windows, download the required dependencies here. After you extract the contents, put it inside the MuseScore folder with other folders such as assets, share, src, etc. If you followed the earlier instructions exactly, it will be located at ~/src/MuseScore

Testing

Translation

Compilation

  1. Set up developer environment
  2. Install Qt and Qt Creator
  3. Get MuseScore's source code
  4. Install dependencies
  5. Compile on the command line
  6. Compile in Qt Creator

Beyond compiling

  1. Find your way around the code
  2. Submit a Pull Request
  3. Fix the CI checks

Misc. development

Architecture general

Audio

Engraving

Extensions

Google Summer of Code

References

Clone this wiki locally