Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tweaked synth attributes, 1st and 3rd measures are now copied into ea…

…ch 4-bar phrase of the melody
  • Loading branch information...
commit 1e12b4c8a27d5ea357ca1d93ff0a4eb6de49c053 1 parent c1c5851
Joseph Betz authored
View
40 java/TwitterMelodyGenerator/src/edu/uiuc/sigmusic/twittersounds/MelodyGenerator.java
@@ -123,8 +123,8 @@
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}},
{{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0},
- {0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0}},
{{1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0},
{0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0}},
@@ -734,10 +734,10 @@ else if (noteChooser < .9 && synth[i + 16] >=2){
* of the 1st and 3rd measures to the current melody, this will add a ton of structure
*/
if(fileRead && currentMelody != 1){
- for(int i = 0; i < 8; i++)
+ for(int i = 0; i < 16; i++)
synth[i] = prev.synth[i];
- for(int i = 32; i < 40; i++){
+ for(int i = 32; i < 48; i++){
synth[i] = prev.synth[i];
}
}
@@ -914,7 +914,7 @@ public void modifyAttributes(){
reverbDamping = (100 - confusion);
globalVolume = 100 + excitement/2;
- tempo = 400 - (happiness/8 + (int)(excitement*1.3));
+ tempo = 375 - (happiness/10 + excitement);
synthAttack = 0;
synthDecay = 0;
@@ -923,26 +923,34 @@ public void modifyAttributes(){
synthGlissando = confusion/10;
synthVibratoDepth = confusion/10;
synthVibratoSpeed = confusion/20 + excitement/20;
- if(happiness + excitement < 120){
+ synthTremeloDepth = confusion/2;
+ synthTremeloSpeed = excitement/2;
+
+ if (happiness + excitement < 120){
synthVibratoWaveform = 0;
synthTremeloWaveform = 0;
synthWaveform = 0;
-
- if(synthvel[0] != .5f)
- for(int i = 0; i < 64; i++)
- synthvel[i] = .5f;
}
else {
synthVibratoWaveform = 1;
synthTremeloWaveform = 1;
synthWaveform = 1;
-
- if(synthvel[0] != .5f)
- for(int i = 0; i < 64; i++)
- synthvel[i] = .5f;
}
- synthTremeloDepth = confusion/2;
- synthTremeloSpeed = excitement/2;
+
+ if (excitement > 70) {
+ synthVibratoDepth = 0;
+ synthVibratoSpeed = 0;
+ synthGlissando = 0;
+ synthWaveform = 2;
+ synthTremeloDepth = 0;
+ synthTremeloSpeed = 0;
+ }
+ for (int i = 0; i < 64; i++) {
+ if (excitement > 70)
+ synthvel[i] = .12f;
+ else
+ synthvel[i] = .5f;
+ }
bassAttack = 20 + confusion + (((100 - happiness)/4));
bassDecay = 100 - confusion;

0 comments on commit 1e12b4c

Please sign in to comment.
Something went wrong with that request. Please try again.