Algorithms to compose music [closed] - algorithm

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Suppose I want to write an application to compose music.
I'd like to feed a set of musical scores of a composer - e.g. Bach's Well tempered clavier' - and the program should prepare new scores in a similar style.
Are algorithms or even libraries known for this task?
WikiPedia provides this page about algorithmic music composition.

You could make something basic using Markov chains. The principle is to first produce some unit of music (a single note, for example) and then, based on the last produced unit, randomly select the next unit.
First, pass through the input music. Each time you see a particular note/other unit of music, simply record in the table what came after it. When you have gone trough the entire input material, you will have a frequency table of which units follow which (After 'A', 'B' appeared 29 times, 'C' appeared 12 times and 'A' appeared twice; after 'B' ... etc).
Now select an initial note. Select the next one randomly according to the frequencies recorded in the table. Repeat until satisfied.
This will probably not yield good results if applied to individual notes, instead try short phrases. Also, the quality will improve if you have access to a large corpus of source music.

Related

Finding imagesets which are labelled for object detection? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I am building some object detectors with Tensorflow. Really enjoying it.
The most time-intensive part of any project I work on is gathering images and drawing bounding boxes around the relevant classes I want to detect.
In order to get good results, I need to tag at least 100 images for each class - usually more. When the class has a lot of variation - eg a "person" classifier - you need a hell of a lot more.
This brings me to my question, a lot of the famous base networks - MobileNet, VGG-Net, LeNet and the likes come pretrained on a few hundred different classes. So presumably they have pre-labeled/tagged images stored somewhere.
Are these available anywhere for the average developer?
I've found some - e.g from here but they don't seem to contain the labels which would allow me to generate TFRecords to train an object detector.
Tl;dr - Let's say I just want to create a "person" classifier - where can I find labelled training data for this, allowing me to quickly create classes for generating TFRecords/creating an object detector in Tensorflow?
Actually you could make full usage of the pretrained network by transfer learning or fine-tuning on them with your own dataset, it will save a lot of computation time, power.
But if you insist on training from scratch, there are some well-known image datasets like OpenImages, COCO, Kitti, etc.
These datasets contain a lot more classes other than 'person' but you can filter them out when creating tfrecord, so your tfrecord only contains bounding box information about 'person'.

Need to convert human voice into musical notes [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
A human sings a musical tone and wants to convert into a musical instrument playing the same. On processing the .wav file of the recorded human voice using aubio.org, I am able to get the pitch/frequency at different time intervals. But how to get the notes of musical instruments to be played from this data or Is there some tuner that can help me do this ?
For pitch, use the formula that MIDI 69 = 440hz, so (python/pseudo code)
midiNote = round(12 * (log(freq/440.0), 2))) + 69
But you'll find that things can actually be more complex than this for rhythm because. I'd use an already made rhythmic "quantization" package (that's the Google search term you'll want) because determining both the tempo and whether something that is 1.125 beats long should be transcribed as a quarter note or a quarter note tied to a 32nd note will depend a lot on context and it's a big programming job. There are several preexisting toolkits that will do it for you. My own python framework music21 has an audioSearch module that should do the trick for simple pieces -- at least you could take the code there and put it into your own package, since it's pretty standard FFT sample conversion techniques.

Propose please an open data for graphs [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I should to prepare myself for upcoming task which consist of a lot of graphs.
I need some data (available in free domain) to train myself.
Bigger - is better...
could you suggest some open data resource?
I'll appreciate this.
You can visit http://snap.stanford.edu/data/ . It contains many different kind of network or graph data.
Here is an answer for your could you suggest some open data resource? and not for which consist of a lot of graphs. So, plz, keep it in mind.
Here (data.gov.au) you can find a huge datasets (864!) of a different types in a different formats (txt, csv, xml, ). You will find a Finance, Industry, Geography, etc. datasets.
In other case, if you want some special (and meaningful data, for example, global population density) you can see this (a bit outdated, but usefull) source from readwriteweb.com.
And one more source: "Open Governmental Datasets" - it's worth to see it indeed.

Are there any B-tree programs or sites that show visually how a B-tree works [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I found this website that lets you insert and delete items from a B-tree and shows you visually what the B-tree looks like:
java b-tree
I'm looking for another website or program similar to this. This site does not allow you to specify a B-tree of order 4 (4 pointers and 3 elements), it only lets you specify B-trees with an even number of elements. Also, if possible, I'd like to be able to insert letters instead of numbers.
I think I actually found a different site but that was a while ago and can't find it anymore.
This is a great site, http://www.cs.usfca.edu/~galles/visualization/Algorithms.html
Has both interactive B and B+ Trees,
http://www.cs.usfca.edu/~galles/visualization/BTree.html
http://www.cs.usfca.edu/~galles/visualization/BPlusTree.html
I implemented the B-tree described in CLRS in JavaScript: http://ysangkok.github.io/js-clrs-btree/btree.html
To get started, press "init simple". Then place your cursor in the input field just before the insert button. Now enter a number which isn't in the tree and press enter. Focus remains in the field so that you can insert multiple entries quickly. If you push "delete", this will be the action triggered when you push enter.
Suggestions very welcome.

"Random Article" Feature on wikipedia.com [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 10 years ago.
Improve this question
i would like to know what algorithm and what programming language wikipedia is using to randomly choose an article to display.
i would also like to know how does it work so fast?
Here's information on that.
Every article is assigned a random number between 0 and 1 when it is created (these are indexed in SQL, which is what makes selection fast). When you click random article it generates a target random number and then returns the article whose recorded random number is closest to this target.
If you are interested you can read the actual code here.
Something along this lines:
"SELECT cur_id,cur_title
FROM cur USE INDEX (cur_random)
WHERE cur_namespace=0 AND cur_is_redirect=0
AND cur_random>RAND()
ORDER BY cur_random
LIMIT 1"
From MediaWiki.org:
MediaWiki is a free software wiki
package written in PHP, originally
for use on Wikipedia. It is now used
by several other projects of the
non-profit Wikimedia Foundation and by
many other wikis, including this
website, the home of MediaWiki.
MediaWiki is open source, so you can download the code and inspect it, to see how they have implemented this feature.
If you look at the source, they use PHP/MySQL a sort and filter pages by pregenerated random values (page_random column) that have an index on them.

Resources