Condition into another condition
in
Programming Questions
•
3 years ago
hello..
is there any way to make a condition like "if this - do this", general into the sketch without the need of rewriting many times.
to be more specific, my project is about musical representation
tempo is just a number im milliseconds
So i say to processing, "if musical pitch is x, load "that" image".
How can i put the first condition into the second one for all the pitches without the need of rewriting it for all the pitches.
i didnt upload the code because its big, raw and chaotic.
i hope my question isnt so silly, any advice would be gratefull.
thank you
is there any way to make a condition like "if this - do this", general into the sketch without the need of rewriting many times.
to be more specific, my project is about musical representation
- if(noteDuration<=tempo)
{
note = quarterNote;
}
else if(noteDuration>=tempo && (noteDuration<=2*tempo))
{
note = halfNote;
}
else if (noteDuration>=2*tempo)
{
note = wholeNote; - }
tempo is just a number im milliseconds
So i say to processing, "if musical pitch is x, load "that" image".
How can i put the first condition into the second one for all the pitches without the need of rewriting it for all the pitches.
i didnt upload the code because its big, raw and chaotic.
i hope my question isnt so silly, any advice would be gratefull.
thank you
1