error CS1061: 'GameObject' does not contain a definition for 'tune'

I am making a note wheel to help teach music. I change the letters by referencing an array, but this has caused the sharps and flats to not follow the letters. To fix this I am trying to take the sharps and flats from the other letters on the wheel, but I am getting this error:
Assets\Rotate.cs(65,35): error CS1061: ‘GameObject’ does not contain a definition for ‘tune’ and no accessible extension method ‘tune’ accepting a first argument of type ‘GameObject’ could be found (are you missing a using directive or an assembly reference?)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class Rotate : MonoBehaviour
{
    public string display;
    public static int turn;
    public int letter;
    public int tune;
    string[] noteArray = { "D", "E", "F", "G", "A", "B", "C", "D♯", "E♯", "F♯", "G♯",
                           "A♯", "B♯", "C♯", "D♭", "E♭", "F♭", "G♭", "A♭", "B♭", "C♭" };
    public TextMeshProUGUI note;
    public float current = 0;
    public GameObject[] AllNotes;
    public int identify;
    int identification;
    public int nextTune;

    void Start()
    {
        display = noteArray[letter + (7 * tune)];
        note.text = display;
    }

    void Update()
    {
        tune = nextTune;
        if (current == 1)
        {
            turn = 0;
            current = 0;
        }
        if (turn != 0)
        {
            current = current + 1;
            letter = letter - turn;
            if (letter == 7)
            {
                letter = 0;
            }
            if (letter == -1)
            {
                letter = 6;
            }

            identification = identify - turn;
            if (identification == 7)
            {
                identification= 0;
            }
            if (identification == -1)
            {
                identification = 6;
            }
            var noteBefore = AllNotes[identification];
            nextTune = noteBefore.tune;
        }
    }

    public void Retune()
    {
        tune = tune + 1;
        if (tune == 3)
        {
            tune = 0;
        }
        display = noteArray[letter + (7 * tune)];
        note.text = display;
    }
}

I guess this is the part were you’re getting the error:

var noteBefore = AllNotes[identification]; 
nextTune = noteBefore.tune; 

AllNotes is declared as an array of GameObjects

 public GameObject[] AllNotes; 

and GameObjects doesn’t come with a Tune property. Tune is a property set in your Rotate script.
So, assuming you are setting all your GameObjects in AllNotes in the inspector with a Rotate script attached to each of them, you can retrieve their Tune value as:

var noteBefore = AllNotes[identification].GetComponent<Rotate>();
if (noteBefore != null)
    nextTune = noteBefore.tune;

Happy coding.

@Artmarab is right. Though I would highly recommend to just replace your public GameObject[] AllNotes; array with an array of “Rotate” instances. That way you don’t have to call GetComponent each time. Though if you do you have to re-assign your objects once more in the inspector since the type would have changed.

public Rotate[] AllNotes;

I would also recommend to work on your naming. A class called “Rotate” should be responsible for rotating things. However it seems to represent some kind of musical “note”.

Though I’m not sure whatever you try to do here would work the way you want. Each of your “Rotate” instances has the same variables and each Rotate instance has its own Update callback. However the order in which those update callbacks are executed is not really determined. Since you use the state of another Rotate instance inside the Update loop, the behaviour may contain random bugs.

Your usage of the static “turn” variable and the instance variable “current” looks like a really convoluted way to trigger a single execution of that code inside the big “if” on every “note” once. Though the issue with the execution order remains. If you want to execute code just once, you usually pack that code in a method / function and just call it once it’s necessary. Having each of your “Rotate” instances reference each other also seems like a really weird setup. Your logic could most likely be made much more simple when you have one extra script that actually handles the execution of the event going through the list of notes and do whatever necessary to that note in the particular order you set them up in the array.

Though we can only make wild guesses here since we don’t know what this code is supposed to do. I just see tons of potential issues.