/* Spectroscopic Toolkit version 1.93, july 13, 2008. Copyright (c) 2000-2008 - 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. */ #include /* For FILE. */ #include "ST_wavelets.h" /* For ENGINE. */ #include "c00.h" /* For c02_smear() and others. */ static short c07_composition2003_part1(ENGINEp E, FILE* msg, long double starttime) { /* Variable starttime but fixed duration. */ short e; long double fixedDayDur = 24.0 * 60.0 * 60.0 / 2048.0; /* 42.1875 seconds per day. */ /* Subtle shaping of the massive iron cloud. */ const double FeShapeFreqs[] = { -1001.471801, /* One before last (highest) of Ag. */ (-1316.874668 + /* Average two highest of Ag. */ -1322.420292)/2.0, 268.827745, /* First of Hg (almost lowest). */ 225.807860, /* Second of Hg (lowest). */ 0.0 }; /* End with 0.0. */ if (msg != NULL) fprintf(msg, "Starting c07_composition2003_part1().\n"); /*---------------------------- Sunday: ------------------------------------------*/ if (msg != NULL) fprintf(msg, "Au starttime=%.3Lf.\n", starttime); e = c02_smear(7900, /* 7900=Au (100 * Atomic number + ionisation level). */ 3.00, /* Linear overall amplitude about 3.20 is ok for Au. */ /* Not too loud: 3.00 is better than 3.20. */ starttime, /* Starttime in seconds. */ fixedDayDur, /* 'effective duration' in seconds. */ 1, /* 0 for down, 1 for up (ascending pseudo-glissando). */ 0, /* jj=0 does not scramble times (with J levels). */ /* ONLY Au gets no scrambling. */ E, /* Pass DSP engine. */ msg); /* NULL, stdout or some logfile. */ /* H coloring: play 6th harmonic on starting a: */ e |= c06_HcolorAu2003(starttime, fixedDayDur, E, msg); if (e) goto finish2003; starttime += fixedDayDur; /*---------------------------- Monday: -------------------------------------------*/ if (msg != NULL) fprintf(msg, "Ag starttime=%.3Lf.\n", starttime); e = c02_smear(4700, /* 4700=Ag (100 * Atomic number + ionisation level). */ 2.80, /* Linear overall amplitude about 4.20 is ok for Ag. */ /* Not too loud: 3.00 seems better than 4.20. */ starttime, /* Starttime in seconds. */ fixedDayDur, /* 'effective duration' in seconds. */ 1, /* 0 for down, 1 for up (ascending pseudo-glissando). */ 1, /* jj=1 scrambles TOP times (with J levels). */ E, /* Pass DSP engine. */ msg); /* NULL, stdout or some logfile. */ /* H coloring, plays overtones on last 2 Ag tones: */ e |= c06_HcolorAg2003(starttime, fixedDayDur, E, msg); if (e) goto finish2003; starttime += fixedDayDur; /*---------------------------- Tuesday: ------------------------------------------*/ if (msg != NULL) fprintf(msg, "Fe starttime=%.3Lf.\n", starttime); e = c01_shapedCloud(2600, /* 2600=Fe (100*Atomic num + ionisation lvl). */ 0.18, /* Linear overall amplitude (0.18=OK for Fe). */ /* shapedCloud() implicitly uses phase=-1. */ starttime + /* Starttime in seconds. */ /* 0.30 ? */ 0.26 * fixedDayDur, /* 0.52 of time for fade-in plus fade-out. */ /* 0.40 ? */ 0.48 * fixedDayDur, /* 'effective duration' in seconds. */ FeShapeFreqs, /* Shape with surrounding elements. */ E, /* Half of it, otherwise it overwhelms */ msg); /* the preceding day. */ if (e) goto finish2003; starttime += fixedDayDur; /*---------------------------- Wednesday: ----------------------------------------*/ if (msg != NULL) fprintf(msg, "Hg starttime=%.3Lf.\n", starttime); e = c02_smear(8000, /* 8000=Hg (100 * Atomic number + ionisation level). */ 3.00, /* Linear overall amplitude. */ starttime, /* Starttime in seconds. */ fixedDayDur, /* 'effective duration' in seconds. */ 1, /* 0 for down, 1 for up (ascending pseudo-glissando). */ 1, /* 1 is weird CP: jj=1 scrambles TOP times (with J levels). */ E, /* Pass DSP engine. */ msg); /* NULL, stdout or some logfile. */ if (e) goto finish2003; starttime += fixedDayDur; /*---------------------------- Thursday: -----------------------------------------*/ if (msg != NULL) fprintf(msg, "Sn starttime=%.3Lf.\n", starttime); e = c02_smear(5000, /* 5000=Sn (100 * Atomic number + ionisation level). */ 3.00, /* Linear overall amplitude. */ starttime, /* Starttime in seconds. */ fixedDayDur, /* 'effective duration' in seconds. */ 1, /* 0 for down, 1 for up (ascending pseudo-glissando). */ 1, /* 1 is weird counterpoint: jj=1 scrambles TOP times (with J levels). */ E, /* Pass DSP engine. */ msg); /* NULL, stdout or some logfile. */ if (e) goto finish2003; starttime += fixedDayDur; /*---------------------------- Friday: ------------------------------------------*/ if (msg != NULL) fprintf(msg, "Cu starttime=%.3Lf.\n", starttime); e = c01_massiveCloud(2900, /* 2900=Cu (100*Atomic num + ionisation lvl). */ 0.80, /* Linear overall amplitude (0.88=OK for Cu). */ -1, /* -1 = sync with other oscillators. */ starttime + /* Starttime in seconds. */ /* 0.30 ? */ 0.26 * fixedDayDur, /* 0.52 of time for fade-in plus fade-out. */ /* 0.40 ? */ 0.48 * fixedDayDur, /* 'effective duration' in seconds. */ E, /* Half of it, otherwise it overwhelms */ msg); /* the preceding day. */ if (e) goto finish2003; starttime += fixedDayDur; /*---------------------------- Saturday: ----------------------------------------*/ if (msg != NULL) fprintf(msg, "Pb starttime=%.3Lf.\n", starttime); e = c02_smear(8200, /* 8200=Pb (100 * Atomic number + ionisation level). */ 3.00, /* Linear overall amplitude. */ starttime, /* Starttime in seconds. */ fixedDayDur, /* 'effective duration' in seconds. */ 0, /* 0 for down, 1 for up (ascending pseudo-glissando). */ 0, /* 1 is weird CP: jj=1 scrambles TOP times (with J levels). */ E, /* Pass DSP engine. */ msg); /* NULL, stdout or some logfile. */ if (e) goto finish2003; starttime += fixedDayDur; /*--------------------------------------------------------------------------------*/ finish2003: if (msg != NULL) fprintf(msg, "Finished, c07_composition2003_part1() = %d.\n", e); return e; } /*------------------------------------------------------------------------*/ short c07_comp2003_1(ENGINEp E, FILE* msg) /* API function. */ { return c07_composition2003_part1(E, msg, 8.00); } /*------------------------------------------------------------------------*/ static short c07_composition2003_part2(ENGINEp E, FILE* msg, long double starttime) { /* Variable starttime but fixed duration. */ short e = 0; starttime -= 4.00; /* First 4 seconds of birds are silent. */ if (msg != NULL) fprintf(msg, "Starting c07_composition2003_part2().\n"); e |= c05_niceHydrogenBirds(starttime, E, msg); e |= c06_HHeP_bells(E, msg, starttime + 17.8); /* 15.8 seconds = at first top of high bird. */ /* 18.0 and 17.9 are acceptable but 17.8 is the best. */ if (msg != NULL) fprintf(msg, "Finished, c07_composition2003_part2() = %d.\n", e); return e; } /*------------------------------------------------------------------------*/ short c07_comp2003_2(ENGINEp E, FILE* msg) /* API function. */ { return c07_composition2003_part2(E, msg, 0.00); }