sonification Module

A module with routines for data sonification.


Uses

  • module~~sonification~~UsesGraph module~sonification sonification module~forsynth forsynth module~sonification->module~forsynth module~wav_file_class wav_file_class module~sonification->module~wav_file_class iso_fortran_env iso_fortran_env module~forsynth->iso_fortran_env module~wav_file_class->module~forsynth module~wav_file_class->iso_fortran_env module~tape_recorder_class tape_recorder_class module~wav_file_class->module~tape_recorder_class module~tape_recorder_class->module~forsynth

Used by

  • module~~sonification~~UsedByGraph module~sonification sonification program~sonify sonify program~sonify->module~sonification

Subroutines

public subroutine sonify_from_array(signal, output_file, autocenter, downsampling, repetitions)

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.

Arguments

Type IntentOptional 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

public subroutine sonify_from_file(input_file, output_file, autocenter, downsampling, 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.

Arguments

Type IntentOptional 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