In the 1980s we had home computers with Microsoft BASIC interpreters that had a "PLAY" command where you could type notes and other musical instructions as text. The system is called MML, Music Macro Language and it has its roots all the way back in the 1970s: https://en.wikipedia.org/wiki/Music_Macro_Language
According to the Wikipedia page, some smartphones have used MML for ringtones.
In its simplest form, you only type note names. Here's an example of how it works on a 1980s home computer with Microsoft BASIC:
MML is somewhat alive even today, and there are applications which allow editing and playing MML.
A command reference is available at MSX.org
If you select a machine that has an FM expansion (which I think you'll get as default), you can say call music and then play #2, "your notes here". The FM sounds are nicer than the older square wave generator, and you can even have drums. Or "drums".
play #2, "o5cdeccdecefggefgg", "o3cgcccgcccdeccdec"
MML might be an interesting perspective to add in musical education. There's no instrument in the traditional sense, and there's no traditional musical notation either, just note names and lengths, and for polyphonic music you have to divide the notes into voices.