What is the general process?
- Met Office share 3-hourly site-specific forecast data via a service called DataPoint.
- After the user selects a location, Wav4kst retrieves the forecast data in XML format and assigns it to different PHP arrays.
- Each array is then mapped to the sound synthesis engine.
- The sounds are compiled and played back in the web browser.
What data do you use?
DataPoint offer an extensive choice of data, however currently Wav4kst only makes use of a tiny portion of it.
- Feels Like Temperature defines the pitch of both the melody and the bassline.
- Humidity defines if the next bass note should be played or if the current note should be held instead. (i.e. if the humidity is over 80% then change note).
- Weather Type defines what kind of outro effect their should be at the end of the piece. (not quite a finished feature yet, but nearly!)
How do you translate the mapped data into sound?
- Wav4kst has a series of pre-recorded audio samples on different instruments at different pitches.
- Using PHP fOpen, Wav4kst compiles all of the audio files together into one single ‘.wav’ file.