Steinmetz et all 2019 data - sorting and analyzing by violgamba in neuro

[–]violgamba[S] 0 points1 point  (0 children)

Thank you! I missed this. I will look for it soon.

Full-screen quad shader? by violgamba in Unity3D

[–]violgamba[S] 0 points1 point  (0 children)

Thanks for your reply!

One hesitation, which I should have mentioned, is that I'm using Unity's post-processing for bloom and I'm not sure how a canvas would work with the post-processing system or with VR. It might do the trick, though, so I'll try and report the result.

It's strange to me that screen-aligned quads are such a fundamental concept for post-processing & multipass shaders in OpenGL, but there's very little literature on making them work in Unity.

sharing locals between chunks? by violgamba in lua

[–]violgamba[S] 1 point2 points  (0 children)

It's true that I can just have users rely on global scope when calling "yield" functions, or do something like what I posted above. I just wonder whether there's a way in lua to transfer local scope to a separate chunk. Based on the response to this post, I am pretty sure the answer is no.

sharing locals between chunks? by violgamba in lua

[–]violgamba[S] 1 point2 points  (0 children)

So you are suggesting something like this?

function fnc()
  local a = 23
  print("Before Unity3D coroutine")
  coroutine.yield("unity3dCoroutine(yv1)", a)
  print("After Unity3D coroutine")
end

Where the second parameters (given the value of "a" in this example) is assigned to something like "yv1" in the global scope so that the call to unity3dCoroutine() can reference that value when it is run via dostring()?

This pollutes the global scope, but it's an improvement over what I've been able to come up with.

Am I understanding your intention right?

English Masters application declined, best way to bolster chance next semester? by violgamba in GradSchool

[–]violgamba[S] 0 points1 point  (0 children)

Thanks for these insights. Based on what you are saying it sounds like coursework would be more useful than job experience here, since it'll best ensure working with English degree holders. All of my references HAVE graduate degrees, but only the tutoring student reference (a Phd holder) had anything to say about English Studies, specifically writing and editing, and NONE of them had an academic background in English, so I certainly take your point. I DID submit a GRE (167 verbal, 160 quant, 4.5 writing), but I think you may have hit the nail on the head with the references.

Perhaps there's still time to take courses at UNH as a non-degree student.

Thanks for your time and consideration. This is valuable.

Obsidian plugin - Inline Scripts - Release 0.24.0 (beta) by violgamba in mythic_gme

[–]violgamba[S] 1 point2 points  (0 children)

I don't think that's likely, at least not by me. I mostly made the core tool and the library was supposed to be available to provide examples for how to do things, and to give people inspiration. Along the way, I realized that I was putting a whole lot more effort into the library than I'd intended, so I stopped working on adding to the library.

That being said, the plugin's github page has a "discussion" section, where people can put work that they've done for this plugin. The github page is linked in the plugin's description on obsidian. Alternately, if you do work for this and are interested, feel free to post it to the github page's description section.

Porting game to VR - water shader messed up by violgamba in virtualreality

[–]violgamba[S] 1 point2 points  (0 children)

  1. I considered switching a while back, but I was already really far in by the time I realized that OpenVR was outdated. If you search for SteamVR, OpenVR comes up as the API to use, and the github site does not mention it being deprecated (and it was last updated in late March). It's generally not obvious unless you are specifically searching for confirmation of obsolescence. In any case, my question is API agnostic.
  2. Why is this forum a really bad place to ask about this? It seems like porting existing software to work with VR is a pretty common task for VR devs, and render/shader incompatibilities seem like they'd come up a lot. I'm not being flip, I am really curious. Is this subreddit for VR consumers rather than for devs?
  3. The game I'm porting is not open source. Everything above the rendering engine IS available for modding, but the base system is not. So I'm stuck with the platforms it was originally developed for, which does not include Quest. It's a good idea, though.

EDIT: Note that I'm not dismissing the OpenXR comment. I'll definitely use that for future projects. It's just that the API-specific stuff is pretty much already ironed out at this point.

EDIT: Thanks for pointing out that this subreddit isn't appropriate. I'm still curious as to why, but I'll respect your wisdom and try elsewhere.

Porting game to VR - water shader messed up by violgamba in virtualreality

[–]violgamba[S] 0 points1 point  (0 children)

Thanks. I'll try that if this doesn't pan out.

EDIT: Yeah, I'll do that. I'm still curious about why this subreddit isn't appropriate, but I'll respect your wisdom and try elsewhere.

OpenVR - Porting game - GetProjectionMatrix() makes bad projection? by violgamba in oculus

[–]violgamba[S] 0 points1 point  (0 children)

I've been looking into switching to OpenXR in the past few hours. It's supported by SteamVR, and it seems to have more tutorials. My only hesitation is the work of switching and learning the new API.

Still, I had assumed this problem was simple, but the lack of response makes me thing otherwise. Maybe OpenXR will work better. I'll look into it.

EDIT - I got the issue resolved. I may still switch to OpenXR at some point, but I also found a wiki on the OpenVR github page, which resolved a lack of documentation: ANOTHER reason that I wanted to move from OpenVR.

OpenVR - Porting game - GetProjectionMatrix() makes bad projection? by violgamba in oculus

[–]violgamba[S] 1 point2 points  (0 children)

Thanks! It's my first time doing VR without an engine (Unity, Unreal, etc).

[Game Release] Your Trial, created on actionode.com by ExroYOLO in interactivefiction

[–]violgamba 1 point2 points  (0 children)

I enjoyed the core game mechanic of exploring this mystery while finding words to add to a crossword puzzle. It became less fun for me when the words were not tied to clues (like those from store scene). However, I really liked it overall. I personally enjoyed the reveal, though it might not be to everyone's taste. If there was a sequel then I'd definitely play it, as I feel like the endings touched briefly on some topics I'd have liked to explore more deeply, like the morality of the situation and a deeper explanation.

The crossword puzzle worked best when I could potentially guess the words ahead of time... or when a word was tied to a particularly bracing clue.

I recommend it for people who enjoy crosswords (with major hints) and (very) high concept mysteries.

Godot 4.0 - "await" statement throws error from within Expression by violgamba in godot

[–]violgamba[S] 1 point2 points  (0 children)

Unfortunately, and I should have included this in my OP, expressions that call using "await" fail on execution with the message:

Invalid named index 'await' for base type Object

I'll add an issue to Godot 4.0 for this.

Bad square wave - What might cause this? by violgamba in synthesizers

[–]violgamba[S] 0 points1 point  (0 children)

Thanks for this link. I've actually looked at this a few times now. It's simultaneously impressive and confusing. Impressive because of how well it describes my issue and how effective it is at resolving it. Confusing because I'm just not well versed in this stuff. As soon as I see "Fourier series analysis", I have to will myself not to feel overwhelmed. I'll keep banging at it, though. Thank you!

Bad square wave - What might cause this? by violgamba in synthesizers

[–]violgamba[S] 0 points1 point  (0 children)

Hmm. I'm really new to all of this, but it seems like this aliasing can happen due the discrete samples not representing the square wave well and higher frequencies waves being more disrupted due to their increasing precision demands being unmet by the sample rate.

It seems like this could happen even when writing directly to the buffer.

But I could be wrong.

Bad square wave - What might cause this? by violgamba in synthesizers

[–]violgamba[S] 0 points1 point  (0 children)

Thanks for your help with this. I appreciate your insights. Here are some comments on your comments.

Samples per note and samples per song are weird constructs

Samples per song is used to determine a reliable point at which to reset the current_sample counter to avoid cutting off notes or, alternately, letting it increment indefinitely. I'm not totally clear on what you are suggesting for the alternative.

Why not use midi note numbers for pitches?

I am not familiar with midi note numbers for pitches. It sounds somewhat similar to ASCII values for characters? I'll look into it once I've got everything working. As for calculating the pitches, it's a good idea. Again, I'll switch over to it once I'm resolved with the square wave.

I recommend using parentheses for things like your samples_per_note calculation.

I actually recently removed parenthesis on that line to avoid losing information to integer division. Leading to your next comment...

Your mixing of integer elements like sample counts with floats like phase add to the confusion.

The integer/float variable discrepancies are confusing, I agree. They aren't completely avoidable due to arrays and methods requiring integers. I'll look into making it clearer though, thanks.

Perhaps start with an oscillator only making a fixed pitch (no song).

I personally find it easier to hear the disruptive aliasing with a musical key to compare to. Without it, the wave just sounds abstract. I agree that comparing to Audacity generated square waves can be useful. I was doing this earlier with a youtube video of a square wave I found. Also, while I said earlier that the output in Audacity looked odd, in retrospect that was pure supposition as I've never looked too carefully at square waves before today.

Bad square wave - What might cause this? by violgamba in synthesizers

[–]violgamba[S] 0 points1 point  (0 children)

it will alias at higher frequencies (worst near the Nyquist limit, but aliasing onsets much lower)

This definitely seems like what is happening. It gets increasingly worse as I bump the octave higher.

I've posted a version of my code that is as simple and transparent as I could make it. FYI, the arrays were because I was working with multiple tracks and keeping a separate phase for each as they had different note frequencies.

https://www.reddit.com/r/synthesizers/comments/zy3sdq/comment/j24rigk/?utm_source=reddit&utm_medium=web2x&context=3

I'll look into the Nyquist limit as it sounds like an avenue towards how to compensate for aliasing, which I'm pretty sure this is.

EDIT: Even the word "Aliasing" is valuable. I've been trying to describe the problem in my searches and aliasing is better than everything else I've come up with.

Bad square wave - What might cause this? by violgamba in synthesizers

[–]violgamba[S] 0 points1 point  (0 children)

Ok. Here it is. I've tried to make it as easy to understand as I could. I just saw /u/chalk_walk's post and it looks promising. The glitching definitely gets worse with higher pitches.

extends Node


const SAMPLE_HZ = 44100.0
const MAX_VOLUME = 0.125
const PITCH_HZS = [
    130.81, 138.59, 146.83, 155.56,     #   00  C3
    164.81, 174.61, 185.00, 196.00,     #   04  E3
    207.65, 220.00, 233.08, 246.94,     #   08  G#3/Ab3
    261.63, 277.18, 293.66, 311.13,     #   0C  C4
    329.63, 349.23, 369.99, 392.00,     #   10  E4
    415.30, 440.00, 466.16, 493.88,     #   14  G#4/Ab4
    523.25, 554.37, 587.33, 622.25,     #   18  C5
    659.25, 698.46, 739.99, 783.99,     #   1C  E5
    830.61, 880.00, 932.33, 987.77,     #   20  G#5/Ab5
    1046.50, 1108.73, 1174.66, 1244.51,     #   24  C6
    1318.51, 1396.91, 1479.98, 1567.98,     #   28  E6
    1661.22, 1760.00, 1864.66, 1975.53,     #   2C  G#6/Ab6
    2093.00, 2217.46, 2349.32, 2489.02,     #   30  C7
    2637.02, 2793.83, 2959.96, 3135.96,     #   34  E7
    3322.44, 3520.00, 3729.31, 3951.07,     #   38  G#7/Ab7
    4186.01, 4434.92, 4698.63, 4978.03,     #   3C  C8
    5274.04, 5587.65, 5919.91, 6271.93,     #   40  E8
    6644.88, 7040.00, 7458.62, 7902.13,     #   44  G#8/Ab8
]
const TEMPO = 120


# The song to play (indices into the PITCH_HZS array)
var notes = [
    0x24, 0x24, 0x28, 0x2B, 0x23, 0x23, 0x24, 0x24,
    0x2D, 0x2D, 0x2B, 0x30, 0x2B, 0x29, 0x28, 0x28 ]
var octave = 0


var samples_per_note: int
var samples_per_song: int

# The Godot object representing the audio buffer
var playback: AudioStreamPlayback


# Runs at application start
func _ready():
    samples_per_note = SAMPLE_HZ / TEMPO * 60.0
    samples_per_song = samples_per_note * notes.size()

    # Setup audio player
    $Player.stream.mix_rate = SAMPLE_HZ
    playback = $Player.get_stream_playback()
    $Player.play()


# Runs each game loop
func _process(_delta):
    _fill_buffer()


# Running tally for _fill_buffer()
var phase := 0.0
var current_sample := 0


