Release Notes for 648

I’m not sure what the returned data looks like for that method, but generating that shouldn’t be too hard.

All you have to do is get the amplitude a

function waveSize(frequencies, amplitudes, time)
    local result = 0

    for i = 1, #frequencies do
        local freq = frequencies[i]
        local amp = amplitudes[i]

        --[[
            explanation:
            sine waves can be positive or negative depending on time t. All we need to
            do is get the value of the sine wave at time t and add it to the total
        ]]
        result = result + amp * math.sin(freq * time)
    end

    return result
end

Here’s a game link to showcase this (uncopylocked):

6 Likes

Hey @metatablecatmaid – the API takes a timeRange as a NumberRange, and a desired number of samples – the result is a table containing up to samples volume levels spanning the timeRange

I don’t think any sine math should be necessary; just iterating over the table can visualize the waveform pretty directly; e.x. this is rbxasset://sounds/uuhhh.mp3 :sweat_smile:


(but only displaying half the waveform because I’m bad at UDim2s)

We might iterate on the API a little bit before enabling it, so if you try it out and have any feedback don’t hesitate to let me know!

6 Likes

How do we use editable images now?
image

1 Like

Nvm figured it out

3 Likes

image

i think i got it, but something doesn’t feel right here, I wonder if its possible to take a multiple of the width then just return the max and min from the bin?

EDIT: this looks cool enough

7 Likes

math.map great feature.

Neither of these things are drawbacks for a scripting language. This isn’t rust. The idea of adding “bloat” to the API is very counter productive, it makes it so developers need to be writing the same functions over and over and over again and makes it more likely for new developers to make mistakes. These functions should be added for convenience not out of necessity

8 Likes

One of the design choices behind vanilla Lua was that if you can do it in Lua and there isn’t a large performance improvement from doing it in C, it doesn’t need to be added to the standard library.

I dont agree with this design approach at all because a lot of things are cleanly implemented in C++ and its easier to just expose a userdata or function to it rather than making the developer pick up the mantle and do it themselves.

4 Likes


This is amazing! Audio updates keeping coming out and surprising me, and I’m all for it.

I remember trying to do this with Sounds years ago and giving up after a few hours… I’m seriously looking forwards to implementing this in my Audio plugin with ease!

5 Likes

Woooo we finally get a map command after 6 years!

3 Likes

Developers can share and reuse Luau code between each other, that’s how most of the software development goes.

4 Likes

Roblox doesn’t even support git, thats not a valid reason. Developing software on Roblox is nothing like developing software for any other language. The point is to make it as easy as possible for developers to create high quality games. Holding back on adding more utility functions just because of bloat, all it does is make it harder to create high quality games. What is the benefit of not adding these functions, you see too many things in autofill?

3 Likes

What is SandboxedInstanceMode?
image

3 Likes

I believe it’s related to Open Cloud Tasks, I started seeing stuff seemingly related to sandboxing around the time they were announced.

2 Likes

The point is for the developers to share useful libraries without limitations placed by Roblox on what they contain.
These problems are solved by code sharing and reuse and not by waiting for Roblox to add specific built-in functionality.

7 Likes

sure but roblox adding builtin functionality doesnt have any drawbacks and is probably faster then a lua implementation

4 Likes

What is the content property and where do you use it?

1 Like
4 Likes

You can use it to convert between Fahrenheit and Celsius, for example.

local fahrenheit: number = 69
local celsius: number = math.map(fahrenheit, 32, 212, 0, 100)
print(celsius) --> 20.555...
3 Likes

I might’ve misread but what’s the point of suddenly throwing an error if you use actors in plugins? The crash was a bug with pretty specific circumstances. I hope that’s not what this says. It doesn’t matter if it wasn’t “officially” supported, it’s been a thing for quite some time and a lot of my plugins out there rely on this and will completely break with this change, and if I fix them to take the actors out - well then the plugins will relatively suck.

I hope I misread because I know Roblox is all about not breaking stuff developers rely on :grin: support for actors in plugins shouldn’t just suddenly disappear

2 Likes

This is a beta feature for sandboxed script containers, see Script Capabilities Preview [Client Beta]

1 Like