hammer and rainbow

Spectroscopic Toolkit

64 bit phase oscillators for nanotonal synthesis
version 1.97 - Pieter Suurmond - nov 13, 2011

Spectroscopic Toolkit is music composition software for massive additive synthesis and/or nanotones. It offers 64-bit integer-DSP (in both the frequency- and the amplitude-dimension). It produces audio files and graphic images at its own pace and is [therefore] easily portable to all computer systems. The software was not designed for realtime use, and it offers no graphical user interface.

Spectroscopic Toolkit is open-source software for anyone interested in alchemy, electronic music composition and nanotonality. The software translates spectroscopic data of atoms and ions to audio files. It can be applied in computer music composition to generate sounds as alchemistic symbols. Iron (Fe), for example, has an alchemistic link with the planet mars, the day tuesday and the masculine. Copper (Cu), on the contrary, is associated with the feminine, venus and friday. Remarkably, precisely these two metals (Fe and Cu) exhibit a very dense spectrum, as opposed to [the] other five alchemistic metals (Au, Ag, Hg, Sn and Pb). This spectral contrast can be observed in studies twoWeeks and Boog.

The software is written in C. With a standard C-compiler you may:

Motivation and objectives

One-dimensional oscillating systems dominate music: string-instruments, wind-instruments and electronically repeated waveforms; they all produce the natural overtones (frequency ratios approximate 1:2:3:4:5, etcetera). Traditional western harmony is based on the first four or five prime numbers (1, 2, 3, 5, 7, where the latter (7) may be questionable). But an evenly 'natural music' can be made with timbres from the more complex oscillating systems in nature: atoms and ions!

Spectroscopic Toolkit was developed because other synthesis software (like CSound) did no longer suffice my needs:

Download

The latest version of Spectroscopic Toolkit may be downloaded from https://ecomaan.nl/c/
Download gzipped tar file...   ST1.97.tar.gz 18 MB   Spectroscopic Toolkit LATEST version 1.97 (2011).
Gzipped tar file containing all sourcefiles, documentation and Kurucz' spectroscopic database.
Download gzipped tar file...   ST1.86.tar.gz 18 MB   Spectroscopic Toolkit OLDER version 1.86 (2004).

License

    Spectroscopic Toolkit version 1.97, november 13, 2011.
    Latest version available at https://ecomaan.nl/c/
    Copyright (c) 2000 2004 2011 2019 - Pieter Suurmond

    Permission is hereby granted, free of charge, to any person
    obtaining a copy of this software and associated documentation files
    (the "Software"), to deal in the Software without restriction,
    including without limitation the rights to use, copy, modify, merge,
    publish, distribute, sublicense, and/or sell copies of the Software,
    and to permit persons to whom the Software is furnished to do so,
    subject to the following conditions:

    The above copyright notice and this permission notice shall be
    included in all copies or substantial portions of the Software.

    Any person wishing to distribute modifications to the Software is
    requested to send the modifications to the original developer so that
    they can be incorporated into the canonical version.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
    IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
    ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
    CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Unpack

After downloading, the package needs to be unzipped and untarred.
On Unix (including Apple OSX, Irix, Linux, BSD, etc.), one may unpack by typing
        gunzip ST1.97.tar.gz
        tar xf ST1.97.tar
on the commandline, which creates a new directory named ST1.97.

Configure

On Unix (Linux, OSX, Irix, Ubuntu, etc), one may use the provided makefile to compile. Before compilation you can edit the makefile: choose a different compiler (CC), change optimization flags (CFLAGS), etc.
On other platforms, where you cannot use makefiles (Mac OS 7, 8 or 9; MS Windows), put together a C project containing:

Compile

On Unix (including Apple OSX, Irix, Linux, BSD, etc.), change to the source directory and compile by typing something like:
        cd ST1.97/src
        make
When this succeeds, a binary executable named ST is created in the parent directory.
Notice your C compiler needs a mathematical library with header <math.h>. Furthermore, your C compiler needs to support 64-bit integers (signed as well as unsigned) as integral datatype (called long longs and unsigned long longs). Since long doubles are used, you possibly also need the C-compiler to be c99-compliant (at least gcc v4.2.4 on Ubuntu requires this).

