Skip to content

Instantly share code, notes, and snippets.

@sroccaserra
Last active December 23, 2021 01:45
Show Gist options
  • Select an option

  • Save sroccaserra/b99168d5dcddfdfdd060a69042bffde3 to your computer and use it in GitHub Desktop.

Select an option

Save sroccaserra/b99168d5dcddfdfdd060a69042bffde3 to your computer and use it in GitHub Desktop.
Convert 8 bit mono PCM data to json

To display in vega lite for example.

Like in the Amiga Soundtracker samples:

Note: god is for macOs (brew install coreutils). Use plain od command for regular linux systems.

For example, on the Alien pcm file from the original Soundtracker sample pack:

$ god -vAn -td1 -w1 Alien | \
      awk 'BEGIN {print "{\"values\": ["} NR > 1 {printf ", "} {print "{\"x\":"NR-1", \"y\": "$1"}"} END {print "]}"}'

See also:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment