MCPcopy Create free account
hub / github.com/LabSound/LabSound / powerUp

Method powerUp

src/extended/SfxrNode.cpp:965–995  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

963}
964
965void SfxrNode::powerUp()
966{
967 setDefaultBeep();
968 if (rnd(1))
969 {
970 _waveType->setEnumeration(SAWTOOTH);
971 _squareDuty->setValue(1);
972 }
973 else
974 {
975 _squareDuty->setValue(frnd(0.6f));
976 }
977 _startFrequency->setValue(0.2f + frnd(0.3f));
978 if (rnd(1))
979 {
980 _slide->setValue(0.1f + frnd(0.4f));
981 _repeatSpeed->setValue(0.4f + frnd(0.4f));
982 }
983 else
984 {
985 _slide->setValue(0.05f + frnd(0.2f));
986 if (rnd(1))
987 {
988 _vibratoDepth->setValue(frnd(0.7f));
989 _vibratoSpeed->setValue(frnd(0.6f));
990 }
991 }
992 _attack->setValue(0);
993 _sustainTime->setValue(frnd(0.4f));
994 _decayTime->setValue(0.1f + frnd(0.4f));
995}
996
997/// @TODO remove need for context lock see above
998void SfxrNode::hit()

Callers 1

SfxrNodeMethod · 0.95

Calls 4

rndFunction · 0.85
frndFunction · 0.85
setEnumerationMethod · 0.80
setValueMethod · 0.80

Tested by

no test coverage detected