Search found 64 matches

by HDPLocust
Sun Feb 16, 2020 9:23 am
Forum: Libraries and Tools
Topic: [LIB] utf8string
Replies: 9
Views: 4563

Re: [LIB] utf8string

Functions like "lower" and "upper" can be seriously optimized like this: local _l = function(c) return tolower[c] or c end local newlower = function(str) return str:gsub(utf8_charpattern, _l) end The simple bench with this optimisation gives me this results: local function check(msg, func) local t =...
by HDPLocust
Sun Feb 16, 2020 8:22 am
Forum: Games and Creations
Topic: Simple FFT demo
Replies: 8
Views: 5060

Re: Simple FFT demo

using the absolute lowest quality algorithm in existence The specific algorithm does not matter, since it can be changed at any time. I am primarily interested in functional analysis itself. Including the reduction of the samples. Also, thanks to this, you can make almost any sound look like an eig...
by HDPLocust
Sun Feb 16, 2020 4:26 am
Forum: Games and Creations
Topic: Simple FFT demo
Replies: 8
Views: 5060

Re: Simple FFT demo

since one calling :decode() already "extracts the specific samples" from the file itself "Specific" means "we can skip samples". Our music has 44100 samples per second, so max displayed freq is ~44100. Windows size defines minimal frequency that can be catched. But if we skip some samples, we can d...
by HDPLocust
Fri Feb 14, 2020 5:01 pm
Forum: Games and Creations
Topic: Simple FFT demo
Replies: 8
Views: 5060

Re: Simple FFT demo

The FFT result seems incorrect Thanks for the explanation. Currently, I have some problems with functional analysis, and I would love to read additional materials. In addition, this post is still promoting sound analysis stuff, so if someone is interested and wants to start doing better things, my ...
by HDPLocust
Fri Feb 14, 2020 12:58 pm
Forum: Games and Creations
Topic: Lissajous curves
Replies: 2
Views: 3109

Re: Lissajous curves

Cool math correctness!


Image
by HDPLocust
Fri Feb 14, 2020 12:13 pm
Forum: Games and Creations
Topic: Simple FFT demo
Replies: 8
Views: 5060

Simple FFT demo

This is not very optimised (FFI FFT preferred), but looks cool and has a basics for realtime sound analysis. (this post is a promotion of sound analysis in Lua+LÖVE) https://sun9-9.userapi.com/c857420/v857420288/1758f8/u8YEkwTvdtU.jpg UPD: FFT v0.2 is looks ok and (probably) normalized, but lowfreq ...
by HDPLocust
Sat Feb 08, 2020 7:44 am
Forum: Support and Development
Topic: Calling C dll from love2d
Replies: 11
Views: 3531

Re: Calling C dll from love2d

On windows you should use __declspec(dllexport). Minimal crossplatfom library looks like this. #include "lua/lua.h" #include "lua/lauxlib.h" int lua_summ(lua_State *L){ double a = luaL_checknumber(L, 1); /* get first arg */ double b = luaL_checknumber(L, 2); /* get second arg */ lua_pushnumber(L, a ...
by HDPLocust
Wed Jan 08, 2020 3:44 am
Forum: Support and Development
Topic: Selecting multiple functions in one class depending on the modificator/table index
Replies: 5
Views: 2563

Re: Selecting multiple functions in one class depending on the modificator/table index

raidho36 wrote:
Tue Jan 07, 2020 3:27 pm
but having to navigate up the metatable tree is rather costly.
Not as costly as it seems.
Image

Just do not make >3-5 layers of abstractions.
by HDPLocust
Tue Jan 07, 2020 8:03 am
Forum: Support and Development
Topic: Is it possible to make a file explorer?
Replies: 6
Views: 2126

Re: Is it possible to make a file explorer?

It's simple task using ffi-luafilesystem reimplementation like this: https://github.com/3scale/luafilesystem ... fs_ffi.lua.
No binaries, also it can read/write utf8-names instead of default lfs on windows, that can be very useful.
by HDPLocust
Tue Jan 07, 2020 7:57 am
Forum: Support and Development
Topic: [SOLVED] How do I import files from specific folder in the game directory?
Replies: 5
Views: 2453

Re: [SOLVED] How do I import files from specific folder in the game directory?

You sould use [\\] (it's regular backslash character). Backslash is the escape character in lua strings: print("Backslash is here \\") --> Backslash is here \ Also multiline/unescaped strings can be achived with [[]] syntax: print([[Backslash is here \]]) --> Backslash is here \ Backslash is used fo...