Skip to main content

Convert GeoTIFF elevation data to wavetable files for synthesizers

Project description

GeoTIFF to wavetable converter

This is a utility to convert GeoTIFF files to wavetable files (.wt) for use in synthesizers.

I've never worked with GeoTIFF and my wavetable experience is limited. Huge shout-out to both okwt and surge for their helpful implementations.

If you'd like to help or if you've noticed some issues, please see the CONTRIBUTING guide for information about how to go forward.

Usage

For these examples, we'll use a GeoTIFF of the Oro Valley in Arizona (examples/USGS_1_n33w111_20240401.tif). There's also a GeoTIFF of the lower Colorado river in there for you to check out. For more geospatial data, check out the sources below.

The tool automatically:

  • Replaces nodata values (like -999999) with the mean elevation
  • Resizes your terrain to valid dimensions (width: power of 2 between 2–4096, height: max 512)
  • Normalizes elevation values to audio range (-32768 to 32767 for int16 format)

Basic conversion

Convert a GeoTIFF file to a wavetable:

geotiff-to-wavetable examples/USGS_1_n33w111_20240401.tif

This creates examples/USGS_1_n33w111_20240401.wt (in the same directory as your input file). The tool will automatically handle nodata values (like oceans or missing data) and resize your terrain to valid wavetable dimensions.

Options

Usage info:

geotiff-to-wavetable -h

Specify an output file:

geotiff-to-wavetable examples/USGS_1_n33w111_20240401.tif -o output.wt

Select a specific band (if your GeoTIFF has multiple bands):

geotiff-to-wavetable examples/USGS_1_n33w111_20240401.tif -b 2

Most elevation data only has one band, so you won't need this option. Use -i to see how many bands your file has.

View file information (bands, width, height):

geotiff-to-wavetable examples/USGS_1_n33w111_20240401.tif -i

Visualize the data before converting:

View the default band:

geotiff-to-wavetable examples/USGS_1_n33w111_20240401.tif -v

View a specific band:

geotiff-to-wavetable examples/USGS_1_n33w111_20240401.tif -b 2 -v

This opens a plot showing your elevation data. It's a helpful first step to make sure Python can read your file and that it contains the terrain you expect. If it doesn't look right, make sure to check how many bands there are (-i) and then view the other bands.

Importing into Bitwig

Bitwig expects files to be in ~/Documents/Bitwig Studio/Library, so copy your file into that directory and then you can source it from Bitwig's wavetable.

To validate that the file is available in Bitwig, copy the file to the Bitwig Library:

cp /path/to/your/file.wt ~/Documents/Bitwig\ Studio/Library

Then, in Bitwig:

  • Create a new Instrument and add Polymer to it.
  • Change your Oscillator to "Wavetable" and click on the wavetable.
  • This will bring up the Wavetables selector. On the left, click "My Library" and you should see your wavetable there.

You can also drag your wavetable file into the wavetable part of the oscillator.

Finding geospatial data

Here are some sources for dense GeoTIFF data:

  1. USGS Elevation
    • Filter by: GeoTIFF, Elevation Products (DEM)
    • Choose interesting terrain: mountains, canyons, volcanoes
    • 1-arc-second resolution is good
  2. OpenTopography
    • High-resolution LiDAR elevation data
    • Great for detailed terrain
    • Requires free account
  3. SRTM (Shuttle Radar Topography Mission)
    • Global elevation data, 30m resolution
    • Has an easy browser
    • Download tiles covering interesting places
  4. NASA ASTER GDEM
    • Global elevation
    • Higher resolution than SRTM

💡 Pro tips

  • Avoid: Ocean/water data, cloud/atmospheric data, sparse measurements
  • Look for: Elevation (DEM), bathymetry, land surface temperature
  • Interesting terrain: Iceland volcanoes, Grand Canyon, Himalayas, Hawaiian islands

An example of getting a GeoTIFF from USGS

  1. Go to their site
  2. Zoom in on an area or search (upper right of the map). I have found that larger areas work better for finding results and then you can scroll through until you see something interesting.
  3. On the left, you should be in the Datasets tab. Select "Elevation Source Data (3DEP) - Lidar, IfSAR". Within that, you can select File Formats "TIFF" (I want to add LiDAR support in a future update)
  4. You might need to scroll up. Click the "🔍 Search Products" button. This will bring you to the Products tab.
  5. You can now scroll through the available images. If nothing returns, try increasing your area. For example, I couldn't find anything for Kauai. I zoomed out and couldn't find anything for the Hawaiian Islands. So I zoomed out and got stuff for the Aleutian Islands (copyright is commercial for Alaska which is why we're using Arizona for our examples/).
  6. Find something that looks interesting and click the "Download Link (TIF)" link (it might be "Download Link (ZIP)" and then you'll need to unzip and might have multiple TIFs to play around with).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geotiff_to_wavetable-0.1.1.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geotiff_to_wavetable-0.1.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file geotiff_to_wavetable-0.1.1.tar.gz.

File metadata

  • Download URL: geotiff_to_wavetable-0.1.1.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for geotiff_to_wavetable-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a4a846173d8811a85376cd90723a051ce0bf892bd86c8ffcf7936fbbed09ac5c
MD5 428fea9d5ffb4c32a2344acfeca18296
BLAKE2b-256 bce03ae83bf04cccdb5987d3510d6b74f14c21d3d5798a71adae9f2af2caa269

See more details on using hashes here.

File details

Details for the file geotiff_to_wavetable-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for geotiff_to_wavetable-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47c49ba2e897585e4905fc1bd94626acc8a46c4c98f0132a99f78dfa64b82529
MD5 036ef47af26035b91ba7677e3e55a6e6
BLAKE2b-256 dda2ad42fb9ff88a8ade2e2c34a11ec04b446f75b7ad655588ad4e5cc1209a50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page