Run

Assuming you are still in the source directory, return to the parent directory and start the program by typing:
        cd ../
        ./ST 1000
Test-number 1000 should yield a short AIFF file, two JPEG files and a logfile.
Samplesize and samplerate options may preceed the number. For example, command
        ./ST 24 48000 1002
instructs ST to output a 24-bit file with a samplerate of 48 kHz, rendering number 1002.
Ommiting the number or supplying invalid numbers prints usage and lists all valid numbers:
        ./ST

  ST1.97 by Pieter Suurmond, november 13, 2011.
  Parameter(s) missing!
  USAGE:  ST [bits] [samplerate] number 
  Bits may be 8, 16 or 24. Samplerate must be in Hertz.
  Use one of the following numbers as (last) parameter:

         0: Print usage and list numbers.
      1000: Example 0: Gaussians (using no database)     00:21.
      1001: Example 1: Clip test (using no database)     00:04.
      1002: Example 2: Overtones (using no database)     00:23.
      1003: Example 3: Phase test (using no database)    00:19.
      1004: Example 4: Exponent test (using no database) 01:31.
      1301: 'Mendelejev progression H to S' (study 2001) 06:55.
      1302: 'Two Weeks - alchemist metals' (study 2001)  06:22.
      1307: 'Hydrogen horizontally smeared' (study 2001) 01:04.
     10100: Hydrogen (H) cloud (oscillator sync)         01:46.
     10200: Helium (He) cloud (oscillator sync)          01:46.
     10201: Helium+ (He+ ion) cloud (oscillator sync)    01:46.
     10300: Lithium (Li) cloud (oscillator sync)         01:46.
     10400: Beryllium (Be) cloud (oscillator sync)       01:46.
     10500: Boron (B) cloud (oscillator sync)            01:46.
     10600: Carbon (C) cloud (oscillator sync)           01:46.
     10700: Nitrogen (N) cloud (oscillator sync)         01:46.
     10800: Oxygen (O) cloud (oscillator sync)           01:46.
     10900: Fluorine (F) cloud (oscillator sync)         01:46.
     11000: Neon (Ne) cloud (oscillator sync)            01:46.
     11100: Sodium (Na) cloud (oscillator sync)          01:46.
     11200: Magnesium (Mg) cloud (oscillator sync)       01:46.
     11300: Aluminium (Al) cloud (oscillator sync)       01:46.
     11400: Silicon (Si) cloud (oscillator sync)         01:46.
     11500: Phosphorus (P) cloud (oscillator sync)       01:46.
     11600: Sulfur (S) cloud (oscillator sync)           01:46.
     11700: Chlorine (Cl) cloud (oscillator sync)        01:46.
     11800: Argon (Ar) cloud (oscillator sync)           01:46.
     12600: Iron (Fe) cloud (42806 freqs, oscill.sync)   01:46.
     12700: Cobalt (Co) cloud (oscillator sync)          01:46.
     12800: Nickel (Ni) cloud (oscillator sync)          01:46.
     12900: Copper (Cu) cloud (oscillator sync)          01:46.
     13000: Zinc (Zn) cloud (oscillator sync)            01:46.
     14700: Silver (Ag) cloud (oscillator sync)          01:46.
     15000: Tin (Sn) cloud (oscillator sync)             01:46.
     15500: Cesium (Cs) cloud (oscillator sync)          01:46.
     17900: Gold (Au) cloud (oscillator sync)            01:46.
     18000: Mercury (Hg) cloud (oscillator sync)         01:46.
     18200: Lead (Pb) cloud (oscillator sync)            01:46.
     19000: Thorium (Th) cloud (oscillator sync)         01:46.
     19200: Uranium (U) cloud (oscillator sync)          01:46.
     20100: Hydrogen (H) cloud                           01:46.
     20200: Helium (He) cloud                            01:46.
     20201: Helium+ (He+ ion) cloud                      01:46.
     20300: Lithium (Li) cloud                           01:46.
     20600: Carbon (C) cloud                             01:46.
     20700: Nitrogen (N) cloud                           01:46.
     20800: Oxygen (O) cloud                             01:46.
     20900: Fluorine (F) cloud                           01:46.
     21400: Silicon (Si) cloud                           01:46.
     21600: Sulfur (S) cloud                             01:46.
     27900: Gold (Au) cloud                              01:46.
  20030001: 'Boog' (composition 2003 part 1)             05:09.
  20030002: 'Vogelbellen' (composition 2003 part 2)      07:59.
  20030102: 'Hydrogen Birds' (2002)                      08:10.
  20030201: 'Hydrogen Bells' (2003)                      01:13.
  20030202: 'Hydrogen and Helium+ Bells' (2003)          02:43.
  20110001: 'Rossi clouds' cold fusion H + Ni -> Cu.     ??:??.
