Detecting beats in a song - c#

I'm working on a project which requires me to add beat detection when a song is playing in the application (WinForms - C#).
I'm currently using NAudio.NET for playing the song & displaying details about the song.
Is there a library that would allow me to do this or some way to detecting this manually? I'm not expecting a finished solution but pointers in the right direction. Ideally I would like this to be a real-time detection but it is not essential.

This question has already been asked; check out this StackOverflow thread. Some of the answers include explicit beat detection algorithms and links.
GameDev.net - Algorithm Summary
Comb Filters
More algorithms are on that StackOverflow thread

You can use this BPM Detection Library
Besides BPM calculation it also allows you to get every beat, so you could for example adjust your visualisation, if that is the case.

I've used FMOD to do exactly what you're doing. They don't have annoying popups. You can check out this link to a GitHub project that uses it in c#. Fmod licensing is a little odd, based on what the program's budget is. If your budget is under 500k, you can use it for free, but are supposed to display their logo somewhere, either in a splash screen or credits screen.

Related

C#.NET Determine blow sound using microphone

I am working on a UWP app which needs to keep listening to the sound and recognize a hammering sound.
For every blow of hammer strike I need to save the system time.
I have looked at few algorithms like
Clap sound detection in C#
but none-of-them are close to what I am looking for.
Here is the flow:
on my UWP I click on a button "Listen Audio"
That will start hearing to the sound
When there is sudden spike in sound wave, which is like a big hammer strike, my code should trigger an event
That event will capture information related to the hammer striking (mostly timestamp)
Any suggestions for coming up with a good algorithm is appreciated.
Based on your requirement this answer gives you what you need.
Link to product Info Page http://www.zonetrigger.com/sound-detection/
Demo link: http://www.zonetrigger.com/sound-detection/azt-demo.html
Audio Zone Trigger — $24.95
Audio Zone Trigger is very easy to use: you put triggers on the sound wave, and when the waves go beyond the thresholds, they perform the actions that you have selected. The software was designed with the following purposes in mind: Security, Computer Remote Control and Monitoring. However, because the software can perform any action that you want, you are free to use it in any creative way you can think!
If you don't want to user 3rd party tools and develop your own solution, then you can try this approach numerical integration

How to Create a Display That Changes by Audio

If you've ever used a Skype call, or really any software that has audio in it, it likely has a little display of some sort that rises and falls, or shrinks and enlarges depending on the frequency or volume of the receiving sound.
Like this:
Audio Test
As you can see, when the sound is being played, there is some indicator that takes the volume/frequency of it, and turns that into a display.
I'm wondering these three things:
What is the term for this?
How is this done?
How can I make something like this in WPF?
Please suggest.
The term you are looking for is "Audio Visualizer". See this question:
Implementing a audio visualizer in WPF
There is a great open source library here:
https://github.com/jacobjohnston/wpfsvl
The question is too vague to give code samples as writing an audio visualizer from scratch would be quite an effort.

Suggestions for a video montage application (extracting and playing randomized short clips from a playlist)?

