Coder Social home page Coder Social logo

Comments (6)

nevyn avatar nevyn commented on June 14, 2024

It's almost the exact same as Random… Or is there some subtle difference I'm missing?

from cfxr.

leberwurstsaft avatar leberwurstsaft commented on June 14, 2024

Yes, the difference is simply that Random just randomizes everything and choses from all the "categories" of sounds as well. Whereas Mutate alters the current settings just slightly, kind of as in genetic algorithms, only without the fitness function, of course. So if you start off with some Coin-Pickup sound, and hit mutate repeatedly you'll get sounds that slowly deviate away from the original, but still all within reasonable range.

Thats useful for when you have a nice starting point and need some more sounds that are similar and kind of form a family of sounds. Of course, one may get there by using the sliders after a good starting point is found, but I come from a non-insider position and don't have the patience to try and understand all of the sliders effects. Thats why I came to love the mutate function, which is also in sfxr for the iPhone :)

from cfxr.

TrevorSayre avatar TrevorSayre commented on June 14, 2024

I just wanted to add my voice to this desire. I would also like to see the mutate functionality from sfxr on cfxr.

from cfxr.

gingerbeardman avatar gingerbeardman commented on June 14, 2024

I'd also love to see this.

If anybody can show me code for Mutate in another port I will have a go at adding it myself.

from cfxr.

TrevorSayre avatar TrevorSayre commented on June 14, 2024

The source for sfxr is here:
http://code.google.com/p/sfxr/

from cfxr.

leberwurstsaft avatar leberwurstsaft commented on June 14, 2024

The mutate code is pretty straightforward. It simply adds anywhere between -0.05 and 0.05 to the parameters, with an extra 0.5 probability of not touching a parameter.

if(Button(5, 382, false, "MUTATE", 30))
        {
                if(rnd(1)) p_base_freq+=frnd(0.1f)-0.05f;
//              if(rnd(1)) p_freq_limit+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_freq_ramp+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_freq_dramp+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_duty+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_duty_ramp+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_vib_strength+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_vib_speed+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_vib_delay+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_env_attack+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_env_sustain+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_env_decay+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_env_punch+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_lpf_resonance+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_lpf_freq+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_lpf_ramp+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_hpf_freq+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_hpf_ramp+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_pha_offset+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_pha_ramp+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_repeat_speed+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_arp_speed+=frnd(0.1f)-0.05f;
                if(rnd(1)) p_arp_mod+=frnd(0.1f)-0.05f;
                do_play=true;
        }

from cfxr.

Related Issues (5)

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.