Code Monkey home page Code Monkey logo

drop's Introduction

Hey there!

My name is Blake. I enjoy all things programming and going to hackathons.

Devpost | nul


I tend to write Rust nowadays for fun systems programming projects and I write Python for all of my Machine Learning work.

Here are some projects you may be interested in:

While I dabble in a lot of different areas like Operating Systems, systems software, security, reverse engineering, computer vision, cryptocurrency, music visualization, databases, and bots; I think my strengths and experience lie in Machine Learning, Backend Development, and where the two intersect.

I contribute to the popular rust-analyzer project and build useful bots for my friends. When I'm not dabbling in reverse engineering, I'm moderating reverse engineering communities.

I often attend hackathons and want to see more hackathons in the professional sector. Let's make them more than university or private company events!

Thank you to everyone who has taught me along the way and to the internet that has given me so much knowledge.

~ nul.dev

drop's People

Contributors

xnul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

savegame

drop's Issues

Audio playback repeated skipping on some audio formats and systems

The skipping happens periodically, causes skipping of anywhere from milliseconds of audio to multiple seconds. The varying nature of the bug suggests a mechanic that can be variable is at fault such as the buffering of the queueable audio sources. I suspect Drop isn't buffering the audio properly.

Configuration updating bug

When updating the configuration, some compatible boolean settings to don't seem to pass to the updated config file.

As time passes, the waveform array is overwritten, crashing the visualizer.

I'm using ffi to generate a dynamically allocated array of float values called waveform and for some reason if I stop writing to it, nil and extremely small values start creeping in. Here's the array at 35 seconds:

image

When a nil value creeps in, the loop in spectrum.draw() tries to iterate over it and fails to perform mathematical operations, resulting in an error message and the crash of Drop.

Example:
image

To reproduce, start Drop, load some music, pause, and wait a minute or so for a nil value to creep in.

Optimize Icon

The current Icon is simply some vertical green lines and while that's fine, I wish to add some shadow, properly space the ticks, make each half identical, and smooth out the curves a bit more, if possible.

Add Support for Custom Visualizations

Potentially add hooks, API, external folder, functions for typical effects/visualizations.

This is low-priority and will only be done once all of the possible performance improvements have been implemented and the code refactored.

Remember to implement calls for Bass, Midrange, Highrange sounds.

[Mac only] Window background detection breaks on higher refresh rate monitors

Window background detection is done by monitoring the refresh rate. It is optimized for 60hz by default, so higher refresh rates cause it to glitch and disable the spectrum. Can be changed manually, but should be added to the settings panel once implemented.

In the next commit a refresh rate variable will be located in love.load for a workaround. Just locate the variable and change the default value to your monitor's refresh rate.

Update: this variable is called monitor_refresh_rate and you can find it at the top of main.lua.

Audio queue resizing nil sounddata bug

When resizing the audio queue for the recording device, there's an nil error when trying to queue sounddata.

Error: audio.lua:723: bad argument #1 to 'queue' (SoundData or lightuserdata expected, got nil)
stack traceback:
        [string "boot.lua"]:637: in function <[string "boot.lua"]:633>
        [C]: in function 'queue'
        audio.lua:723: in function 'resizeQueue'
        visualization.lua:281: in function 'setSamplingSize'
        visualizers/novis/novis.lua:4: in function 'catch_nil'
        visualization.lua:226: in function 'callback'
        visualization.lua:259: in function 'next'
        main.lua:211: in function 'catch_nil'
        main.lua:516: in function <main.lua:465>
        [string "boot.lua"]:503: in function <[string "boot.lua"]:493>
        [C]: in function 'xpcall'

Timestamp does not update for the final queued samples of the song

Since there isn't a way to know when audio samples are processed, timestamps are currently calculated when audio samples are queued. When the end of the song is reached by the queuing system, there aren't anymore audio samples to queue, so it stops queuing which means the timestamps stop updating.

