-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Get MuseScore's source code
- Create projects folder
- Fork MuseScore's repository
- Clone the repository
- Running subsequent commands
- Adding required dependencies
You must have Git installed on your computer (see Set up Developer Environment).
Before you download any source code, it's a good idea to create a folder called Projects
or src
that you can use to store all source code projects on your machine.
General advice:
- Make sure the projects folder is located on a modern filesystem that is native to your operating system (NTFS for Windows, APFS for macOS, BTRFS or EXT4 for Linux).
- Don't try to share the same project folder between different operating systems (e.g. Windows, macOS, Linux) as this can cause corruptions.
- Sharing between different versions of the same operating system should be OK, including different Linux distros, providing a similar version of Git is used on each.
- Avoid having spaces, special characters, or non-ASCII characters in any component of the project folder's file path.
- These characters make life difficult on the command line, and may cause errors during compilation.
- Make sure you have read and write permission to this location.
- Never use
sudo
or "Run as administrator" privileges when compiling code.
- Never use
- Don't put Git repositories in a location that is backed up or synced by other software (e.g. Dropbox, OneDrive, syncthing, etc.).
- Instead, make commits regularly and push them to a remote repository (your fork) to create a backup.
Linux and macOS
You could create the projects folder inside your Home directory:
cd ~ # change (go) to your home directory
mkdir src # create new directory for source projects
Windows
Create the projects folder at the root of an NTFS-formatted drive, such as your C:
drive:
# change (go) to the C: drive's root directory
cd C:\ # PowerShell or CMD
cd /c # Git Bash
# create new directory for source projects
mkdir src
Windows has a 260 character limit on the total length of any file path so it's best to keep code projects near the root of the drive to reduce the likelihood of any files going over the limit. You're most likely to encounter the limit when compiling because paths in the build folder can get very long.
You can skip this step if you never plan to edit MuseScore's source code (i.e. you just want to compile it).
A 'fork' is an online (remote) copy of a repository. After it has been made, the fork can be edited without affecting the original repository.
You must make a fork if you want to edit MuseScore's code, even if you plan to contribute your changes back to the official repository.
To create a fork:
- Sign-in to GitHub (create a free account if necessary).
- Visit MuseScore's official repository page: https://github.com/musescore/MuseScore
- 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).
A clone is an offline (local) copy of a repository. It is basically a folder on your computer that contains the code for you to edit and/or compile.
If you made a fork then you should clone that, otherwise clone the official repository.
# Change to the directory you use for source code projects, such as:
cd ~/src # Linux and macOS
cd C:\src # Windows - PowerShell or CMD
cd /c/src # Windows - Git Bash
# Everybody should run these commands:
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][Fork MuseScore's repository (optional)] then you should use musescore
as the username.
Tip: If you did make a fork, consider using its SSH URL [email protected]:[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!
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.
For Windows, download the required dependencies here. After you extract the contents, put it inside the MuseScore
folder, between the other folders such as assets
, share
, src
, etc. If you followed the earlier instructions exactly, it will be located at ~/src/MuseScore
. Additionally, to prevent certain compilation errors, you may need to download and install a recent version of Windows SDK:
- either select it in the Visual Studio Installer by "modifying your installation" (for example, select version 10.0.22621 or newer)
- or download it separately from https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/, but for some people the installer from this website doesn't seem to do anything.
After installing this SDK, you may need to restart your computer before the new one gets picked up by all tools.
You need to install libsndfile
:
brew install libsndfile
You need to install libsndfile
:
# (one of these, as appropriate for your OS)
sudo apt-get install libsndfile1-dev
sudo dnf install libsndfile-devel
sudo pacman -S libsndfile
Ubuntu 22.04 does not include the packaging reference for libssl1.1, download the appropriate version from http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/?C=M;O=D and install it with dpkg
For example:
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.17_amd64.deb
Testing
- Manual testing
- Automatic testing
Translation
Compilation
- Set up developer environment
- Install Qt and Qt Creator
- Get MuseScore's source code
- Install dependencies
- Compile on the command line
- Compile in Qt Creator
Beyond compiling
Misc. development
Architecture general
- Architecture overview
- AppShell
- Modularity
- Interact workflow
- Channels and Notifications
- Settings and Configuration
- Error handling
- Launcher and Interactive
- Keyboard Navigation
Audio
Engraving
- Style settings
- Working with style files
- Style parameter changes for 4.0
- Style parameter changes for 4.1
- Style parameter changes for 4.2
- Style parameter changes for 4.3
- Style parameter changes for 4.4
Extensions
- Extensions overview
- Manifest
- Forms
- Macros
- Api
- Legacy plugin API
Google Summer of Code
References