GithubHelp home page GithubHelp logo

the-drunk-coder / ruffbox Goto Github PK

View Code? Open in Web Editor NEW
54.0 54.0 3.0 4.42 MB

Simple sampler/synth with text-based step sequencer, running in the web browser.

Home Page: https://parkellipsen.de/ruffbox

License: Other

Shell 0.33% HTML 3.09% JavaScript 72.03% Rust 24.55%

ruffbox's People

Contributors

hannobraun avatar kant avatar the-drunk-coder avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

ruffbox's Issues

Why using setTimeout in scheduler

I try to understand your code cause I would like to implement a web sequencer. Why do you need to use JS setTimeout? Doesn't Rust have an timer system? Or would this timer need separate thread to don't block the whole Rust process?

Have you thought about using non blocking timer like it is often done on microcontroller? I remember to have used this on esp-open-rtos https://github.com/SuperHouse/esp-open-rtos
Have a look there: https://en.wikipedia.org/wiki/FreeRTOS#Implementation

FreeRTOS implements multiple threads by having the host program call a thread tick method at regular short intervals. The thread tick method switches tasks depending on priority and a round-robin scheduling scheme. The usual interval is 1 to 10 milliseconds (1/1000 to 1/100 of a second), via an interrupt from a hardware timer, but this interval is often changed to suit a particular application.

I guess you might still need to somehow trigger the tick on regular interval and for this you might need setTimeout. Or maybe it would be possible to run the Rust code in loop and regurlarly call a yield() function to check if a timer is ready.

Link printed by server.sh doesn't work

When starting server.sh, the following output is printed:

Serving HTTP on 0.0.0.0 port 1234 (http://0.0.0.0:1234/) ...

When opening that link in a browser, the following error message appears in a popup:

AudioWorklet isn't supported... It cannot work.

I believe the reason is that AudioWorklet is only available in a secure context (see https://developers.google.com/web/updates/2017/12/audio-worklet). The workaround I found is to connect to http://localhost:1234/ instead, as http://localhost is considered secure for local testing (as per the previous link).

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.