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.

Yes, this is an absolutely wild idea and I don't even know if it's going to work. I've never worked with GeoTIFF and my wavetable experience is limited. We can totally figure this out.

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

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.0.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.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: geotiff_to_wavetable-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 07541802ab7d37d2b77fd41c742dbaf692d3e3ea1af2200a1c206f53f74f944f
MD5 17ab3468cad66272f51620035cd2f59b
BLAKE2b-256 4e66e48a3d195738b55a88c329d1110b38bc54625c91615292c7052e47b19546

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for geotiff_to_wavetable-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2df60e1806e66c5ebc6d9d066fb6a90d44171932ad6c54c2f609f043719a325
MD5 9368ae665ef7454194cf9eb0ff61373b
BLAKE2b-256 4963d52eeb882620d451777e6116dbeb7e2678681cd04ccc4b31306a5dea03f3

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