I'm an electronics engineer used to coding in embedded C and assembly, but I decided to start learning higher-level stuff like C#, .NET, etc., so I can start making software as a hobby. I have a great idea for one of my first projects, but after searching several forums for days on end, I'm left not really knowing what would be the easiest path forward.
The functionality that I'm looking to create is pretty similar to the idea of a photo slideshow, but applied to videos instead. The program would open a playlist or a folder full of videos and then play the videos in a random order, starting from a random starting position, and with a fixed duration (let's say 10 seconds as an example). You would end up being able to watch a sort of "video montage" that consisted of small clips from random parts of the videos in the playlist, shown in a random order, ad infinitum until the program is closed.
There are a number of ways I could tackle the problem:
Develop a standalone video player with the fixed functionality of showing "video slideshows." DirectX has the Microsoft.DirectX.AudioVideoPlayback API that
could be a good starting point. I found an example here: http://www.dreamincode.net/forums/topic/111181-adding-video-to-an-application/
Modify an open source project to add the desired functionality. I've seen a few cool projects that could get me started, like this simple C# Movie Player: http://www.codeproject.com/Articles/18552/C-Movie-Player
Use a scripting interface to implement this functionality on an existing media player, like VLC or Winamp. You could also control VLC via C#, like the example here: Controlling VLC via c#
I realize that the obvious answer for most people would be to "use whatever you're most comfortable with," but since I'm a pure beginner, I don't really have any allegiances to a particular language or development environment. So, I was just curious if anybody had an idea of what might be the least painful option for a beginner.
I also apologize that this is not a very specific programming question. I'm sort of just testing the waters to get my footing. Hopefully, once I get started on the project, I'll be able to come back and post more intelligent and relevant questions!
While your background would lend you toward C#, I recommend investigating something like this and using WPF for the media player. You can then control the media player using a background worker in order to stop the video or queue up the next one. Some other .NET concepts that will be of use to you are FileInfo and DirectoryInfo objects, to provide you with the necessary information about the files. I'm not sure if you've had experience with generic data structures in .NET, but the System.Collections.Generic namespace would be a good place to start to get a feel for data structure you want to keep your playlist in. WPF will also be able to help you with transitions between video clips.
Admittedly WPF is easier with an understanding of the MVVM or MVC design patterns, but I think you'll be able to get something working without having to delve too far into that right up front.

How to detect change on the screen?

I have a question that How to detect the change on the screen? Its position is not necessary but is possible to get its position it will be helpful. I searched it on the internet but not found any suitable answer. Now, I am making a program in C# and I have to detect a change on the screen. I tried to capture four screen shots per second and compare them. This method works but it badly effect on the performance of the PC.
I think it is easy to do in C or Assembly language (x86) because in assembly we can get access to video memory directly.
Is it possible to do in C#?
Code sample will be appreciated.
Project: Detect any change on full Screen camera monitoring software.
Are you really looking just for simple difference of what you see on your monitor? I doubt that would do the job.
For motion detection from cam input you can take a look at Motion Detection Algorithms article on CodeProject.
Aside from taking screen captures and comparing them at some time intervals (which would cause performance issues),
The only solution i can think of is hooking up to system events, the "redraw" kind of events.
You will need to choose which events to hook your program with.
This codeproject tutorial might help-
http://www.codeproject.com/KB/system/WilsonSystemGlobalHooks.aspx

Where can I find, or how can I build, a cartoonizer for C#?

I am working on the development of a Massively Multiplayer Online Role Playing Game (MMORPG) in .NET using C# and Silverlight. One of the features that has been requested for this game is to allow players to upload their own avatars.
Rather than displaying the uploaded images in their raw forms, we want to convert the images to a cartoon form--in other words to cartoonize the image.
Several sites which can accomplish such a task are listed at http://www.hongkiat.com/blog/11-sites-to-create-cartoon-characters-of-yourself/
I realize that these sites are applying an image filter to create the cartoon image. Frankly, I have no reasonable idea what these cartoon image filter algorithms might look like or if there is anything already available in C# or .NET that I could use. If there are no libraries available, I am curious how difficult it would be to roll my own.
This is a minor game feature so I am not interested in devoting a week or more of coding time to implement this. However, if I can code up what I need within a day, then it is probably viable.
At this point, I am primarily looking for guidance as to
what is possible
what libraries are already available (preferably as open source)
where i may find additional information
any other advice or guidance you may be able to provide
Thank you in advance!
Apparently you apply a Gaussian Blur filter to the image. Then you sharpen the image. Perhaps the AForge libraries would help you out.
I've used code from the image processing lab on code project before with success. (update: here's the library it uses)
Christian Graus also has written a whole series on GDI image processing which I found useful (and has the effects listed above for filtering capabilities).

Categories

Resources