There are a couple solutions to this, but they aren't very solid. They would break easily and it would be a pain to implement. Additionally, this bug is so small it's impossible to notice, but if a dynamic queue size is implemented or the queue size is increased in the future, it could become noticeable.

Incorrect screen position set when exiting fullscreen mode

When session_persistence is enabled and someone exits the program while in fullscreen mode, their window's screen position is not restored upon the next time launching the program. Instead, when you launch the program, you're in fullscreen, you exit and it puts the window at the center of the screen no matter what.

Reference..

There are ways to work around this, just none of them are clean.

Refactor Code

Right now the code is super efficient, but very much spaghetti. I'll make it just slightly less efficient to simplify the code, increase its readability, and maintainability.

Decrease delay during switch from fullscreen to windowed mode

When going from windowed to fullscreen mode, the change is instant, but when going back to windowed mode from fullscreen, there is a delay of around 1.5 seconds. For a video player-esque application that switches between windowed and fullscreen fairly often, this is noticeable and significant lag that should be reduced/expunged.

Implement FFTs using FFI

FFT generation accounts for the majority of the visualizer's CPU usage. Drop currently uses a FFT library made in Lua, but if we use LuaJIT's FFI functionality, we may be able to use an FFT library made in C, greatly reducing CPU usage.

To implement this mechanic properly, I want to study FFTs further and then create a library specifically for handling this FFT-FFI integration.

Drop shuts down seemingly at random

It rarely ever happens, but after extended periods of time, Drop will quit seemingly at random. No error message is ever displayed, it just immediately exits.

Can't find a link yet, but since there is no error message, it is probably a bug with Love2D itself. It may have to do with decoders/queueable audio sources or obtaining audio samples.

Improve UI

Drop currently has a very basic overlay to control audio playback, but nothing else and with the upcoming Settings Panel in #14 improvements need to be made.

Add a way to remove songs

Could have two options. Remove one song in particular or all of them. Could be a keypress. Wouldn't fit in with the current UI plan though and would take up valuable space on the screen. Might not be worth.

If a playlist UI was implemented then it would definitely be worth it and extremely useful.

Add a configuration/settings file

As this project has grown, I have found a lot of areas where a settings panel would be useful. For the time being editing the script should be fine, but eventually I wish to add a settings panel to the visualizer to ease that process. Before this happens, a design style needs to be determined and the GUI implemented (if it's decided there will be one).

Ideas:

  • sample input size settings: 256, 512, 1024, 2048, custom
  • tick distance slider (inside settings menu for default vis)
  • screen ratio setting: 16/10, 16/9, 4/3
  • fade options: toggle, turn off bloom, intensity slider (right side for louder
    songs, left for softer), auto
  • more color options
  • set fps cap. 0 = no cap. Works on Windows?
  • switch visualization (maybe visualization-specific settings)
  • window size persistence through program shutdowns

Revisit/Redo Fading Mechanic

The fading mechanic is kind of neat, but can make the visualizer a little bit harder to look at. I wish to add a toggle when I implement the settings panel with this feature turned off by default.

Ideas:

  • add fade bloom: this way the spectrum itself doesn't have to fade and the mechanic can still be shown off
  • add fade transition softening: when a song goes from quiet to loud or the opposite, the fade transition can seem abrupt and a bit annoying

Logotype for drop

Hi, my name is Zuur W. I'm a graphic designer and I'd like to collaborate on your open source project and propose free logo/icon design for your project. If it's something you're interested in, please, let me know!
Best Regards
Zuur

Add recording device support

Recently audio input support was added to Love2D. Add the ability to visualize that input. This could allow Drop to use system audio to generate visualizations, making it a lot more useful/cool.

Obtain song name, artist, etc metadata

Currently Drop simply displays the file name of the song. By default it should attempt to obtain standard audio metadata and then detail the song using that. If not, the file name can be used instead.

Add visualization metadata saving option

Now that Love is adding compression functions, it may be efficient to just save visualization data to the disk after going through the fft. That way, the fft only needs to be run once on each song. The resulting file storage may not be worth it though. It all depends on the compression algorithms.

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.