GithubHelp home page GithubHelp logo

Comments (5)

flibitijibibo avatar flibitijibibo commented on August 16, 2024

I think it depends on the curve type, but at the moment we only do linear anyway so this is definitely a problem. If you want to dig through the curve data calclulation yourself:

Data parsing: https://github.com/FNA-XNA/FNA/blob/master/src/Audio/AudioEngine.cs#L300

Actual Math: https://github.com/FNA-XNA/FNA/blob/master/src/Audio/XACTInternal.cs#L233

My guess is it's line 250 that just needs to be capped, but mess around with the curves a bit in the tool and see what the outer bounds should do.

from fna.

teamtwentythree avatar teamtwentythree commented on August 16, 2024

Maybe I'm not thinking of something, but I think 236->254 becomes the following. No need to special case 0 since it'll fall somewhere in the range anyway (Which seems bound from 0-X, but even if not it should be fine). For before the first point and after the last it would just be the value of the nearest point.

            // TODO: Non-linear curves
            if (varInput <= Points[0].X)
            {
                // Zero to first defined point
                return Points[0].Y;
            }
            else if (varInput >= Points[Points.Length - 1].X)
            {
                // Last defined point to infinity
                return Points[Points.Length - 1].Y;
            }
            else
            {

from fna.

flibitijibibo avatar flibitijibibo commented on August 16, 2024

Give it a try locally, if it works I'll go ahead and write that in.

from fna.

teamtwentythree avatar teamtwentythree commented on August 16, 2024

Yea, this fix is working for us.

from fna.

flibitijibibo avatar flibitijibibo commented on August 16, 2024

414fb16

from fna.

Related Issues (20)

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.