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

Method hit

src/extended/SfxrNode.cpp:998–1015  ·  view source on GitHub ↗

@TODO remove need for context lock see above

Source from the content-addressed store, hash-verified

996
997/// @TODO remove need for context lock see above
998void SfxrNode::hit()
999{
1000 setDefaultBeep();
1001 _waveType->setEnumeration(rnd(2));
1002 if (_waveType->valueUint32() == SINE)
1003 _waveType->setEnumeration(NOISE);
1004 if (_waveType->valueUint32() == SQUARE)
1005 _squareDuty->setValue(frnd(0.6f));
1006 if (_waveType->valueUint32() == SAWTOOTH)
1007 _squareDuty->setValue(1);
1008 _startFrequency->setValue(0.2f + frnd(0.6f));
1009 _slide->setValue(-0.3f - frnd(0.4f));
1010 _attack->setValue(0);
1011 _sustainTime->setValue(frnd(0.1f));
1012 _decayTime->setValue(0.1f + frnd(0.2f));
1013 if (rnd(1))
1014 _hpFilterCutoff->setValue(frnd(0.3f));
1015}
1016
1017void SfxrNode::jump()
1018{

Callers 1

SfxrNodeMethod · 0.95

Calls 5

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

Tested by

no test coverage detected