Method which converts the object instance and its attributes to a string of lilypond code

        :return: str of lilypond code

def toLily(self):
        '''
        Method which converts the object instance and its attributes to a string of lilypond code

        :return: str of lilypond code
        '''
        val = "\clef "
        clef = ""
        if hasattr(self, "sign") and self.sign is not None:
            key = self.sign.upper()
            if key == "TAB":
                return "\clef moderntab"
            if hasattr(self, "line") and self.line is not None:
                key += str(self.line)
            if key in clef_type:
                clef = clef_type[key]
            else:
                val = ""
        else:
            val = ""
        if hasattr(self, "octave_change") and self.octave_change is not None:
            options = {1: "^8", 2: "^15", -1: "_8", -2: "_15"}
            if self.octave_change in options:
                clef = "\"" + clef + options[self.octave_change] + "\""
        val += clef
        return val