[SCM] calf/master: + Organ: add more waveforms

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:37:07 UTC 2013


The following commit has been merged in the master branch:
commit f3f982bc5699b558e2e0ac81ca4f78ccf2840408
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Wed Apr 9 20:40:25 2008 +0000

    + Organ: add more waveforms
    
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@149 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/calf/organ.h b/src/calf/organ.h
index 492ebd1..f8a242a 100644
--- a/src/calf/organ.h
+++ b/src/calf/organ.h
@@ -72,7 +72,12 @@ struct organ_parameters {
 class organ_voice_base
 {
 public:
-    enum { wave_sine, wave_sinepl1, wave_sinepl2, wave_sinepl3, wave_ssaw, wave_ssqr, wave_spls, wave_saw, wave_sqr, wave_pulse, wave_sinepl05, wave_sqr05, wave_halfsin, wave_clvg, wave_bell, wave_count };
+    enum { 
+        wave_sine, 
+        wave_sinepl1, wave_sinepl2, wave_sinepl3,
+        wave_ssaw, wave_ssqr, wave_spls, wave_saw, wave_sqr, wave_pulse, wave_sinepl05, wave_sqr05, wave_halfsin, wave_clvg, wave_bell, wave_bell2,
+        wave_w1, wave_w2, wave_w3, wave_w4, wave_w5, wave_w6, wave_w7, wave_w8, wave_w9,
+        wave_count };
 protected:
     static waveform_family<ORGAN_WAVE_BITS> waves[wave_count];
     // dsp::sine_table<float, ORGAN_WAVE_SIZE, 1> sine_wave;
diff --git a/src/organ.cpp b/src/organ.cpp
index b7a5232..44914d5 100644
--- a/src/organ.cpp
+++ b/src/organ.cpp
@@ -246,7 +246,7 @@ const char *organ_audio_module::port_names[] = {"Out L", "Out R"};
 
 const char *organ_percussion_harmonic_names[] = { "2nd", "3rd" };
 
-const char *organ_wave_names[] = { "Sin", "S0", "S00", "S000", "SSaw", "SSqr", "SPls", "Saw", "Sqr", "Pls", "S(", "Sq(", "S+", "Clvg", "Bell" };
+const char *organ_wave_names[] = { "Sin", "S0", "S00", "S000", "SSaw", "SSqr", "SPls", "Saw", "Sqr", "Pls", "S(", "Sq(", "S+", "Clvg", "Bell", "Bell2", "W1", "W2", "W3", "W4", "W5", "W6", "W7", "W8", "W9" };
 
 const char *organ_routing_names[] = { "Out", "Flt 1", "Flt 2"  };
 
@@ -442,6 +442,79 @@ organ_voice_base::organ_voice_base(organ_parameters *_parameters)
             float fm = 0.3 * sin(6*ph) + 0.3 * sin(11*ph) + 0.3 * cos(17*ph) - 0.3 * cos(19*ph);
             tmp[i] = sin(5*ph + fm) + cos(7*ph - fm);
         }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
         waves[wave_bell].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+        {
+            float ph = i * 2 * M_PI / ORGAN_WAVE_SIZE;
+            float fm = 0.3 * sin(3*ph) + 0.3 * sin(11*ph) + 0.3 * cos(17*ph) - 0.3 * cos(19*ph)  + 0.3 * cos(25*ph)  - 0.3 * cos(31*ph) + 0.3 * cos(37*ph);
+            tmp[i] = sin(3*ph + fm) + cos(7*ph - fm);
+        }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
+        waves[wave_bell2].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+        {
+            float ph = i * 2 * M_PI / ORGAN_WAVE_SIZE;
+            float fm = 0.5 * sin(3*ph) + 0.3 * sin(5*ph) + 0.3 * cos(6*ph) - 0.3 * cos(9*ph);
+            tmp[i] = sin(4*ph + fm) + cos(ph - fm);
+        }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
+        waves[wave_w1].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+        {
+            float ph = i * 2 * M_PI / ORGAN_WAVE_SIZE;
+            tmp[i] = sin(ph) * sin(2 * ph) * sin(4 * ph) * sin(8 * ph);
+        }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
+        waves[wave_w2].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+        {
+            float ph = i * 2 * M_PI / ORGAN_WAVE_SIZE;
+            tmp[i] = sin(ph) * sin(3 * ph) * sin(5 * ph) * sin(7 * ph) * sin(8 * ph);
+        }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
+        waves[wave_w3].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+        {
+            float ph = i * 2 * M_PI / ORGAN_WAVE_SIZE;
+            tmp[i] = sin(ph + 2 * sin(ph + 2 * sin(ph)));
+        }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
+        waves[wave_w4].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+        {
+            float ph = i * 2 * M_PI / ORGAN_WAVE_SIZE;
+            tmp[i] = ph * sin(ph);
+        }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
+        waves[wave_w5].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+        {
+            float ph = i * 2 * M_PI / ORGAN_WAVE_SIZE;
+            tmp[i] = ph * sin(ph) + (2 * M_PI - ph) * sin(2 * ph);
+        }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
+        waves[wave_w6].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+        {
+            float ph = i * 1.0 / ORGAN_WAVE_SIZE;
+            tmp[i] = exp(-ph * ph);
+        }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
+        waves[wave_w7].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+        {
+            float ph = i * 1.0 / ORGAN_WAVE_SIZE;
+            tmp[i] = exp(-ph * sin(2 * M_PI * ph));
+        }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
+        waves[wave_w8].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+        {
+            float ph = i * 1.0 / ORGAN_WAVE_SIZE;
+            tmp[i] = sin(2 * M_PI * ph * ph);
+        }
+        normalize_waveform(tmp, ORGAN_WAVE_SIZE);
+        waves[wave_w9].make(bl, tmp);
     }
 }

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list