GithubHelp home page GithubHelp logo

tomeyro / godot-sfxr Goto Github PK

View Code? Open in Web Editor NEW
164.0 164.0 10.0 290 KB

Godot plugin that adds the SfxrStreamPlayer node to generate sound effects inside the editor.

License: MIT License

GDScript 100.00%

godot-sfxr's People

Contributors

tomeyro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

godot-sfxr's Issues

Export samples to a WAV cache folder and reference it instead of embedding it in the scene file

The current implementation (creating a AudioStreamSample and embedding it in the scene along the SFXR node) is pretty useful, but reading the generated long PoolByteArray for each sound might be slow if the game uses dozens or hundreds of sounds.

Godot (specially 3.x), is not really fast reading TSCN files, as it expects TSCN files to use references to actual binary resource files instead of embedding them. It currently reads them byte by byte, and in low-end platforms this way of reading files really impacts the loading times.

I would suggest exporting the WAV samples to a sfxr_cache folder and referencing the saved samples instead of embedding them.

This can be done by:

  • Creating a sfxr_cache folder
  • Creating a hash of the sfxr parameters and use that hash as name of the WAV file.
  • Using AudioStreamSample.save_to_wav() to save the WAV file.
  • Using AudioStreamSample.resource_path to reference that WAV file.

I tried to do my self, but ended doing the last step manually as changing the resource_path threw some redundancy errors
(ERROR: Another resource is loaded from path: XXXXX (possible cyclic resource inclusion))

Add ability to import and export .sfxr files

It would be nice if we could import and export .sfxr and/or .jsfxr files so we could work the sounds outside Godot, then import when done. Exporting would be great as well, for compatibility purposes.

Setting a long decay (extending the sample) creates sounds slowly.

Perhaps the module could perform some automatic pitch & frequency modulation, as Godot can quite easily slow down a sample to play it longer.

To reproduce:

  1. Create a SfxrStreamPlayer
  2. Set decay_time to 1.0
  3. Click play

The sound on my machine takes quite a while to generate.

However if I raise the frequency of the generated sound, and then use a much shorter delay, I can use the godot built in pitch_scale to slow the sound down to get what I want without any delay.

  1. Create a SfxrStreamPlayer
  2. Set decay_time to 0.2
  3. Set pitch_scale (Default AudioStreamPlayer) to 0.2

You will get a much lower pitched sound that generates very quickly.

Doesn't work in Godot 4.0.1 stable

After loading in the addon from the repo and enabling it, correctly creates the Sfxr audio stream node, but using the audio stream node has none of the special properties, it acts like a regular audio node as in the screenshot below.

image

How to call `_build_buffer` before a node has been generated?

Awesome project ๐Ÿค— I've been waiting for something like this for a long time.

Since in Godot everything is a node, it would be nice to spawn an instance of a node, but have it buffer the sound when it's loaded instead of at the instance time.

Any idea of how to go about that?

SfxrStreamPlayer2D/3D?

I know you can save the generated stream and use it in another node, but dedicated nodes for positional playback of a generated Sfxr stream might be a good idea.

Port to resource

Having separate nodes seems a bit redundant, wouldn't it be better for it to be a AudioStream resource, for less clutter and compatibility with other custom stream players?

GDNative to generate samples faster

This plugin is great but it's not productive for me because generating samples is too slow.

I made generating the sample instant more or less using GDNative C++. I can open a pr? Or will just fork into my own addon if you don't feel like complicating it.

fast2.mp4

Save audio for later use

Do you think it would be possible to save the audio generate as a file or a resource to be used later? It could be super useful and interesting for performances reasons for example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.