Example numbers 1000 to 1004 don't need any quantumphysical data. But the first time ST does need it (when you supply numbers above 1300), it will pack textfile gfall.dat to binary format, creating a file named gfall.pbin.
Notice binary .pbin files may not be portable between platforms (especially not between big- and little endians).

Internal operation

ST works a bit like CSound: first all musical events are sorted by starttime, then they are allocated, played (as long as they are 'active'), and released. The differences with CSound are that instruments are called WAVELETS and that they remain in memory rather than in a .sco file. In ST, there is no separate sorting routine (as in CSound), WAVELETS in the linked list structure maintain their order - based on starttimes - by use of the addWAVELET() function.
ST outputs a logfile, one or more graphic scorefiles, and an audiofile.
  1. Initialization:
    The main() in source file ST.c starts with creating a logfile to write diagnostic messages to.
    It then creates a so called ENGINE which contains samplerate information, some samplerate-related constants and some wavetables.
  2. Algorithmic composition:
    A composition is created by putting wavelets into a linked list structure by some algorithm.
    See c00_example.c for 4 simple examples, or c01_twoWeeks.c for a more complicated example that uses Kurucz'z spectroscopic database (and also generates a large number of video frames). Composing basically consists in repeatedly calling the function addWAVELET(). Currently, 3 types of envelopes are supported, but it won't be too difficult to add more in sourcefile ST_wavelets.c.
  3. Score rendering:
    Graphic scores of the music are generated in JPEG format. These are basically sonograms, drawn from the linked list structure that was filled above.
    Within main(), function scoreWAVELETS() may be called several times to draw scores with various dimensions. With parameter envelopeTracking switched on, scoreWAVELETS() visualises envelope-shapes by greyscales. With envelopeTracking off, only the top-amplitude of an envelope is used as greyscale (no intensity change over time).
  4. Audio rendering:
    Finally, audio is calculated and saved to AIFF file (stereo, 8, 16 or 24 bit, whatever samplerate) by calling function playWAVELETS() from main(). Audio rendering will abort as soon as over- or underflow occurs, files thus far will however be saved.
ST uses only 4 wavetables: 1 for audio and 3 for subaudio. The following images were created by the visualiseTables() function:
  audio sinewave For audio, only a simple sinewave is used. In expontial envelopes (rise and fall) a sine is the only one that can be used. A cosine, for instance, might cause clicks when its' phase is aligned at the start or the end of the exponential.
  gaussian bell In calls to addWAVELET(), argument top specifies the center of the gaussian bell, dur specifies only 1/5th of the total (really calculated) duration.
Duration is measured here from inflection point at steepest ascend to inflection point at steepest descend, where amplitude is exp(-0.5), which is approximately 0.6065. Here argument phase may be -1 (oscill sync), 0 (aligned sine) or 1 (aligned cosine).
  exponential decay In calls to addWAVELET(), argument top specifies the start of the exponential decay, dur specifies only 1/15th of the total (really calculated) duration.
Duration is measured here from start (top) to the -6.02 dB point, where amplitude is exactly 0.5. Here audio and subaudio tables need to be aligned to prevent 'clicks', argument phase must be 0.
  exponential rise In calls to addWAVELET(), argument top specifies the end of the exponential rise, dur specifies only 1/15th of the total (really calculated) duration.
Duration is measured here from the -6.02 dB point, where amplitude is exactly 0.5, to the end (top). Here audio and subaudio tables need to be aligned to prevent 'clicks', argument phase must be 0.

Older output examples:

Below, 13 nanotonal studies in soundscape-style are presented, all made with ST, and solely based on atomic spectra (they might thus as well be called spectroscopical studies). One can download the pieces, listen to them, and perhaps burn one's own audio-CD with them. These are all FLAC files, 16 bit, stereo, 44.1 KHz. On the right, the generated scores can be viewed.

1   ST1.16HSmndljv   Mendelejev progression hydrogen to sulphur
(H He Li Be B C N O F Ne Na Mg Al Si P S)
6:30   21.9 MB   score
2   ST0.44twoWeeks   Alchemistic metals and ions
(Au Ag Fe Hg Sn Cu Pb -- Ag+ Fe+ Hg+ Sn+ Cu+ Pb+)
6:03   14.7 MB   score
3   ST1.14HOmndljv   Mendelejev progression hydrogen to oxygen
(H He Li Be B C N O)
3:42   11.0 MB   score
4   ST0.33AuGliss   Gold glissando  (Au) 1:13   2.3 MB   score
5   ST0.33AgGliss   Silver glissando  (Ag) 0:27   0.8 MB   score
6   ST0.33FeGliss   Iron glissando  (Fe) 0:33   0.9 MB   score
7   ST0.35energyH   Hydrogen horizontal smeared  (H) 1:00   1.7 MB   score
8   ST0.35togetherH   Hydrogen vertical  (H) 1:33   2.7 MB   (see energyH)
9   ST0.33AuAgGliss   Gold and silver glissandi  (Au Ag) 0:54   1.7 MB   score
10   ST0.07HOionErr   Hydrogen to oxygen staccato  (H He Li Be B C N O) 6:03   14.1 MB   (timing errors)
11   ST0.08HOionErr   Hydrogen to oxygen legato  (H He Li Be B C N O) 11:51   54.8 MB   (timing errors)
12   ST0.24week39   Week 39 octaves  (Au Ag Fe Hg Sn Cu Pb) 3:44   9.6 MB   (octave higher
  than ST0.26)
13   ST0.26week40   Week 40 octaves  (Au Ag Fe Hg Sn Cu Pb) 3:27   7.3 MB   score
   
 
 
    total:     47:00   143.4 MB  

Spectromorphological rules in studies ST0.07 and ST0.08 are the most fascinating. Listening to these pieces, one really feels submerged in the quantumphysical world. Actually these are 2 failures because in this early stage of the software timing-errors still occured. An unintended but beautiful morphology!
In studies ST1.14 and ST1.16, the periodic table is stepped through, element by element. In the last one, which continues up to sulphur, it becomes clear the applied morphology won't captivate when this process is continued - in the same manner - up to the 109th element. Almost terrifying sounds the transition nitrogen-oxygen-fluorine.
In ST0.24, ST0.26 and ST0.44 an alchemistic arrangement is chosen. (There exists a link between the 7 metals gold, silver, iron, mercury, tin, copper and lead, the 7 heavenly bodies sun, moon, mars, mercury, jupiter, venus and saturn, and the 7 days of the week.) The most complex and dense spectra come from iron and copper, exactly the 2 that respectively symbolize the masculine and the feminine.
The titles of the glissando-études (ST0.33xx) are deceptive because pitch-rise only occurs in discrete steps (quantum-leaps), so actually these are tone-scales. Remarkeble is the "cadence-quality" of these rising scales.

If you like these sounds, you may use them for your own purposes. It would then be nice if you credit me, but more important: please, never sell this music in unmodified form, nor include it in commercial software, CD-ROMs, DVDs, etc., for this quantumfysical music should remain free.
Give credit to Robert L. Kurucz who gathered and made available all this data!

Future work

Thanks to