Created
August 19, 2015 17:06
-
-
Save adubspea/3c6b95d795be154703bc to your computer and use it in GitHub Desktop.
Northern Wind Sound 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import arb.soundcipher.*; | |
| SoundCipher sc = new SoundCipher(this); | |
| for (int n = 7 ; n < 50; n += 7) { // N = average North wind direction | |
| if (n < 5) { | |
| sc.playNote(80, 60, 50); | |
| } else if (n < 2) { | |
| float[] pitches = {100, 64, 67, 71}; | |
| sc.playChord(pitches, 80, 4); | |
| } else if (n > 2) { | |
| sc.repeat(3); | |
| sc.playNote (70, 40, 10); | |
| float[] pitches = {50, 50, 50, 50}; | |
| sc.playChord(pitches, 80, 4); | |
| } | |
| } |
Author
I'd have to be more familiar with SoundCipher. In general though: your statement doesn't have to be else if, it can just be if this then that many times over. Example:
a = 1
b = 2
if a is 1
print 'a is 1'
if b is 2
print 'b is 2'
That's pseudocode, but it should print
a is 1
b is 2
Know what I mean?
Author
Nope, I don't know what you mean!
Can you give me another example?
Author
for (int n = 7 ; n < 50; n += 7)
} if (s < 20) { //trying to get the program to play multiple notes by using if instead of if & else
float[] pitches = {60, 20, 30, 25};
float [] dynamics = {60, 60, 60, 60};
float[] durations = {5, 5, 5, 5};
sc.playPhrase(pitches, dynamics, durations);
if (n > 2){
float[] pitches = {50, 40, 30, 25};
float [] dynamics = {80, 80, 80, 80};
float[] durations = {5, 5, 5, 5};
sc.playPhrase(pitches, dynamics, durations);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's another example:
import arb.soundcipher.*;
SoundCipher sc = new SoundCipher(this);
for (int n = 7 ; n < 50; n += 7) { // N = average North wind direction for August 1 - 16
if (n >= 7){
float[] pitches = {50};
float [] dynamics = {50};
float[] durations = {15};
sc.playPhrase(pitches, dynamics, durations);
} else if (n > 0) {
sc.repeat(3);
sc.playNote (70, 40, 10);
float[] pitches = {50, 50, 50, 50};
sc.playChord(pitches, 80, 4);
}
}