MCPcopy Create free account
hub / github.com/TheWaveWarden/odin2 / writeScaleFactorsToFile

Method writeScaleFactorsToFile

Source/Utilities.cpp:896–918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

894}
895
896void Utilities::writeScaleFactorsToFile() {
897 std::ofstream file;
898 file.open("E:\\odin\\scaleFactors.h");
899
900 for (int wt = 0; wt < NUMBER_OF_WAVETABLES; ++wt) {
901 float max = 0.f;
902
903 for (int sub = 0; sub < SUBTABLES_PER_WAVETABLE; ++sub) {
904 float const *next_table = m_wavetable_pointers[wt][sub];
905 for (int pos = 0; pos < WAVETABLE_LENGTH; ++pos) {
906 if (fabs(next_table[pos]) > max) {
907 max = fabs(next_table[pos]);
908 }
909 }
910 }
911
912 file << "m_fourier_coeffs[WT_NR][1][0] = " << 1.f / max * 0.99f * m_fourier_coeffs[wt][1][0] << "; //"
913 << m_wavetable_names_1D[wt] << " scalar\n";
914 file << "max was " << max << "\n";
915 }
916
917 file.close();
918}
919
920void Utilities::loadWavetablesFromConstData() {
921

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected