Search found 3087 matches

by zorg
Tue Apr 20, 2021 7:14 pm
Forum: Support and Development
Topic: [SOLVED] Changing frequency while synthesising sine wave
Replies: 7
Views: 1253

Re: [SOLVED] Changing frequency while synthesising sine wave

I checked the post of mine from the thread you linked, and i got it wrong there as well... guess i'll take the blame fair and square. :D
by zorg
Tue Apr 20, 2021 5:34 am
Forum: Support and Development
Topic: [SOLVED] Changing frequency while synthesising sine wave
Replies: 7
Views: 1253

Re: Changing frequency while synthesising sine wave

>Would that just be replacing the x declaration in the returned function with <code> Yes, it would... i feel like something else is amiss, but again, i'd need to dwelve into it, and due to me working today, that's not gonna happen. I did notice that you did multiply with sound.rate in your code, so ...
by zorg
Tue Apr 20, 2021 3:47 am
Forum: Support and Development
Topic: [SOLVED] Changing frequency while synthesising sine wave
Replies: 7
Views: 1253

Re: Changing frequency while synthesising sine wave

Haven't had time yet to look at it too much, but one thing you might try is to limit the phase in the returned generator function to the range/domain (i get these mixed up) of [0,1] with something like: phase = (phase + increment) % 1.0 ...that said, i haven't noticed you dividing x by the sample ra...
by zorg
Sat Apr 17, 2021 8:07 am
Forum: Support and Development
Topic: Why doesn't Font.getHeight() work the same as Font.getWidth()?
Replies: 3
Views: 953

Re: Why doesn't Font.getHeight() work the same as Font.getWidth()?

The difference is a basic property of typography. The font size actually is the height of a capital letter in points (...) the height is fixed. On the other hand, the width of a line of text is based on the characters typed (...) Just as an aside, this is only true for LtR and RtL languages (and i ...
by zorg
Sun Apr 11, 2021 11:44 am
Forum: General
Topic: Checking if anyone has got JUMPER to work recently?
Replies: 8
Views: 912

Re: Checking if anyone has got JUMPER to work recently?

What you described sounds right and it was a pathway I serially considered before finding the love wiki version worked immediately for reasons I still don't understand. ... Edit: I've tested the program in README and the ones in the examples/ subdirectory. They all work for me. By contrast, the one...
by zorg
Sun Apr 11, 2021 9:40 am
Forum: Support and Development
Topic: If statement and Goto
Replies: 38
Views: 6066

Re: If statement and Goto

Yeah, I probably would not use this either. This certainly works, but this example suffers from " magic values ", and it adds a level of indirection that doesn't add to readability or reliability. At the very least, if you wanted to use a system like this, you should add some constants fo...
by zorg
Fri Apr 09, 2021 6:06 pm
Forum: Support and Development
Topic: Multidimentional arrays/Tables
Replies: 14
Views: 1830

Re: Multidimentional arrays/Tables

Almost.

for i=1,10 would cope with it in terms of returning nil on the item.

ipairs would stop iterating on the first gap.

you decide which is worse, having one gap, or an arbitrary part of the map missing. :3

(that said, due to we're using nested tables, it's of course a bit more complicated)
by zorg
Fri Apr 09, 2021 11:23 am
Forum: Support and Development
Topic: Multidimentional arrays/Tables
Replies: 14
Views: 1830

Re: Multidimentional arrays/Tables

Hypothetically, for education sake, to redraw those images in a 10x10 grid, is it safe to use integer indexes? I assume using ipairs is more robust if an index is deleted? safe how? the example already used integer indices... or do you mean just using a 1D array instead? ipairs will also be worse i...
by zorg
Fri Apr 09, 2021 7:47 am
Forum: Support and Development
Topic: Multidimentional arrays/Tables
Replies: 14
Views: 1830

Re: Multidimentional arrays/Tables

I think that is a fine way of doing it, and yes, lua (the language löve gives you to use) expects you to define all inner tables you want to use, after all, you can't index nothing. You could write a small helper function to define them for you, but having images[ i ] = {} in the outer loop is not t...
by zorg
Thu Apr 08, 2021 9:58 am
Forum: Support and Development
Topic: File paths: I've tried everything
Replies: 13
Views: 902

Re: File paths: I've tried everything

Works on my pc too, with win7 so i couldn't reproduce the issue... though the exclusive fullscreen thing did scare the hell out of me.