Skip to content

Standardize tune description format #28

@fulldecent

Description

@fulldecent

We should have a common format for describing tunes (series of beeps) across the different implementations in this repository. Extensive searching was done, a simple widespread standard was not found.

Following is proposed:

  1. Simple text file
  2. Each line represents a beep or a pause
    1. Column one is a positive integer number of milliseconds
    2. Column two is a positive integer frequency in Hz, or 0 which represents silence
    3. Columns are separated by a space
  3. Line ending is unix format (\n, but \r\n should not cause an error when reading file)
  4. File extension is .tune
  5. Consider adding a silence at the end so that looped playback sounds good :-)

Example for mary_had_a_little_lamb.tune:

400 2673
400 2349
400 2093
400 2349
400 2673
400 2673
790 2673
400 2349
400 2349
790 2349
400 2673
400 3136
790 3136
400 2673
400 2349
400 2093
400 2349
400 2673
400 2673
400 2673
400 2673
400 2349
400 2349
400 2673
400 2349
790 2093
400 0    

Work plan:

  • Convert existing tunes into this format, save to tunes/ folder
  • Update each implementation to accept a .tune file on the command line / stdin or however else
    • Using _mm_stream_si128
    • Using counter and threads
    • In Javascript
  • Update run instructions so users know to supply the song file

Related: #1

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions