Generating the Sound

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.

The Script

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:

FrequencyParticipation XParticipation YParticipation Z
Mode 1: 493.9 Hz0.00000211412.61722890.000000597
Mode 2: 527.4 Hz0.0304732820.0009404630.000000345
Mode 3: 1898 Hz0.0000010937.58791690.000035183
Mode 4: 2764 Hz0.1174490670.0000675490.000000024
Mode 5: 2977 Hz0.0000002710.0000854610.045963418
Mode 6: 4299 Hz0.0000941730.0583999090.000035879
Mode 7: 4515 Hz0.0000060873.5642650.001703042
Mode 8: 4520 Hz0.0001291986.310288610.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.

Usage

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.