@TODO the audioParams should be read into buffers in the case that they are time varying
| 879 | |
| 880 | /// @TODO the audioParams should be read into buffers in the case that they are time varying |
| 881 | void SfxrNode::laser() |
| 882 | { |
| 883 | setDefaultBeep(); |
| 884 | _waveType->setEnumeration(rnd(2)); |
| 885 | if (_waveType->valueUint32() == SINE && rnd(1)) |
| 886 | _waveType->setEnumeration(rnd(1)); |
| 887 | if (rnd(2) == 0) |
| 888 | { |
| 889 | _startFrequency->setValue(0.3f + frnd(0.6f)); |
| 890 | _minFrequency->setValue(frnd(0.1f)); |
| 891 | _slide->setValue(-0.35f - frnd(0.3f)); |
| 892 | } |
| 893 | else |
| 894 | { |
| 895 | ContextRenderLock r(nullptr, "laser"); |
| 896 | /// @fixme these values should be per sample, not per quantum |
| 897 | /// -or- they should be settings if they don't vary per sample |
| 898 | _startFrequency->setValue(0.5f + frnd(0.5f)); |
| 899 | _minFrequency->setValue(_startFrequency->value() - 0.2f - frnd(0.6f)); |
| 900 | if (_minFrequency->value() < 0.2f) _minFrequency->setValue(0.2f); |
| 901 | _slide->setValue(-0.15f - frnd(0.2f)); |
| 902 | } |
| 903 | if (rnd(1)) |
| 904 | { |
| 905 | _squareDuty->setValue(frnd(0.5f)); |
| 906 | _dutySweep->setValue(frnd(0.2f)); |
| 907 | } |
| 908 | else |
| 909 | { |
| 910 | _squareDuty->setValue(0.4f + frnd(0.5f)); |
| 911 | _dutySweep->setValue(-frnd(0.7f)); |
| 912 | } |
| 913 | _attack->setValue(0); |
| 914 | _sustainTime->setValue(0.1f + frnd(0.2f)); |
| 915 | _decayTime->setValue(frnd(0.4f)); |
| 916 | if (rnd(1)) |
| 917 | _sustainPunch->setValue(frnd(0.3f)); |
| 918 | if (rnd(2) == 0) |
| 919 | { |
| 920 | _phaserOffset->setValue(frnd(0.2f)); |
| 921 | _phaserSweep->setValue(-frnd(0.2f)); |
| 922 | } |
| 923 | _hpFilterCutoff->setValue(frnd(0.3f)); |
| 924 | } |
| 925 | |
| 926 | void SfxrNode::explosion() |
| 927 | { |
no test coverage detected