How do I play a specific song on a command block without it playing other songs instead? [duplicate]

The reason for the game randomly picking a song from the list, was because they were grouped together in a specific file. Now that I've found out how to find and change the file, (Credit To North_Kozar's Post On The Minecraft Forums) I'll explain all the necessary steps. (This is for the newer versions of minecraft that separate files into 256 different folders)

  1. Find sounds.json

To do this, you must go to ".minecraft\assets\indexes" and open the file that has the name of the game version you're using your resource pack with. If your version isn't listed, open the closest version below it. I use 1.12.2, so I chose 1.12.

After you've opened it in whatever-program-you-use-that-can-edit-json-files (I prefer Notepad++), press the CTRL key and the F key at the same time to open a find prompt.

Once the find prompt is open, type "sounds.json" into the box, and click enter. There should only be one match, which should say ""minecraft/sounds.json"", and the next line under should say ""hash":" and then a line of letters and numbers.

    "minecraft/sounds.json": {
      "hash": "975a99ed9870f51bbae348533d775d730e3fee18",
      "size": 105658

Remember the first 2 characters in that string of letters and numbers. Don't close the index file yet, though, you'll need the whole string soon.

  1. Get sounds.json

Now, go to ".minecraft\assets\objects". You should see a list of 256 folders labeled with 2 characters each. Find the folder that has the same 2 characters as the first 2 characters of the hash you remembered, and open it. I remembered 97, so I went to the folder named 97.

In the folder, you should see a number of generic files with long strings of letters and numbers for names. They all start with the same 2 characters as the folder name. Find the file that matches the string you found for sounds.json in the index file you opened earlier, and copy paste it into your resource pack's minecraft folder. Specifically, ".minecraft\resourcepacks\"Your Resource Pack"\assets\minecraft". The hash I found for sounds.json was 975a99ed9870f51bbae348533d775d730e3fee18, so I moved the file with the same name.

  1. Edit sounds.json

Rename the file you moved to "sounds.json", and make sure that it turns into a json file instead of staying a generic file. Open the file, and find (with CTRL+F) the song you want to be able to call on. To use my original example, let's say I wanted to play nuance1 with a single command. This is what the area of the file that contains nuance1 looks like.

,
  "music.game": {
    "sounds": [
      {
        "name": "music/game/calm1",
        "stream": true
      },
      {
        "name": "music/game/calm2",
        "stream": true
      },
      {
        "name": "music/game/calm3",
        "stream": true
      },
      {
        "name": "music/game/hal1",
        "stream": true
      },
      {
        "name": "music/game/hal2",
        "stream": true
      },
      {
        "name": "music/game/hal3",
        "stream": true
      },
      {
        "name": "music/game/hal4",
        "stream": true
      },
      {
        "name": "music/game/nuance1",
        "stream": true
      },
      {
        "name": "music/game/nuance2",
        "stream": true
      },
      {
        "name": "music/game/piano1",
        "stream": true
      },
      {
        "name": "music/game/piano2",
        "stream": true
      },
      {
        "name": "music/game/piano3",
        "stream": true
      }
    ]
  }

First, delete all the entries that aren't the song you want. You should now have something like this:

,
  "music.game": {
    "sounds": [
      {
        "name": "music/game/nuance1",
        "stream": true
      }
    ]
  }

Note that there's a comma at the beginning. This comma comes right after the closing curly bracket from the previous sound name, to tell the computer that it's starting a new item in the list.

After the comma, we have the first part of the command you use to play the song. This is usually the genre folder name. Minecraft has different ones that range from "music" to "entity" to "ambient", but in this example, I used music. Next is the second part of the command. This is usually the specific folder the songs are in. Nuance1 is in the "game" folder, along with a lot of other files, and since they are all grouped together here, one is chosen at random when you ask the game to play "music.game". Since we'll be making a new group just for nuance1, we can replace this part with anything else, as long as it isn't already taken (So "music.pickles" would work, but not "music.dragon", because that's already taken). I usually name it whatever the song's name is, so this part is now "music.nuance1".

After that, there is an open curly bracket, an open regular bracket, another open curly bracket, and then a path to the specific song. For nuance1, it would be "music\game\nuance1". Finally, we have a closing curly bracket, a closing regular bracket, and another closing curly bracket to compliment the previous open ones. These have to be in reverse order, by the way, so if the open sequence was { { [ {, then the closing sequence has to be } ] } }. Now, after filling in the blanks with your new info for your song, the text should look something like this.

,
  "music.nuance1": {
    "sounds": [
      {
        "name": "music/game/nuance1",
        "stream": true
      }
    ]
  }

Now copy it, and undo until you have the unedited original sounds.json file. Then, if you don't want your chosen song to be played at random with the others, delete the part of the code that refers to it, which looks something like this:

,
      {
        "name": "music/game/nuance1",
        "stream": true
      }

Then paste your new code at exactly between the final closing curly bracket of a group entry, and the beginning comma that comes right after it.

    ]
  }Paste-It-Right-Here,
  "music.game": {

Make sure all the the open brackets meet up with their closed counterparts in the right places, and that the commas are placed correctly, then save the file.

  1. Test

Open Minecraft, go into a world, select your resource pack, and type this command into the console.

/playsound minecraft:p1.p2 block name

p1 and p2 are the parts of the command that I decided earlier in my example. They were "music", and, "nuance1". name is just your username, so for this example, my command is:

/playsound minecraft:music.nuance1 block Noevon

Run the command, and if the correct sound or song plays, that means you've done it correctly.

Again, thank you to North_Kozar for their guide on how to add new music to Minecraft. I never would have found this out without it.