Distinguishing instruments in a music file [closed] - language-agnostic

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Given a music file, is it possible to split out each instrument that is being played? I.e. let's say I have someSong.mp3, and in that song there's vocals, guitar, bass and drums. I'd want to get 4 "tracks" - one for each distinct instrument.
I'm guessing that it's almost impossible to do this, given that instruments can overlap, and it's notoriously difficult to distinguish overlapping voices let alone instruments.
However is there is a library, or an algorithm, or SOME way of doing this, I'd be curious to hear how.

My undergraduate project dealt with transcribing notes from a WAV file to a MIDI file. We handled only the simple case of one instrument, possibly playing more than one note at a time (a piano, for instance). Our research into the subject before we started showed that even this (i.e. only one instrument) is considered non-trivial. Basically, the problem is:
find what frequencies are playing at any given time. This can be done by a DFT/FFT of small windows one at a time.
Use some heuristic to guess which frequencies are harmonies of the same note, and which belong to different notes. This may be easy if you know what instrument is playing, but it's hard in the general case, because the magnitudes of each harmony differ by instrument. For instance, you might have two Cs one octave apart from one instrument, or you might have one C but from a different instrument.
after you know what notes are playing at each time, you have to guess when you have breaks in the notes. You could have one long note or a series of short notes. Depending on the size of the windows you used for the initial DFT, you could have different results here.
Now, if you have more than one instrument at a time, and no two are playing the same notes or harmonies thereof at one time, you might be able to tell the instruments apart using some heuristic on the magnitudes of the harmonies or on the sequences of notes they're playing. Most likely there will be times when two instruments are playing the same note. Then you don't really have any way to decide if there is (a) one instrument playing the note, (b) two instruments playing at the same volume, (c) one playing soft and the other playing loud or (d) any combination thereof.
Anyway, that's the short list of problems to solve. I don't know of any algorithm that solves this in the general case. I don't think this problem has been solved yet.
Edit: My project presentation can be found at http://www-sipl.technion.ac.il/new/Archive/Special_Events/sipl2004/Projects_PowerPoint/WAV-to-MIDI.pdf

I have actually bumped into a very interesting algorithm called ICA (Independent Component Analysis).
The concept behind this algorithm doesn't come from the signal processing world, but from probabilistic theories.
We used it to separate two songs that were mixed into single mp3 file.
You can find an implementation library in Matlab \ C++ \ Python called FastICA here.
Give it a shot it's really nice.

Every instrument has a characteristic spurious oscillation, so if you isolate single notes (with a DFT/FFT) and compare the other frequencies at that point of time, you might distinguish at least different types of instruments.

The easiest way to do this is to maintain the instruments separately in the first place, which is why many intermediate musical processing applications use MIDI to store instrument messages in an abstract form on separate tracks.

Long story short: You can't except in the case that your four instruments are synthesizers playing pure sine-waves.

mp3 is a lossy format. It works by modeling the acoustic response of a person and throwing away information that it considers that a person can't hear. In essence louder instruments that overshadowing soft instruments - the softer one gets ditched. This means that you never will be able to extract what originally went into the mp3 let alone separate out the instruments.
I have a friend who is a sound engineer and he always has to say "No" to people who ask him to re-engineer a track recorded as an mp3.
A few weeks ago I saw a study that suggested that the younger generation actually preferred the sound of mp3's over more complete formats as that is what they had grown up with.

Related

Why there isn’t any open source alternative to big commercial games out there? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
I’m thinking of all type of game categories. My experience is that there aren’t any open source games that really challenge the commercial ones, considered game value, graphics, sounds etc.
Apart from the obvious answer of law-suits (remember the Aliens mod that received cease-and-desist letters), the other answer is cost. It takes hundreds of people to create a game like Civ 5 (artists, managers, programmers) and the cost is immense. These people are working on it for 5 days a week, 7.4 hours per day (more towards milestones) and open source alternatives are done in spare time around real jobs (not that game coding isn't a real job).
For a good open source game take a look at FreeCiv.
Several reasons come to mind:
It takes dozens if not hundreds of contributors over several years to create a major game title. An open source project of this magnitude would need lots of followers who are prepared to stick with it for a very long time. It would also require some people who are willing to coordinate the other developers (producers).
The replay value of a game is limited. Most people just play it through once and then move on to the next title. This differs it from an open source application or library which is always useful as long as you depend on it. This probably makes it much more difficult to find long-term commited developers.
I can't think of any business model related to open source games. Nobody would pay for support or much needed changes in the source code. Nor is there any agenda that bigger companies might be able to fulfill by funding an open source game project.
Contrary to popular belief, making games is not per se more fun than making applications (At least not for me, I've tried both).
It takes about eighty people working more than full time for two years to make a major game. (Some take more -- Assassin's Creed 2 was about 130, I think -- some take less.) These people must be real experts at what they do, and you need a lot of diverse skills: programmers, artists, writers, actors, sound designers, level designers, producers, QA.
Let's say you want to make a world-class game that competes with the chart-toppers on graphics, art, sound, design, the whole deal. You need world-class people doing this work: for example, animators who would otherwise be working full-time at Pixar or Weta. To get someone to work for you full-time instead of going to Pixar, you're going to need to pay them, a lot.
A game isn't the sort of thing where you can take what would be 40 hours of work for one person and spread it across one hour of work for forty people. It takes a lot of arduous, unfun work. It's not just programming the graphics engine -- it's testing the same broken thing over and over and over again, fixing a bug that appears only on a Windows Vista machine running a particular ATI card, painting bumpmaps onto fifty slightly different kinds of crate. Volunteer hobbyists tend to "scratch their own itch", do the thing that's interesting to them and leave it to someone else to polish.
It takes a lot of capital to make a game. You need a high-end workstation for each dev, sometimes two. Big screens. Fancy tablets for the artists. Maya licenses (there's no open source tool even remotely comparable). Are you making a console game? The development kits are $10k apiece. Doing motion capture? $500 an hour to rent the studio. Hiring voice actors? SAG scale starts at $800 per day. Having Some Guy From The Forums perform the roles just won't get a professional result. Plus electricity for all this, a building to put it in.
It's expensive, and it takes a lot of very specialized expertise, working for a long time even when they're tired and stressed and don't really agree with the Creative Vision, but need to finish the job anyway. You're going to have a hard time convincing really talented people to do that for free.
In addition to the other answers, a vital factor might be the requirement of expertise. Open source contains people mostly from developer/programmer/sysadmin realm. But only developer is not sufficient to build a game. You also need artist, sound engineer etc. For example, as a developer you can spend your free time to code game, but you can not create 3D models, as that is not your part of expertise.
Some possible reasons
The market is to fast. Graphics which is now good is in 2 years old and boring. So you have to finish a game very fast.
Its easier to make a mod to a game and there is already a community, so people do that more often (and its way easier to do).
The costs are huge. Its hard to find qualified people. Good game engines license costs a lot.
The organization is very hard.
There are a lot of project which are from people who don't know how to do it. So its hard to find a good project which could have success.
There are some, but they are rare: OpenTTD and early ID games come to mind.
But, seeing as the biggest investment is in the content and tools there's no reason the code couldn't be open source without affecting revenue. In fact, as OpenTTD has shown, it can extend the life of product with patches and improvements created by the community. Of course, you need a good game to start with.
While I generally agree with the sentiment, which is basically until you see open source movies, you are unlikely to see open source games with that production quality comparable to some of the major ones.
However, that said, there are some beautiful open source games. OpenTTD and Simutrans are mentioned - which are quite retro. For some more modern gameplay, check out stuff like Tremulous and Nexiuz.
Now that EA are cannibalizing and dumbing down the Simcity franchise, I'd love an open source offering to mop up and dominate the genre. SC4 was brilliant and unique, but needs some modernization in graphics, stability fixes, and easier community interaction for updating/extending the building types or city ordinances. LinCity does not yet have anything on SC4, and sadly SC5 plays more like the bad bits of LinCity than SC4.

How to begin with augmented reality? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm currently an undergrad in computer science and I'll be entering my final year next year. Augmented reality is something I find to be a really interesting topic, but I have no idea where to start learning about it.
Where do you start learning about this topic and what libraries are available?
Being a quite popular buzz word, augmented reality can be build with some distinct algorithms which can be learnt separately. Usually it covers:
planar object detection (can be a marker or previously trained object).
SURF/SIFT/FAST descriptors, RANSAC for homography matrix calculation
store trained objects in DB (KD-trees)
camera position estimation
augmenting 3D model with custom objects (OpenGL)
To dive into this subject I would recommend this steps:
All of this is already implemented in OpevCV, you can start playing with its examples.
To understand what's happening under the hood, take probably the best book on this topic:
"Multiple View Geometry in Computer Vision" http://www.robots.ox.ac.uk/~vgg/hzbook/ .
If you are going to play with AR on mobile phones take a look on works of scientific labs
like http://mi.eng.cam.ac.uk/~sjt59/hips.html (FAST) and http://www.robots.ox.ac.uk/~gk/PTAM/ (PTAM).
If you're comfortable with Objective-C, downloading and playing with ARKit would be great place to start. It's based on magnetometer/accelerometer readings rather than pattern recognition.
If pattern recognition is what you're interested in, then start with artoolkit instead. But that library is a bit more intense, naturally.
Take a look at this augmented reality framework comparison table to select a suitable AR framework for your work.
qualcomm's vuforia AR api is a great place to start since it is free and it has all the AR features we can think of.
And also this book gave me a huge help to start building AR apps.
Developing AR Games for iOS and Android
by Dominic Cushnan, Hassan EL Habbak
Ben Newhouse, the man behind Yelp's augmented reality Monocle feature, gave a talk at Stanford about the process he went through when making it. It is available for free on iTunes U, at this location: https://podcasts.apple.com/us/podcast/iphone-application-development-winter-2010/id384233225
(The link won't work in Chrome, but it does in Safari. If it doesn't work, just search "Yelp Monocle" in iTune's search box, and download the iTunes U lecture.)
The lecture is about programming for the iPhone, but most of it is translatable to other areas. It is packed with valuable information, and has proved extremely useful for me in seeing all the components of what i want to make.
The Pragmatic Programmer AR book is pretty good, lots of code samples and exercises that get you involved, instead of just reading about it. It is a little dated, but it should be a pretty good starting point.
This was extremely helpful to me because of the step by step tutorials and sample code: http://dev.metaio.com/sdk/getting-started/
It takes you from setting up your phone/ dev account through to tracking configurations and 3D content.
I have spent a bit of time looking for AR code for the iPhone. If you want to do AR and locations then download this project
http://github.com/adascent/iPhone-AR-Toolkit
It based on ARKit mentioned above but improved and actually compiles. The orginal AR kit does not support device rotation. Someone else added it but there actual code never worked and so a 3rd person took it and fixed it.
I am currently added more features to this code.
augmented reality is combination of 2 skills: ability to code on smartphones + using all the input sources that the handset can provide to provide interesting applications. Computer vision is a major aspect, since the camera can be used in very many interesting ways. But you must know that knowing any one aspect of it is not good enough. for example if you use comp vis, alone to detect where you are based on the camera input of a shopping mall store it is not going to be easy at all. but if you couple up your gps location etc, the problem reduces to a very managable level. So the important thing is being able to couple ideas from different aspects and knowing a little bit about both aspects. Take a smartphone programming class and a computer vision class. that should get you started.
If you're an undergrad, you start by asking faculty about it (or grad students, if you're in a place with them). Even if they don't know much about it, they'll know where to find out.

How are open source projects managed [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am working in a small team on some projects in my spare time. We are having the problem that we seem to go in circles and are not able to get our products developed - however this is not a problem during my day job. The lack of face-to-face communication seems to have a real impact on productivity.
Any examples of software or methodologies in use by the open source development community would be appreciated.
If you read the history of most open source projects, they start with one person doing a lot of the initial work. If there's a team, it's small, and one person actually leads the team.
To pick one example. In the Python community, they refer to Guido van Rossum as the Benevolent Dictator for Life (BDFL). His word is (more-or-less) final. In many cases there are folks don't agree with him -- but for the sake of the Python community -- they seem to acquiesce to his judgment.
I think every open source project has a (singular) lead programmer who assures that decisions get made, and made in a consistent way.
Back in the olden days, Fred Brooks (The Mythical Man Month) described "chief programmer teams". Same concept. Someone is in charge of the technical content. Emphasis on the one. Nowadays we call the the "architect" or some such term.
No real methodology here, but I think 2 things are important:
Have well defined goals and
responsibilities.
Let each developer
have the last say in how their
allocated part should be done.
In open source projects the only real and strongest motivation is the fun to be had coding the product. Relating to #2 above, if people are told what to do, and they don't agree with it, the motivation starts lacking. Of course there will always be a bit of give-and-take like in any other type of relationship.
Also about the face time, Skype is great for having face to face meetings, which I recommend at least once a week or month (depending on the size and momentum of the project)
This is a difficult question to answer because "open source projects" is a very broad selection of projects. I think the defining characteristic is the project has a single unifying goal (perhaps, a set of related goals).
Are you on any open source mailing lists? I am subscribed to my favorite distro's mailing list and the developers e-mail each other many times a day. Also, there are other avenues of communication such as IRC / Instant Messenger.
I am not a RoR developer, but I would suggest skimming through Getting Real for some inspiration.
My guess is that your private projects are all run and coded by developers. Developers are known to... keep on developing. The big difference, in my experience is that a company has experienced managers that can define when things are DONE. I'd recommend putting someone on the task of defining goals and decide when things are done.
I've been on some projects where we had a lot more talkers than developers. My inclination is to ignore the talkers and listen to the coders. Even then there's usually one person who is in charge of accepting patches. There may be political issues they have to tread lightly around, but for all intents and purposes they have final say.
Linus has had some fairly famous issues with the same problem. Take note of this thread from 2006: Talk is cheap. Show me the code.
One more thing. Since you say in the comments that you do have code, just a lot of rewrites, I'd highly suggest you read Eric Raymond's The Cathedral and the Bazzaar. Eric's a bit of a nutter actually, but the essay is priceless for anyone wanting to run a Free Software project.
I'd have a think about your and your team mate's motivation and goals in this project. Are they to:
a) Create an awesome product
or
b) play around with software, and learn some new things
Both answers are equally valid, and i'm guessing it'd be a mix with a leaning towards one or the other.
If it's more of (a) then look at suggestions on methodology etc. Maybe even consider forming a company around your awesome idea. Because making such a thing takes work.. and well you probably get enough of that at work.
If it's mostly (b) then you're going to have a harder time making an awesome product, but an easier time in that you can forgive yourself for not getting there right away and suffering multiple re-writes. And you will all be learning new skills each time you look at it and work together which are very applicable to your long term careers.
Firstly i suggest you all be clear with each other on why you are there. Then look at paring back on what you are planning on doing, and release early and release often. If your project is made up of three components and one is complete, then release that as a separate component and start building a community of users. This will pay off as these users will possibly help you with your code, plus form a solid core of users for the full product and let you assess how you are going early rather than later.
Good luck.

How to measure "usability" in a specification-requirements document? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
Starting to look at my last year project now, and so I'm doing the specification-requirements document. Now, it just so happens that this project requires a high degree of "usability" - I dunno if this is the right word in english, but what I mean is that it should be really easy to use from a user PoV. Now - in all the projects I've worked on so far, usability haven't really been a great factor, and so I could just write some gibberish to get around it. I always asked our teachers how they would specify the requirements of usability though, but no one have yet given me an answer I felt was good enough.
Our teachers have always preached that any requirement given on a project should be "test-able", but how do you test how easily accessable your user-interface is?
Say I had a real-time application running. Here it wouldnt be too hard to say "an entry should be deleted in less then 100ms after the initial call". But it's a lot harder to say "The userinterface should be 86% intuitive".
I guess this is a tough nut to crack, but surely I can't be the first person in the world to have thought about this, let alone having problems with it.
... how do you test how easily accessible your user-interface is?
With usability tests.
Basically, you grab a bunch of your friends (because you won't have any money to encourage strangers to participate) give them the documentation a new user would have and ask them to perform the system's key use cases.
Ideally, you want your test users to have at least some of the qualities of your target users, so if your system is aimed at a technical audience then your classmates will work; however, if your system is aimed at the general public then you're going to want to get your friends in Arts, Human Kinetics, etc. to participate.
So how do you turn that into requirements? You identify your key use cases and stipulate what how usable should they be (walk-up usable, a few minutes with the documentation, real actual training...) and then verify that your test subjects can complete the use cases without too much frustration, with the right amount of training, in a reasonable time.
Try to define usability in terms of "test-able" requirements.
You already gave yourself the answer, because usability can be described in terms of requirements like "an entry should be deleted in less then 100ms after the initial call".
What makes a user interface 86% intuitive? This can’t be answered without some form of measurement. You need to ask what features can make a user interface intuitive. Talk to the customer and the potential future users. Gather features (or better dig for them!), which would make working with the piece of software easier.
Maybe you get a list of features like:
The department’s organization must be
shown in a hierarchical tree view.
In this tree view drag & drop must be
possible.
The font size must be
configurable and saved for each user.
On the top of the screen there must
be a list of important links. Each
user may configure and save his own
personal list.
...
Make requirements out of these features. They are “testable” and thus “measureable”. If in the acceptance tests it turns out that 17 out of 20 features are working, you have 85% success.
EDIT: This works in a project environment, where you need to deliver measurements (like in many commercial projects). If you have a "softer" form of project environment where not everybody is poking on figures, then sticking too much on this formalism may be counterproductive since flexibility and agility may suffer from this.
I would advise you against quantifying usability requirements. The problem is not so much that you can't define metrics. You could say, for instance, that
it should take a person not longer than x seconds to find y on the site, or
the conversion rate of the store has to be higher than z%
etc etc
The problem is rather that you have to spend time and resources on finding acceptable target values for your metrics that you can actually reach. What is an acceptable time to find a piece of content?

When evaluating a design, how do you evaluate complexity? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
We all know to keep it simple, right?
I've seen complexity being measured as the number of interactions between systems, and I guess that's a very good place to start. Aside from gut feel though, what other (preferably more objective) methods can be used to determine the level of complexity of a particular design or piece of software?
What are YOUR favorite rules or heuristics?
Here are mine:
1) How hard is it to explain to someone who understands the problem but hasn't thought about the solution? If I explain the problem to someone in the hall (who probably already understands the problem if they're in the hall) and can explain the solution, then it's not too complicated. If it takes over an hour, chances are good the solution's overengineered.
2) How deep in the nested functions do you have to go? If I have an object which requires a property held by an object held by another object, then chances are good that what I'm trying to do is too far removed from the object itself. Those situations become problematic when trying to make objects thread-safe, because there'd be many objects of varying depths from your current position to lock.
3) Are you trying to solve problems that have already been solved before? Not every problem is new (and some would argue that none really are). Is there an existing pattern or group of patterns you can use? If you can't, why not? It's all good to make your own new solutions, and I'm all for it, but sometimes people have already answered the problem. I'm not going to rewrite STL (though I tried, at one point), because the solution already exists and it's a good one.
Complexity can be estimated with the coupling and how cohesive are all your objects. If something is have too much coupling or is not enough cohesive, than the design will start to be more complex.
When I attended the Complex Systems Modeling workshop at the New England Complex Systems Institute (http://necsi.org/), one of the measures that they used was the number of system states.
For example if you have two nodes, which interact, A and B, and each of these can be 0 or 1, your possible states are:
A B
0 0
1 0
0 1
1 1
Thus a system of only 1 interaction between binary components can actually result in 4 different states. The point being that the complexity of the system does not necessarily increase linearly as the number of interactions increases.
good measures can be also number of files, number of places where configuration is stored, order of compilation on some languages.
Examples:
.- properties files, database configuration, xml files to hold related information.
.- tens of thousands of classes with interfaces, and database mappings
.- a extremely long and complicated build file (build.xml, Makefile, others..
If your app is built, you can measure it in terms of time (how long a particular task would take to execute) or computations (how much code is executed each time the task is run).
If you just have designs, then you can look at how many components of your design are needed to run a given task, or to run an average task. For example, if you use MVC as your design pattern, then you have at least 3 components touched for the majority of tasks, but depending on your implementation of the design, you may end up with dozens of components (a cache in addition to the 3 layers, for example).
Finally something LOC can actually help measure? :)
i think complexity is best seen as the number of things that need to interact.
A complex design would have n tiers whereas a simple design would have only two.
Complexity is needed to work around issues that simplicity cannot overcome, so it is not always going to be a problem.
There is a problem in defining complexity in general as complexity usually has a task associated with it.
Something may be complex to understand, but simple to look at (very terse code for example)
The number of interactions getting this web page from the server to your computer is very complex, but the abstraction of the http protocol is very simple.
So having a task in mind (e.g. maintenance) before selecting a measure may make it more useful. (i.e. adding a config file and logging to an app increases its objective complexity [yeah, only a little bit sure], but simplifies maintenance).
There are formal metrics. Read up on Cyclomatic Complexity, for example.
Edit.
Also, look at Function Points. They give you a non-gut-feel quantitative measurement of system complexity.