// SCORE void GetCurrentHarmonyParamsFromScore() { discModelParams = scoreDiscs.CurrentHarmonyParams(globalEvolutionState, harmonyLookupIndex); funds_harmonicity = discModelParams.funds_harmonicity; funds_deformation = discModelParams.funds_deformation; funds_size = discModelParams.funds_size; funds_lowest = discModelParams.funds_lowest; funds_highestAllowed = discModelParams.funds_highestAllowed; funds_MIDIdeviation_range = discModelParams.funds_MIDIdeviation_range; parts_harmonicity = discModelParams.parts_harmonicity; parts_deformation = discModelParams.parts_deformation; parts_size = discModelParams.parts_size; parts_highestAllowed = discModelParams.parts_highestAllowed; parts_MIDIdeviation_range = discModelParams.parts_MIDIdeviation_range; parts_include_prob = discModelParams.parts_include_prob; lightFlareEvent_shimmer_percentOfCriticalBandRange = discModelParams.lightFlareEvent_shimmer_percentOfCriticalBandRange; _modelTransposition = discModelParams.modelTransposition; _ampGlobal = discModelParams.ampGlobal; Debug.Log("index " + harmonyLookupIndex + " lowest " + funds_lowest); }
public DiscModelParams_Cn CurrentHarmonyParams(GlobalEvolution.GlobalEvolutionState globalEvolutionState, int harmonyLookupIndex) { if (globalEvolutionState == GlobalEvolution.GlobalEvolutionState.beginCeiling || globalEvolutionState == GlobalEvolution.GlobalEvolutionState.begin || globalEvolutionState == GlobalEvolution.GlobalEvolutionState.beginSpin) { // to add a case, add it, and update the total # of cases here; that's it // the MakeDiscsModel script steps through this and loops based on the number entered here currentState_numHarmonies = 8; // because C# is stateful, just enter what changes for each index - else the previous values remain switch (harmonyLookupIndex) { case 0: funds_harmonicity = 1.3f; funds_deformation = 1.0f; funds_size = 0.0f; funds_lowest = 400.0f; funds_highestAllowed = 3000.0f; funds_MIDIdeviation_range = 2.1f; parts_harmonicity = 1.0f; parts_deformation = 1.0f; parts_size = 0.0f; parts_highestAllowed = 9000.0f; parts_MIDIdeviation_range = .4f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .4f); break; case 1: funds_harmonicity = 1.05f; funds_MIDIdeviation_range = 0.0f; funds_lowest = 110; funds_highestAllowed = 1000.0f; parts_highestAllowed = 5000.0f; parts_MIDIdeviation_range = .2f; parts_include_prob = .8f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .4f); break; case 2: funds_harmonicity = 1.07f; funds_lowest = 200f; funds_highestAllowed = 1000.0f; parts_highestAllowed = 2000.0f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .4f); break; case 3: funds_lowest = 421; funds_highestAllowed = 3000.0f; parts_highestAllowed = 7000.0f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .1f); funds_harmonicity = 1.1f; break; case 4: funds_lowest = 50; funds_highestAllowed = 1000.0f; parts_highestAllowed = 3000.0f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .5f); funds_harmonicity = .9f; break; case 5: funds_lowest = 100; funds_highestAllowed = 1000.0f; parts_highestAllowed = 3000.0f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .3f); funds_harmonicity = .5f; break; case 6: funds_harmonicity = .3f; funds_MIDIdeviation_range = 0f; funds_lowest = 40; funds_highestAllowed = 3000.0f; parts_highestAllowed = 8000.0f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .4f); break; case 7: funds_harmonicity = 1.05f; funds_MIDIdeviation_range = 0.0f; funds_lowest = 110; funds_highestAllowed = 1000.0f; parts_highestAllowed = 5000.0f; parts_MIDIdeviation_range = .2f; parts_include_prob = .8f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .4f); break; } } else if (globalEvolutionState == GlobalEvolution.GlobalEvolutionState.lowerAndRougher) { // to add a case, add it, and update the total # of cases here; that's it: currentState_numHarmonies = 18; switch (harmonyLookupIndex) { case 0: funds_harmonicity = 1.01f; funds_deformation = 1.0f; funds_size = 0.0f; funds_lowest = 800.0f; funds_highestAllowed = 3000.0f; funds_MIDIdeviation_range = .05f; parts_harmonicity = 1.0f; parts_deformation = 1.0f; parts_size = 0.0f; parts_highestAllowed = 9000.0f; parts_MIDIdeviation_range = .1f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .4f); modelTransposition = DiscModelParams_Cn.ModelTransposition.noneOrTwoOctavesLower; ampGlobal = .6f; break; case 1: funds_harmonicity = .99f; funds_lowest = 400.0f; funds_highestAllowed = 3000.0f; funds_MIDIdeviation_range = .05f; parts_harmonicity = 1.0f; parts_highestAllowed = 9000.0f; parts_MIDIdeviation_range = .1f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .3f); modelTransposition = DiscModelParams_Cn.ModelTransposition.noneOrTwoOctavesLower; ampGlobal = .6f; break; case 2: funds_harmonicity = 1.02f; funds_lowest = 700.0f; funds_highestAllowed = 3000.0f; funds_MIDIdeviation_range = .05f; parts_harmonicity = 1.0f; parts_highestAllowed = 6000.0f; parts_MIDIdeviation_range = .1f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .4f); modelTransposition = DiscModelParams_Cn.ModelTransposition.oneOctaveLower; ampGlobal = .6f; break; case 3: funds_harmonicity = .98f; funds_lowest = 350.0f; funds_highestAllowed = 3000.0f; funds_MIDIdeviation_range = .1f; parts_harmonicity = 1.0f; parts_highestAllowed = 6000.0f; parts_MIDIdeviation_range = .2f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .5f); modelTransposition = DiscModelParams_Cn.ModelTransposition.oneOrTwoOctavesLower; ampGlobal = .6f; break; case 4: funds_harmonicity = 1.5f; funds_lowest = 650.0f; funds_highestAllowed = 2000.0f; funds_MIDIdeviation_range = .1f; parts_harmonicity = 1.1f; parts_highestAllowed = 6000.0f; parts_MIDIdeviation_range = .3f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .6f); modelTransposition = DiscModelParams_Cn.ModelTransposition.oneOrTwoOctavesLower; ampGlobal = .8f; break; case 5: funds_harmonicity = .75f; funds_lowest = 300.0f; funds_highestAllowed = 2000.0f; funds_MIDIdeviation_range = .1f; parts_harmonicity = 1.4f; parts_highestAllowed = 8000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .5f); modelTransposition = DiscModelParams_Cn.ModelTransposition.noneOrOneOctaveLower; ampGlobal = .9f; break; case 6: funds_harmonicity = 1.03f; funds_lowest = 600.0f; funds_highestAllowed = 1500.0f; funds_MIDIdeviation_range = .1f; parts_harmonicity = 1.4f; parts_highestAllowed = 7000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .4f); modelTransposition = DiscModelParams_Cn.ModelTransposition.noneOrOneOctaveLower; ampGlobal = 1f; break; case 7: funds_harmonicity = 1.3f; funds_lowest = 250.0f; funds_highestAllowed = 2000.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = .9f; parts_highestAllowed = 7000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .3f); modelTransposition = DiscModelParams_Cn.ModelTransposition.none; ampGlobal = 1f; break; case 8: funds_harmonicity = .97f; funds_lowest = 500.0f; funds_highestAllowed = 1500.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = 1.3f; parts_highestAllowed = 6000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .5f); modelTransposition = DiscModelParams_Cn.ModelTransposition.noneOrOneOctaveLower; ampGlobal = 1f; break; case 9: funds_harmonicity = 1.04f; funds_lowest = 200.0f; funds_highestAllowed = 1000.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = 1.2f; parts_highestAllowed = 4000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .8f); modelTransposition = DiscModelParams_Cn.ModelTransposition.noneOrOneOctaveHigher; ampGlobal = 1.1f; break; case 10: funds_harmonicity = .97f; funds_lowest = 410.0f; funds_highestAllowed = 1000.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = .9f; parts_highestAllowed = 2500.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .8f); modelTransposition = DiscModelParams_Cn.ModelTransposition.noneOrOneOctaveHigher; ampGlobal = .6f; break; case 11: funds_harmonicity = .55f; funds_lowest = 410.0f; funds_highestAllowed = 1000.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = .5f; parts_highestAllowed = 2000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .5f); modelTransposition = DiscModelParams_Cn.ModelTransposition.noneOrOneOctaveLower; ampGlobal = 2.5f; break; case 12: funds_harmonicity = .4f; funds_lowest = 150.0f; funds_highestAllowed = 600.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = .7f; parts_highestAllowed = 2000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .9f); modelTransposition = DiscModelParams_Cn.ModelTransposition.noneOrOneOctaveHigher; ampGlobal = 3f; break; case 13: funds_harmonicity = .968f; funds_lowest = 130.0f; funds_highestAllowed = 600.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = .5f; parts_highestAllowed = 1000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .2f); modelTransposition = DiscModelParams_Cn.ModelTransposition.none; ampGlobal = 5.5f; break; case 14: // too large? funds_harmonicity = .94f; funds_lowest = 110.0f; funds_highestAllowed = 600.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = .5f; parts_highestAllowed = 1000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .2f); modelTransposition = DiscModelParams_Cn.ModelTransposition.none; ampGlobal = 5.5f; break; case 15: funds_harmonicity = .91f; funds_lowest = 90.0f; funds_highestAllowed = 400.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = .5f; parts_highestAllowed = 1000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .1f); modelTransposition = DiscModelParams_Cn.ModelTransposition.none; ampGlobal = 10.5f; break; case 16: funds_harmonicity = .45f; funds_lowest = 90.0f; funds_highestAllowed = 300.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = .5f; parts_highestAllowed = 1000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .5f); modelTransposition = DiscModelParams_Cn.ModelTransposition.none; ampGlobal = 9.5f; break; case 17: funds_harmonicity = .25f; funds_lowest = 87.0f; funds_highestAllowed = 300.0f; funds_MIDIdeviation_range = 0f; parts_harmonicity = .5f; parts_highestAllowed = 1000.0f; parts_include_prob = .6f; lightFlareEvent_shimmer_percentOfCriticalBandRange = new Vector2(0.0f, .95f); modelTransposition = DiscModelParams_Cn.ModelTransposition.none; ampGlobal = 11.5f; break; } } // above we define all the local vars and then assign it to our DiscModelParams class ( which have the same names ) // the DiscModelParams class is the container to return all this shit to to the MakeDiscsModel script discModelParams = new DiscModelParams_Cn { funds_harmonicity = funds_harmonicity, funds_deformation = funds_deformation, funds_size = funds_size, funds_lowest = funds_lowest, funds_highestAllowed = funds_highestAllowed, funds_MIDIdeviation_range = funds_MIDIdeviation_range, parts_harmonicity = parts_harmonicity, parts_deformation = parts_deformation, parts_size = parts_size, parts_highestAllowed = parts_highestAllowed, parts_MIDIdeviation_range = parts_MIDIdeviation_range, parts_include_prob = parts_include_prob, lightFlareEvent_shimmer_percentOfCriticalBandRange = lightFlareEvent_shimmer_percentOfCriticalBandRange, modelTransposition = modelTransposition, ampGlobal = ampGlobal }; return(discModelParams); }
void Beatings_FlareEvent() { // we'll add extra tones to the model list, to create beatings / interest / shimmer around each fundamental and partial // **** we only generate the extra frequencies once, on event On - this isn't an evolving list of F, A, D **** lightFlareEvent_freqs = new List <float>(modelFreqs); // <-- for troubleshooting InstantiateOscAddrs_FlareEvent(); discModelParams = makeDiscsModel_script.discModelParams; sc_lightFlareEvent_shimmer_percentOfCriticalBandRange = discModelParams.lightFlareEvent_shimmer_percentOfCriticalBandRange; foreach (float freq in modelFreqs) { osc_freqsFlare.Add(freq); } foreach (float amp in modelAmps) { osc_ampsFlare.Add(amp); } foreach (float decay in modelDecays) { osc_decaysFlare.Add(decay); } for (int f = 0; f < modelFreqs.Count; f++) { criticalBand = 24.7f * ((0.00437f * modelFreqs[f]) + 1); half_criticalBand = criticalBand / 2; // fundamental - add three extra tones if (f == 0) { for (int e = 0; e < 3; e++) { percentOfCriticalBand = Random.Range(sc_lightFlareEvent_shimmer_percentOfCriticalBandRange[0], sc_lightFlareEvent_shimmer_percentOfCriticalBandRange[1]); percentOfCriticalBandFreq = modelFreqs[f] + (percentOfCriticalBand * half_criticalBand); osc_freqsFlare.Add(percentOfCriticalBandFreq); osc_ampsFlare.Add(RandomAmp("louder", aud_lightEventType)); osc_decaysFlare.Add(RandomDecay("slower")); // for debug: lightFlareEvent_freqs.Add(percentOfCriticalBandFreq); // lightFlareEvent_amps.Add( RandomAmp( "louder" ) ); // lightFlareEvent_decays.Add( RandomDecay( "slower" ) ); } } // upper partials - add two extra tones each else { for (int e = 0; e < 2; e++) { percentOfCriticalBand = Random.Range(sc_lightFlareEvent_shimmer_percentOfCriticalBandRange[0], sc_lightFlareEvent_shimmer_percentOfCriticalBandRange[1]); percentOfCriticalBandFreq = modelFreqs[f] + (percentOfCriticalBand * half_criticalBand); osc_freqsFlare.Add(percentOfCriticalBandFreq); osc_ampsFlare.Add(RandomAmp("softer", aud_lightEventType)); osc_decaysFlare.Add(RandomDecay("faster")); lightFlareEvent_freqs.Add(percentOfCriticalBandFreq); } } } }