When I awoke to a wondrous melody.

Literal

Exquisite's melody [to-に] awaken [when-と].

A classical/poetic fragment, almost certainly a line lifted from a song or poem. 妙なる is the archaic attributive form of 妙 (read たえ, not みょう), surviving only in set expressions like 妙なる調べ ('exquisite melody'). 調べ ('melody') is the literary Japanese word for tune. The sentence-ending と here is temporal — 'when,' 'just as' — and the lack of a main clause is characteristic of lyrical or song-text fragments.