A module with routines for data sonification.
Convert an array of reals to a WAV file, using RATE samples per second (44,100 by default). - If your signal is not centered around zero, you can use the autocenter option. - Downsampling allows to take only each Mth sample and can be used to make a low tone higher. - The repetitions argument allows to repeat the signal N times, which can be interesting if it is too short.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | signal | ||
character(len=*), | intent(in) | :: | output_file | |||
logical, | intent(in), | optional | :: | autocenter | ||
integer, | intent(in), | optional | :: | downsampling | ||
integer, | intent(in), | optional | :: | repetitions |
Read a text file containing only one column of reals, without header, and convert it to a WAV file. If your file contains several fields (columns), you must extract the field to sonify. In Unix-like systems, it can be easily done, for example: $ cut -f 4 -d " " data.txt > column.txt The file should contain several 100,000 lines as the WAV will use generally 44,100 samples per second. - If your signal is not centered around zero, you can use the autocenter option. - Downsampling allows to take only each Mth sample and can be used to make a low tone higher. - The repetitions argument allows to repeat the signal N times, which can be interesting if it is too short.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | input_file | |||
character(len=*), | intent(in), | optional | :: | output_file | ||
logical, | intent(in), | optional | :: | autocenter | ||
integer, | intent(in), | optional | :: | downsampling | ||
integer, | intent(in), | optional | :: | repetitions |