| 305 | } |
| 306 | |
| 307 | void SceneController::reConfigIslandGroup( IslandContainerT &islandGroup, float yOffset ) |
| 308 | { |
| 309 | CI_ASSERT( islandGroup.size() == 4 ); |
| 310 | |
| 311 | const size_t pitchMax = FUNDAMENTAL_MAX + 11; |
| 312 | |
| 313 | size_t f0 = calcNextFundamental(); |
| 314 | CI_LOG_V( "f0: " << f0 ); |
| 315 | |
| 316 | bool isMinor = randBool(); |
| 317 | |
| 318 | islandGroup[0]->mFreqMidi = f0; |
| 319 | islandGroup[1]->mFreqMidi = f0 + ( isMinor ? 3 : 4 );; |
| 320 | islandGroup[2]->mFreqMidi = f0 + 7; |
| 321 | islandGroup[3]->mFreqMidi = f0 + ( isMinor ? 10 : 11 ); |
| 322 | |
| 323 | float islandY = yOffset + pointsToMeters( app::getWindowHeight() + FUNNEL_MAX_HEIGHT + 200 ); |
| 324 | |
| 325 | for( auto &island : islandGroup ) { |
| 326 | float x = lmap<float>( island->mFreqMidi, FUNDAMENTAL_MIN, pitchMax, 0, app::getWindowWidth() ); |
| 327 | float perYOffset = pointsToMeters( randFloat( - mParams.mYOffsetVariance, mParams.mYOffsetVariance ) ); |
| 328 | island->setPosition( vec2( pointsToMeters( x ), islandY + perYOffset ) ); |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | // generates fundamental pitches that are contionusly decending in fifths, wraps if below FUNDAMENTAL_MIN |
| 333 | // note: we're going over the max here, but that's ok, it is only used to layout how far over right side of islands should sit. |
nothing calls this directly
no test coverage detected