Feeding Metasound Key Info

I am looking to explore a metasound setup for a project and kind of drawing a blank since I am pretty new to metasounds, particularly the synthesis side here.

How can I feed information about a song’s key to my metasound source? Essentially I want to drive the pitch of my synth from the key so the root note and the scale of my BGM.

I explored a few different approaches, and I know the MIDI to frequency node is a crucial one here, but I’m not sure how to keep the synth playing notes in the correct key since each BGM in the project will be different, with different keys, my metasound needs to always start from a particular key and scale to feed my sine wave’s frequency.