metronome | friendlier front-end

 by   voxmedia JavaScript Version: Current License: BSD-3-Clause

kandi X-RAY | metronome Summary

kandi X-RAY | metronome Summary

metronome is a JavaScript library. metronome has no bugs, it has a Permissive License and it has low support. However metronome has 2 vulnerabilities. You can download it from GitHub.

A friendlier front-end to requestAnimationFrame-based animations.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              metronome has a low active ecosystem.
              It has 170 star(s) with 7 fork(s). There are 128 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 4 open issues and 0 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of metronome is current.

            kandi-Quality Quality

              metronome has 0 bugs and 0 code smells.

            kandi-Security Security

              metronome has 2 vulnerability issues reported (0 critical, 2 high, 0 medium, 0 low).
              metronome code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              metronome is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              metronome releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of metronome
            Get all kandi verified functions for this library.

            metronome Key Features

            No Key Features are available at this moment for metronome.

            metronome Examples and Code Snippets

            No Code Snippets are available at this moment for metronome.

            Community Discussions

            QUESTION

            Metronome SwiftUI, Change timer interval whenever the @State var is changed
            Asked 2021-May-14 at 06:35

            I'm building the a metronome with swiftUI

            I have a @State var that connect to a slider.

            ...

            ANSWER

            Answered 2021-May-14 at 06:35

            The easiest way to perform code when a @State value changes is to add an onChange modifier to a child view of the view where you defined your @State, e.g.:

            Source https://stackoverflow.com/questions/67528649

            QUESTION

            Timing issues: Metronome using AVAudioEngine scheduleBuffer's completion handler
            Asked 2021-May-03 at 19:40

            I want to build a simple metronome app using AVAudioEngine with these features:

            • Solid timing (I know, I know, I should be using Audio Units, but I'm still struggling with Core Audio stuff / Obj-C wrappers etc.)
            • Two different sounds on the "1" and on beats "2"/"3"/"4" of the bar.
            • Some kind of visual feedback (at least a display of the current beat) which needs to be in sync with audio.

            So I have created two short click sounds (26ms / 1150 samples @ 16 bit / 44,1 kHz / stereo wav files) and load them into 2 buffers. Their lengths will be set to represent one period.

            My UI setup is simple: A button to toggle start / pause and a label to display the current beat (my "counter" variable).

            When using scheduleBuffer's loop property the timing is okay, but as I need to have 2 different sounds and a way to sync/update my UI while looping the clicks I cannot use this. I figured out to use the completionHandler instead which the restarts my playClickLoop() function - see my code attach below.

            Unfortunately while implementing this I didn't really measure the accuracy of the timing. As it now turns out when setting bpm to 120, it plays the loop at only about 117,5 bpm - quite steadily but still way too slow. When bpm is set to 180, my app plays at about 172,3 bpm.

            What's going on here? Is this delay introduced by using the completionHandler? Is there any way to improve the timing? Or is my whole approach wrong?

            Thanks in advance! Alex

            ...

            ANSWER

            Answered 2021-May-02 at 14:50

            How accurate is the tool or process which you are using to get your measure?

            I can't tell for sure that your files have the correct number of PCM frames as I am not a C programmer. It looks like data from the wav header is included when you load the files. This makes me wonder if maybe there is some latency incurred with the playbacks while the header information is processed repeatedly at the start of each play or loop.

            I had good luck building a metronome in Java by using a plan of continuously outputting an endless stream derived from reading PCM frames. Timing is achieved by counting PCM frames and routing in either silence (PCM datapoint = 0) or the click's PCM data, based on the period of the chosen metronome setting and the length of the click in PCM frames.

            Source https://stackoverflow.com/questions/67341908

            QUESTION

            Where to find resources for writing a decent metronome app?
            Asked 2021-Apr-18 at 06:56

            Recently I've been trying to figure out how to write a metronome app, but I've come across many difficulties with OS time control (calling functions e.g.) or significantly inaccurate onset detection algorhithms (I've used librosa) and it seems to be a pretty complicated topic. Yet for some reason I wasn't successfull in my research upon professional metronome apps source code/tutorials/books touching the topic etc... The web seems to be filled with amateur examples and solutions that don't really meet the modern metronome app (such as Frozenapes iOS Tempo app) standards. e.g. a metronome which uses pre-recorded .wav samples when a certain tempo is called (so there are all the tempos between 30 and 300 bpm stored in the app). That kind of solutions seem to be a bit of dead end if user wants to change the tempo while metronome is working. To sum it up - I'm looking for any professional resources with code/text/whatev which isn't 2000 pages signal processing book for math graduates and could help me with designing a decent metronome with some recording features.

            ...

            ANSWER

            Answered 2021-Apr-18 at 06:56

            Maybe my experience with writing a metronome using Java will be helpful. The key was not relying on the system clock, but instead, on counting the exact number of PCM frames and placing the click audio PCM at that point. At a sample rate of 44100 fps, that is basically accuracy to 1/44100th of a second.

            I cannot advise you as to how to stream PCM and to count the frames as they pass. Does Python even give you access to the individual frames?

            Source https://stackoverflow.com/questions/67141410

            QUESTION

            Incorrect signal returned by librosa.clicks
            Asked 2021-Apr-08 at 22:50

            I'm trying to write a simple metronome with librosa.clicks

            ...

            ANSWER

            Answered 2021-Apr-08 at 22:50

            I have imported the click as wav file into an audio editor and found that it is accurate within 1-2 samples.

            Onset detection algorithms are not perfect and very dependant on the transient of the signal.

            I have plotted the waveform against the onset_samples and even at a birds-eye view you can tell that the onset times are not that consistent.

            bottom line: the click is fine. its the onset detection that is off.

            Source https://stackoverflow.com/questions/67001624

            QUESTION

            What are the ways to improve my metronome written in Python?
            Asked 2021-Apr-07 at 21:23

            I'm trying to write a python based metronome with librosa and sounddevice but I've came across some problems with it's accuracy. Here's the code:

            ...

            ANSWER

            Answered 2021-Apr-07 at 21:23

            Running your code on a mac, the timing inconsistencies are noticeable but also the tempo was of quite a bit off from the set bpm.

            This is mostly because sleep() isn't that accurate, but also because you have to account for the time that has elapsed since the last event. e.g. how much time did it take to call sd.play()

            I don't know on what operating system you did run this, but most operating systems have a special timer for precise callbacks (e.g. Multimedia Timers on Windows). if you don't want a platform specific solution to improve the timing you could do a "busy wait" instead on sleep(). To do this you could sleep for have the delay, and then go into a loop where you constantly check the time elapsed.

            Source https://stackoverflow.com/questions/66983774

            QUESTION

            AudioKit: How to change tempo on the fly?
            Asked 2021-Mar-21 at 00:50

            I am new to AudioKit and programming music app. I'm building a metronome app and using AudioKit's AKMetronome. I want to have a feature where a user can specify a sequence of beat patterns with different tempo. But I find it is inaccurate to use apple's DispatchQueue.

            I'm thinking of rewriting the metronome using AKSequencer. Is there a way to use AudioKit's sequencer to change tempo on the fly or generate a sequence with multiple different tempo? (Sequencer example: https://github.com/AudioKit/Cookbook/blob/main/Cookbook/Cookbook/Recipes/Shaker.swift)

            ...

            ANSWER

            Answered 2021-Mar-20 at 13:39

            A possible solution would be to create a tempo track, which would contain tempo events that when processed change the sequencer's tempo.

            This is an outline of what should be done:

            1. Create a track to contain the tempo events, using AKSequencer's addTrack method. Connect this track to an AKCallbackInstrument. Please see this answer on how to connect an AKCallbackInstrument to an AKSequencer track.
            2. Add the tempo events to the track, at the time positions where there are tempo changes. As far as I know, there are no standard MIDI events for indicating tempo changes (such as a control change for tempo). But as you will be interpreting the events yourself with a callback function, it doesn't really matter what type of event you use. I explain below how to represent the tempo.
            3. Process the events in the callback function and set AKSequencer's tempo to the indicated tempo.

            It’s a little difficult to represent the tempo value inside a MIDI event because usually, MIDI parameters go from 0 to 127. What I would do is use a Note On event, in the note's pitch I would store tempo div 128 and in the note's velocity, tempo % 128.

            This is what your callback function would look like:

            Source https://stackoverflow.com/questions/66701559

            QUESTION

            How to use AudioKit Sequencer to configure time signature for a metronome?
            Asked 2021-Mar-04 at 20:32

            Thanks for AudioKit!

            I'm a beginner in Swift and AudioKit, so this may be an easy question:

            I want to build a metronome app. From the example in Audiokit's new CookBook and the old AKMetronome(), I can see how to build a simple metronome using AudioKit. But I don't know how to play beats with compound time signatures (3/8, 7/8, etc.). Both examples here use a time signature with 4 as a fixed bottom number and the top number can be changed (i.e. we can have 1/4, 3/4, 6/4 but not 3/8, 6/8).

            Is there a way to change the bottom number?

            Link for AKMetronome: https://audiokit.io/docs/Classes/AKMetronome.html#/s:8AudioKit11AKMetronomeC5resetyyF

            AudioKit Cookbook's Shaker Metronome: https://github.com/AudioKit/Cookbook/blob/main/Cookbook/Cookbook/Recipes/Shaker.swift

            ...

            ANSWER

            Answered 2021-Mar-04 at 20:32

            I made some changes to the Shaker Metronome's code to illustrate how you could create a metronome that plays different time signatures such as 6/8, 5/8, 7/8, and so on.

            First I added some information to the ShakerMetronomeData structure:

            Source https://stackoverflow.com/questions/66465988

            QUESTION

            Raspberry Pi + GPIOzero: press button to change a variable in a loop (while the loop keeps on running)
            Asked 2021-Feb-27 at 18:27

            I'm trying to make a visual metronome of sorts in which I press a button in order to change the bpm. Once the bpm is 85, if the button is pressed once more, if goes back to the default bpm (of 120). t this is my code:

            ...

            ANSWER

            Answered 2021-Feb-27 at 18:27

            As mentioned you have to tell python, that you want to use the "bpmButton" variable from outside the function. Because otherwise python instantiates a new variable with the same name, but no value. Try this:

            Source https://stackoverflow.com/questions/65943447

            QUESTION

            Trying to play an .mp3 via JS on iOS browsers?
            Asked 2021-Feb-23 at 10:46

            I tried to make a metronome using HTML and JS. I know the audio can't autoplay due to restrictions (I don't want it to anyway), so I placed an element with a inside, with all (I thought?) appropriate attributes; I controlled playback using JS triggered by a button click. This works on my laptop and even in the XBox Edge browser, but on iOS browsers (both Safari and Firefox) the sound does not play. The HTML looks like this:

            ...

            ANSWER

            Answered 2021-Feb-23 at 10:46

            I am not sure if this is documented anywhere (I didn't stumble across it), but after some additional testing I discovered that iOS prohibits use of the .play() function on an existing HTML element or JS Audio() element, unless called directly and synchronously as the result of a user UI event. In other words, this will work:

            Source https://stackoverflow.com/questions/66300840

            QUESTION

            Timer drags a bit when too much is happening
            Asked 2021-Feb-21 at 21:45

            I'm working on a timer that needs to do some calculations and run some functions at a certain interval. I'm trying to keep the interval as big as possible, but I need it to be kind of fine grained.

            Here is the periodic timer with some of the stuff that needs to happen. So as you can see, every second (the milliseconds passed % 1000 == 0) it will do some stuff if some conditions are met. But also every 10 milliseconds I need to check some stuff.

            It seems this is a bit too much, and after running the timer for 2 minutes it already drags 1 second behind. I guess I'm approaching this the wrong way. Could/should I somehow put all that logic in a function that just runs async so the timer can just keep going.

            It's not the end of the world if the timer display drags for a few milliseconds every now and then, if it catches up later. But now the whole timer just drags.

            ...

            ANSWER

            Answered 2021-Feb-21 at 21:45

            You cannot rely on a timer to deliver events exactly on time. You need to use a more exact method than simply incrementing a counter by 10 on every tick. One example would be to start a Stopwatch before the timer and then (knowing that your ticks will only be on approximately 10ms intervals) read stopwatch.elapsedMilliseconds and base your decisions on that.

            You will need to change your logic a bit. For example, you want to know when you pass a 1 second boundary. Previously, with your exact increments of 10 you knew you would eventually reach a round 1000. Now, you might see 995 followed by 1006, and need to deduce that you've crossed a second boundary to run your per second logic.

            Source https://stackoverflow.com/questions/66306991

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            plugins/mod_compression.lua in (1) Prosody before 0.9.4 and (2) Lightwitch Metronome through 3.4 negotiates stream compression while a session is unauthenticated, which allows remote attackers to cause a denial of service (resource consumption) via compressed XML elements in an XMPP stream, aka an "xmppbomb" attack.
            plugins/mod_compression.lua in Lightwitch Metronome through 3.4 does not properly restrict the processing of compressed XML elements, which allows remote attackers to cause a denial of service (resource consumption) via a crafted XMPP stream, aka an "xmppbomb" attack.

            Install metronome

            You can download it from GitHub.

            Support

            This library provides two main methods for animation via requestAnimationFrame: a frame-based method, and a duration-based method.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/voxmedia/metronome.git

          • CLI

            gh repo clone voxmedia/metronome

          • sshUrl

            git@github.com:voxmedia/metronome.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular JavaScript Libraries

            freeCodeCamp

            by freeCodeCamp

            vue

            by vuejs

            react

            by facebook

            bootstrap

            by twbs

            Try Top Libraries by voxmedia

            meme

            by voxmediaJavaScript

            autotune

            by voxmediaJavaScript

            data-projects

            by voxmediaJupyter Notebook

            middleman-google_drive

            by voxmediaRuby