Another interpretation of (Exodus 15:1): "Then (az) Moses sang." This is what Scripture says (Psalms 40:2): "I waited eagerly for the LORD," and so forth. Rabbi Pinhas the Priest bar Hama said: If you have waited and He has not come, wait again. David said (Psalms 27:14): "Hope in the LORD; be strong and let your heart take courage, and hope in the LORD." If your hope has come, well and good; if not, hope in the LORD again. And David said: "I waited eagerly for the LORD." Out of the waiting, (Psalms 40:2): "He inclined to me and heard my cry." (Exodus 2:24): "And God heard their groaning," and so forth. (Psalms 40:3): "He brought me up out of the roaring pit, out of the miry clay," and so forth — out of the clay of the bricks. (Psalms 40:3): "And He set my feet upon a rock" — in that He gave me the spoil of Egypt and the spoil of the sea. (He made my steps firm.) (Psalms 40:4): "And He put a new song in my mouth" — "Then Moses sang," and so forth. What is "Then" (az)? With "az" the Holy One, blessed be He, made the dry land into sea for the generation of Enosh, as it is said (Genesis 4:26): "Then (az) it was begun to call upon the name of the LORD." But for us He made the sea into dry land; with "az" we praise Him.
Why Moses Began the Song of the Sea With the Word Az
Midrash Tanchuma Buber, Beshalach 12:1
ד"א [אז ישיר משה]. זש"ה קוה קויתי ה' וגו' (תהלים מ ב), אמר ' פנחס הכהן בר חמא אם קויתה ולא באח זורוקוה, אמר דוד קוה אל ה' [חזק ויאמץ לבך וקוה אל ה'] (תהלים כז יד), אם בא קויך יפה, אם לאו חזור וקוה אל ה', ואמר דוד קוה קויתי אל ה', מתוך הקיווי ויט אלי וישמע שועתי (שם מ ב). וישמע אלהים אתל נאקתם וגו' (שמות ב כד), ויעלני מבור שאון מטיט היון וגו' (תהלים שם ג), מטיט לבינים, ויקם על סלע רגלי (שם), שנתן לי בזת מצרים ובזת הים, (כונן אשורי), ויתן בפי שיר חדש (שם שם ד), אז ישיר משה וגו'. מהו אז, באז עשה הקב"ה לדורו של אנוש היבשה ים, שנאמר אז הוחל לקרא בשם ה' (בראשית ד כו). ולנו עשה הים יבשה, באז אנו מקלסין אותו.