Completely agree. Apple allows educational programming because it doesn’t seriously jeaopardize their revenue. If they let you compile and run arbitrary code (I bet they already have this capability for debugging internally) with full system access, without jumping through major hoops, they wouldn’t be able to tax that activity.
For me depression comes when I have low amounts of energy, which I've since realized is affected by my nutrition. If I eat too many carbs or sugar, I get extremely fatigued and then get depressed. It also causes me to daydream and have a hard time concentrating. Maybe keep a close eye on what you're eating/drinking and see if it's related.
I haven't worked on it in a while, but you might like textbeat (https://github.com/flipcoder/textbeat). It's a midi tracker and REPL that lets you type in music theory-like terminology and plays it. It's nowhere near a modern DAW but it's cool for tinkering and learning.
I own a LinnStrument and it's fantastic. I created a custom note layout for it to make it easier to play: https://github.com/flipcoder/linnstrument-wholetone. The firmware is also open source. It feels like the Linux of instruments.
https://store.steampowered.com/app/397430/Zoombinis/