This page covers the script that parses the output modal-analysis data table. In addition, this script outputs audo to both the soundcard and a .wav file. First, this document will include an overview of what the script is actually doing. Then, a quick set of shell commands is presented. These commands can be executed to convert any modal analysis data table to a sound wave.
First, the data table from the previous section is parsed. Each row of this table includes the modal frequency, and three columns representing a participation in the x, y, and z directions. The parser determines the length of the three-dimensional vector to produce a table of frequency-loudness pairs. The following is the example data table from the previous experiment:
Frequency | Participation X | Participation Y | Participation Z |
---|---|---|---|
Mode 1: 493.9 Hz | 0.000002114 | 12.6172289 | 0.000000597 |
Mode 2: 527.4 Hz | 0.030473282 | 0.000940463 | 0.000000345 |
Mode 3: 1898 Hz | 0.00000109 | 37.5879169 | 0.000035183 |
Mode 4: 2764 Hz | 0.117449067 | 0.000067549 | 0.000000024 |
Mode 5: 2977 Hz | 0.000000271 | 0.000085461 | 0.045963418 |
Mode 6: 4299 Hz | 0.000094173 | 0.058399909 | 0.000035879 |
Mode 7: 4515 Hz | 0.000006087 | 3.564265 | 0.001703042 |
Mode 8: 4520 Hz | 0.000129198 | 6.31028861 | 0.000835501 |
Then, the loudness values are normalized. The resulting amplitude column of the output should have a sum close to 1.0. Finally, a harmonic serries of sine waves is assembled and output to both the soundcard and the filesystem (as a .wav file). The code can be found here.
To run the script:
$ git clone https://github.com/OldGregg570/physical-modelling-synthesis.git
$ cd physical-modelling-synthesis
$ python src/table-parser.py sample_data/sample_data
To use your own data table, replace the "sample_data/sample_data" portion with a path to
your file. Using this table, the following sound
is produced.