As an example, DOS machines came with a form of BASIC and you had these:
https://en.wikibooks.org/wiki/QBasic/SoundWe had fun in school putting the SOUND command in a loop and either increasing or reducing the Hz to test our hearing and prove that yes, "old people" (such as our teachers who probably weren't much past 30) have terrible ears for higher pitched sounds.