| 814 | // https://github.com/grumdrig/jsfxr/blob/master/sfxr.js |
| 815 | |
| 816 | void SfxrNode::setDefaultBeep() |
| 817 | { |
| 818 | // Wave shape |
| 819 | _waveType->setEnumeration(SQUARE); |
| 820 | |
| 821 | // Envelope |
| 822 | _attack->setValue(0); |
| 823 | _sustainTime->setValue(0.3f); |
| 824 | _sustainPunch->setValue(0); |
| 825 | _decayTime->setValue(0.4f); |
| 826 | |
| 827 | // Tone |
| 828 | _startFrequency->setValue(0.3f); |
| 829 | _minFrequency->setValue(0); |
| 830 | _slide->setValue(0); |
| 831 | _deltaSlide->setValue(0); |
| 832 | |
| 833 | // Vibrato |
| 834 | _vibratoDepth->setValue(0); |
| 835 | _vibratoSpeed->setValue(0); |
| 836 | |
| 837 | // Tonal change |
| 838 | _changeAmount->setValue(0); |
| 839 | _changeSpeed->setValue(0); |
| 840 | |
| 841 | // Square wave duty (proportion of time signal is high vs. low) |
| 842 | _squareDuty->setValue(0); |
| 843 | _dutySweep->setValue(0); |
| 844 | |
| 845 | // Repeat |
| 846 | _repeatSpeed->setValue(0); |
| 847 | |
| 848 | // Flanger |
| 849 | _phaserOffset->setValue(0); |
| 850 | _phaserSweep->setValue(0); |
| 851 | |
| 852 | // Low-pass filter |
| 853 | _lpFilterCutoff->setValue(1); |
| 854 | _lpFilterCutoffSweep->setValue(0); |
| 855 | _lpFilterResonance->setValue(0); |
| 856 | _hpFilterCutoff->setValue(0); |
| 857 | _hpFilterCutoffSweep->setValue(0); |
| 858 | |
| 859 | // Sample parameters |
| 860 | sfxr->sound_vol = 0.5f; |
| 861 | sfxr->wav_freq = 44100; |
| 862 | sfxr->wav_bits = 16; |
| 863 | } |
| 864 | |
| 865 | void SfxrNode::coin() |
| 866 | { |
no test coverage detected