-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compatibility for JSFXR and/or CFXR #2
Comments
Would it be possible to edit and/or view numerical values next to the sliders? It would really help with fine-tuning inside the editor. Thanks! |
@philippedcote Thanks for your support :) I made the sliders to display current value when hovered. And you can now hold CTRL to snap the value to 0.01 increments while dragging. See the current master branch (2a73615). Using a slider similar to the one Inspector uses might be the way to go if we need more precise value editing. |
@timothyqiu Sure, you’re welcome! :) Wow, thanks for this. However, if I want to type in the value directly inside a field, would that be possible? |
That could be done. But I'm not sure how to arrange the UI. I'll work on this over the weekend. |
@philippedcote I've implemented a custom slider which allows to type in the value directly after clicked, like in Blender 🎉 |
Got the chance to try it today. That’s very nice, great work! I noticed something missing, though. Would it be possible to edit the kHz (44, 22, 11, 8kHz) and Bit (16, 8-Bit) values as well? Because it changes the texture of the sound, some sounds can only be produced by playing with those values. Thanks! :) |
@timothyqiu would you be interested on working together on getting https://sfxr.me exported base58 or JSON to be loadable into Gdfxr? Here's an example of the base58 encoded sound:
Here's the JSON representation: {
"oldParams": true,
"wave_type": 1,
"p_env_attack": 0,
"p_env_sustain": 0.316476047039032,
"p_env_punch": 0,
"p_env_decay": 0.37630516290664673,
"p_base_freq": 0.2605574131011963,
"p_freq_limit": 0,
"p_freq_ramp": 0.4602612853050232,
"p_freq_dramp": 0,
"p_vib_strength": 0,
"p_vib_speed": 0,
"p_arp_mod": 0,
"p_arp_speed": 0,
"p_duty": 1,
"p_duty_ramp": 0,
"p_repeat_speed": 0.663515031337738,
"p_pha_offset": 0,
"p_pha_ramp": 0,
"p_lpf_freq": 1,
"p_lpf_ramp": 0,
"p_lpf_resonance": 0,
"p_hpf_freq": 0,
"p_hpf_ramp": 0,
"sound_vol": 0.25,
"sample_rate": 44100,
"sample_size": 8
} You can hear the corresponding sound here: |
@chr15m The B58 string contains the same fields as the original sfxr (according to this). After base58 decoding, all you have to do is fill in the corresponding fields in gdfxr/addons/gdfxr/SFXRConfig.gd Lines 21 to 52 in 9acce6b
gdfxr/addons/gdfxr/editor/Editor.gd Line 153 in 9acce6b
The JSON representation is basically the same. But it contains extra fields about sample rate and sample size. These two are currently hardcoded 44100 and 8 in gdfxr. I'll try adding support for changing sample rate and sample size when I have spare time. But feel free to open an Pull Request if you're interested :) |
Super cool, thanks for sharing. I will document this and see if I can make the process any smoother. Maybe with the help of @philippedcote I can even generate GDSCript code that a developer can copy-paste into their project, or download a .gd file containing all of the sounds already initialized. 🤔 |
I think copy-pasting the base58 code into gdfxr is a good idea. I can try adding one as it's relatively simple. Generating long sounds on the fly using GDScript might take some time, e.g. explosions. This is a performance limitation of GDScript. But the user can cache it at the beginning of the game I guess. |
If it's possible to provide me with a .gd example script showing how to render a sound using Gdfxr so it's ready to play and the user can just call e.g. Only if you have time though, I can work it out myself it will just take me a bit longer. 😅 |
I've implemented "Paste from jsfxr" so users can now paste the base58 code from jsfxr directly into the editor 🎉 I also modified the example scene to show how to generate the sound effect on the fly from the base58 code. Lines 20 to 38 in 5b910af
|
🤯 Whoa this is awesome, thank you! I'll add a link to Gdfxr. |
Compatibility with SFXR is great! However, it is not compatible with macOS. It would be nice if we could use the output generated by JSFXR and/or CFXR. Thanks!
The text was updated successfully, but these errors were encountered: