A series of shock recovery experiments up to ~50 GPa were performed on reactions to form carbon nitrides. Nitrogen-rich starting materials, included a C-N-O amorphous precursor, dicyandiamide, melamine, and a mixture of carbon tetrahalide and sodium dicyanoamide, were used and the recovered samples were investigated by X-ray diffraction technique, elemental analysis, transmission electron microscopy and so on. Experimental results showed formation of a new carbon nitride, high stability of melamine up to a shock pressure of 37 GPa, and production of amorphous C-N materials with a highest N/C ration of 1.26 from the reaction between carbon tetrahalide and sodium dicyanoamide. We extended to the system C3N4-Si3N4 based on the recent results on synthesis of spinel-type nitrides. Shock wave chemical reactions provide a route for synthesizing novel materials including not only high-pressure phases but also metastable, unique substances.