MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Poll

Method Poll

Source/ChaosEngine.cpp:96–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void ChaosEngine::Poll()
97{
98 double chaosTimeLeft = mChaosArrivalTime - gTime;
99 if (chaosTimeLeft > 0)
100 {
101 if (chaosTimeLeft > ofRandom(-1000, 3000))
102 {
103 if (mTotalChaos)
104 TheTransport->SetTimeSignature(gRandom() % 8 + 2, (int)powf(2, gRandom() % 3 + 2));
105
106 TheScale->SetRoot(gRandom() % TheScale->GetPitchesPerOctave());
107 TheScale->SetRandomSeptatonicScale();
108 float bias = ofRandom(0, 1);
109 bias *= bias;
110 TheTransport->SetTempo(ofMap(bias, 0.0f, 1.0f, 55.0f, 170.0f));
111 }
112 }
113}
114
115void ChaosEngine::AudioUpdate()
116{

Callers

nothing calls this directly

Calls 7

ofRandomFunction · 0.85
ofMapFunction · 0.85
SetTimeSignatureMethod · 0.80
SetRootMethod · 0.80
GetPitchesPerOctaveMethod · 0.80
SetTempoMethod · 0.80

Tested by

no test coverage detected