The Medresh says that Moshe said to Hashem "Vaz Chatasee" with the word Az I have sinned and with the word Az I will say Shirah to you. What does the Medresh means when it says Moshe said with the word Az I have sinned to you and with the word Az I will say Shirah to you It a little bit odd.
The midrash is referring to two occurences of the word אז (Az, "then"). In the first, Moshe supposedly sins to G-d:
Exodus 5:23: וּמֵאָז בָּאתִי אֶל-פַּרְעֹה, לְדַבֵּר בִּשְׁמֶךָ, הֵרַע, לָעָם הַזֶּה; וְהַצֵּל לֹא-הִצַּלְתָּ, אֶת-עַמֶּךָ.
"For since I came to Pharaoh to speak in thy name, he hath done evil to this people; neither hast thou delivered thy people at all."
and in the second he praises (says Shira):
Exodus 15:1: אָז יָשִׁיר-מֹשֶׁה וּבְנֵי יִשְׂרָאֵל אֶת-הַשִּׁירָה הַזֹּאת ...