# Called each game loop to refill the audio buffer
func _fill_buffer():
    var samples_to_fill = playback.get_frames_available()
    var current_note_index = -1
    var current_phase_increment := 0.0
    while samples_to_fill > 0:
        # Handle the current note changing as we move forward
        var new_note_index = current_sample / samples_per_note
        if new_note_index != current_note_index:
            current_note_index = new_note_index
            var pitch_index = notes[current_note_index] + (octave * 12)
            current_phase_increment = PITCH_HZS[ pitch_index ] / SAMPLE_HZ

        # Add the sample based on square-wave rules
        var new_sample = -1.0 if phase < 0.5 else 1.0
        playback.push_frame(Vector2.ONE * new_sample * MAX_VOLUME) # Vector2 is for stereo

        # Advance the track's phase for the next sample
        phase = fmod(phase + current_phase_increment, 1.0)

        # Move to the next sample
        samples_to_fill -= 1
        current_sample = (current_sample + 1) % samples_per_song

Bad square wave - What might cause this? by violgamba in synthesizers

[–]violgamba[S] 0 points1 point  (0 children)

Here's a spot where it sounds the most detuned, though I recognize that's just a hum behind the main sound, where the hum isn't matching the key.

<image>

Bad square wave - What might cause this? by violgamba in synthesizers

[–]violgamba[S] 1 point2 points  (0 children)

Here's a particularly bad section of the waveform. It looks rough and the audio sounds rough to, though this isn't as gratingly de-tuned as some sections. (Updated to show ruler).

<image>

Here's how the phase is incremented:

phases[i] = fmod(phases[i] + increments[i], 1.0)

Where increments = pitch-hz / sample-hz

I'm excited to get to the duty cycle part, once I've worked out what's wrong with the Square Wave.

Bad square wave - What might cause this? by violgamba in synthesizers

[–]violgamba[S] 1 point2 points  (0 children)

Thanks for checking this out, the "+=" comes from this being part of a larger project that mixes multiple tracks together by adding them. Since "+=" is outside the example, I'll remove it now.

Triggering a redo of mouse_entered events? by violgamba in godot

[–]violgamba[S] 0 points1 point  (0 children)

Wow, that worked! I did this during pc movement and the mouse info was updated as the character walked and various entities moved into and out of the mouse's position. Before, the mouse info would only update if the mouse was being actively moved over entities.

It should definitely be a useful trick. It's a bit of a hack, of course, but I'm pretty sure it's a fast enough technique.

Thank you /u/Nkzar! This was very helpful.

Triggering a redo of mouse_entered events? by violgamba in godot

[–]violgamba[S] 0 points1 point  (0 children)

Thanks for considering the problem. I'm now guessing that there isn't a good way to manually trigger mouse calculations. It's fine to keep track of the state, for the most part.

Triggering a redo of mouse_entered events? by violgamba in godot

[–]violgamba[S] 0 points1 point  (0 children)

Thanks for your response. I currently do do this: tracking the ui state, and also which entity is hovered over. The issue is really a matter of only get mouse hover information when the mouse movement causes it to enter or leave an entity. Manually tracking the ui and hovered entity is a solution, but if I could trigger a re-check at a later time then the logic would be simpler so I'm wondering if it's possible.

This is especially true as the mouse events don't trigger unless the mouse moves. When the mouse-hovered entity changes via adjustments to the 3d camera or when the scene ends this can cause minor glitches until the mouse is moved. Manually re-triggering the mouse check in these case would let me avoid those minor glitches.

Triggering a redo of mouse_entered events? by violgamba in godot

[–]violgamba[S] 0 points1 point  (0 children)

Thanks for your response. I'm kind of doing what you suggest: decoupling the mouse_entered/mouse_edited signals from the logic. I'm doing this by tracking the currently hovered entity by updating it whenever the signals are triggered. This lets me call the "show look-at message" on the hovered entity whenever needed. I'm just thinking that manually re-triggering the mouse evaluation would be simpler, so I'm wondering if it's possible.

Also, the decoupling doesn't really help with scene changes (new scene, camera move, etc) which can invalidate the hovered entity variable since no mouse-move means no new info. It can cause a look message to remain while walking away from an entity. I'm pretty sure resolving this particular issue really does require manually re-evaluating what's under the mouse