Use cpp, add 'gain' arg to mix_sin
Use int32_t instead of float.