There seems to be quite a bit of folklore knowledge floating about in restricted circles about the pitfalls of hash-consing combined with marshalling-unmarshalling of data. I am looking for citable references to these tidbits.
For instance, someone once pointed me to library aterm and mentioned that the authors had clearly thought about this and that the representation on disk was bottom-up (children of a node come before the node itself in the data stream). This is indeed the right way to do things when you need to re-share each node (with a possible identical node already in memory). This re-sharing pass needs to be done bottom-up, so the unmarshalling itself might as well be, too, so that it's possible to do everything in a single pass.
I am in the process of describing difficulties encountered in our own context, and the solutions we found. I would appreciate any citable reference to the kind of aforementioned folklore knowledge. Some people obviously have encountered the problems before (the aterm library is only one example). But I didn't find anything in writing. Even the little piece of information I have about aterm is hear-say. I am not worried it's not reliable (you can't make this up), but "personal communication" and "look how it's done in the source code" are considered poor form in citations.
I have enough references on hash-consing alone. I am only interested in references where it interferes with other aspects of programming, such as marshalling or distribution.
OK, this is not much more use, but Andrew Kennedy wrote a functional pearl called simply Pickling Combinators, which appears in the Journal of Functional Programming, (2004), 14:6:727-739. There is extensive discussion of structure sharing and how it is handled in pickles, but no direct discussion of how this problem might relate to hash-consing in the implementation of the language. But the article does discuss structure sharing in memory as well as in a pickle, so I hope it is better than nothing.
Martin Elsman had a follow-on paper in 2005 in Trends in Functional Programming; the title is Type-specialized serialization with sharing. The article deals primarily with hash-consing by the unpickler (deserializer), not with hash-consing in the impelementation, but again it may be worth something.
The JFP paper is proprietary, but there appears to be a preprint on Andrew's web page.
Elsman's paper appears to be available through Google Scholar at http://tinyurl.com/yd5tw2b.
(In a previous life, I worked on a project to create ASCII pickles that people could read and edit. I stupidly failed to publish it, but I have retained an interest.)
I found one reference on marshalling in functional languages; not sure if it will be useful, but the authors are smart: http://tinyurl.com/yc3hob9
I believe that Matthias Blume and/or Andrew Appel did something on this, but I can't find the paper. I also believe I reviewed something once for the Journal of Functional Programming, but I can't remember if the paper was accepted or who wrote it.
I suggest you ask Matthias Blume, Andrew Appel, and Phil Wadler if they can help.
Coq V5.10 had hash-consing and marshaling/unmarshaling. I didn't find anything in published form but the unmarshaling steps would be referenced as "reinterning" in the source code. Coq unmarhsaled values and then traversed them in order to re-create sharing, the obvious and only solution when all the language provides is an unmarshal function of type int_channel -> 'a.
I'm new to this field - but I need to perform a WAV-to-MIDI conversion in java.
Is there a way to know what exactly are the steps involved in WAV-to-MIDI conversion?
I have a very rough idea as in you need to;
sample the wav file, filter it, use FFT for spectral analysis, feature extraction and then write the extracted features on to MIDI.
But I cannot find solid sources or papers as in how to do all that?
Can some one give me clues as in how and where to start?
Are there any Open Source APIs available for this WAV-to-MIDI conversion process?
Advance thanks
It's a more involved process than you might imagine.
This research problem is often referred to as music transcription: the act of converting a low-level representation of music (e.g., waveform) into a higher-level representation such as MIDI or even sheet music.
The sophistication of your solution will depend upon the complexity of your input data. Tons of research papers address music transcription only on monophonic piano or drums... because they are easy to transcribe. (Relatively.) Violin is harder. Voice is even harder. Violin plus voice plus piano is much harder. A symphony is nearly impossible. You get the picture.
The basic elements of music transcription involve any of the following overlapping areas:
(multi)pitch estimation
instrument recognition, timbral modeling
rhythm detection
note onset/offset detection
form/structure modeling
Search for papers on "music transcription" on Google Scholar or from the ISMIR proceedings: http://www.ismir.net. If you are more interested in one of the above subtopics, I can point you further. Good luck.
EDIT: That being said, there are existing solutions that we can all find on the web. Feel free to try them. But as you do, evaluate them with a critical eye and ear. What types of audio signals would cause transcription to fail?
EDIT 2: Ah, you are only doing this for piano. Okay, this is doable. Music transcription has advanced to the point where it can transcribe monophonic piano pretty well. A Rachmaninov concerto will still pose problems.
Our recommendations depend upon your end goal. You state "need to perform... in Java." So it sounds like you just want something to work regardless of how it gets you there. In that case, I agree 100% with others: use something that exists.
That's actually an interesting question; all of the MIR libraries I know are typically C/C++/Python/Matlab. But not Java. The EchoNest has a Java API, but I don't think it does note-level transcription. http://developer.echonest.com. (Edit: It does note-level transcription. The returned data includes pitch, timbre, beat, tatum, and more. But I find polyphony is still a problem.)
Oh, Marsyas is Java-based. Cool. I thought it was just C++. http://marsyas.info/ I recommend this. It's developed by George Tzanetakis, a professor in MIR. It does signal-level analysis and should be a good option.
Now, if this is for a fun learning experience, I think you can use the sound manipulation utilities in Java to experiment with the WAV signal and see what comes out.
EDIT: This page describes MIR software better than I can: The Tools We Use
For Matlab, you may be interested in the MIR Toolbox
Here is a nice page of common datasets: MIR Datasets
This is a very big undertaking for being new to the field, unless you mean you are familiar with signal analysis and feature detection in general and want to look more specifically into automatic transcription.
There is no API for WAV to MIDI conversion. Vamp is a framework for feature extraction plugins, but to do automatic transcription you would need to use all the functionality of the existing plugins, plus implement functionality that exists in none of them yet.
Browse through the descriptions of the plugins on the vamp download page, any descriptions you do not understand are topics you should start researching if you want to do this.
If you don't need to automate this task (ie, for a website where people can upload MP3's and get MIDI files back), then you should consider using a tool like Melodyne which is already quite good at going this. As Steve noted, this is a very difficult task to accomplish, and even the best algorithms and solutions present at the moment are not 100% reliable.
So if you are just doing studio work and need to do a few conversions, it will probably save you a bit of time (and lots of headache) to use a tool already designed for this task.
This is a field which is still highly under development, yet, there are some (experimental) algorithms available.
You can install sonic annotator and use a few vamp plugins.
For example:
./sonic-annotator file.wav -d vamp:qm-vamp-plugins:qm-transcription:transcription -w midi
./sonic-annotator file.wav -d vamp:silvet:silvet:notes -w midi
./sonic-annotator file.wav -d vamp:ua-vamp-plugins:mf0ua:mf0ua -w midi
Dolphin, sorry to be brusque, but you have completely underestimated the problem. What you want to achieve - a full piano sound transcription involving all parameters that were used while playing would need an enormous amount of research with people who have worked in the field for many years. Even a group of PhDs in signal processing would have to invest a lot of work to even come close to what you mean. Music transcription has needed decades of work to even work halfway reliable. I'd suggest you pick a different problem which you can manage better than this.
I've read through the MSDN documentation on DirectShow and it's still confusing. I feel like I need more context for what the objects are: Graphs, Pins, Filters...etc. A Google search doesn't give me much to work with. What do I need to grok DirectShow?
EDIT: The wikipedia page on DirectShow does a pretty good job.
MSDN Magazine has a nice article in their July 2002 Issue: DirectShow: Core Media Technology in Windows XP Empowers You to Create Custom Audio/Video Processing Components
Pascal Mignot from Université de Reims has gathered information from MSDN documentation into a single document, which gives a nice overview.
Also, there is a very good book on
DirectShow.
http://betterlogic.com/roger/?p=3088
has some good links, as also I have some demo projects here: https://github.com/rdp
The SDK has quite a few samples which may help. Fortunately I had some existing code to walk through, but it sure is lengthy and as often with MS, the interfaces don't really look like what they do, but instead focus more on juggling pointers, typecasting and COM trouble, instead of focusing on the intended functionality.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
My 7 year old would like to learn, how to program? (his idea not mine, and he does things in the outside world. So, I am not too worried from that point of view. He already went so far as to take a game programming book out of my office to read at bed time.) The other day we sat down and wrote a very simple number guessing game (you pick 8 and it is correct, anything else it is wrong).
It went OK but there were a number of questions he had based on the syntax of the language. (I happened to pick Java as I had the IDE opened at the time.) I teach post-secondary introductory programming courses so this was a bit of an eye opener to me (most students out of high school are reluctant to ask questions) as I really had to figure out, how to explain syntax to a 7 year old?
Clearly any C type language is going to have the same issues, as will most “languages”. I looked at squeak but decided not to use it yet. I looked at the Alice environment but didn't like it for this either.
From a physical point of view he is comfortable with a keyboard/mouse and can put together Lego sets with relative ease (so following directions with a fun outcome works for him). I have access to Lego NXT but he is still a bit young for that (it takes too long to see the results of the work, even with the supplied graphical environment).
Ideally I'd like the experience to help him build up confidence in math and logic (if a 7 year old has logic:-).
I remember using turtle graphics/logo as a child. I am leaning towards this but wondering if there are any other ideas or if anyone can recommend a good logo environment?
Edit 1:
Logo works out well. I'll need to teach him the concept of angles (90 degrees, 180 degrees). Unfortunalty they don't really do division at school yet so angles might be fun...
First off draw a square:
FORWARD 50
RIGHT 90
FORWARD 50
RIGHT 90
FORWARD 50
RIGHT 90
FORWARD 50
RIGHT 90
At some point later I'll go into loops:
REPEAT 4
[
FORWARD 50
RIGHT 90
]
And then variables:
make "length 50
REPEAT 4
[
FORWARD :length
RIGHT 90
]
This works out very well. Virtually no syntax, easy for a 7 year old to remember the vocabulary, and immediate feedback.
Edit 2:
Well it was a success, in that he was able to write a simple program (no loops yet) while I was out of the room. It actually works out very well - we went out and got to graph paper and a protractor, we fugured out 90 degree angles, and he made a bunch of squares, turned a square into a rectangle, and got to see where he went wrong and how to debug it. I'd recommend this approach for anyone with a 7 year old who is interested in programming. I think I'd recommend it to my post-secondary students too (!)
There is actually a browser-based Logo interpreter in Javascript.
http://logo.twentygototen.org/
I strongly disagree with the people who say seven year olds would have a hard time learning new syntax. This is completely backwards. Try teaching pig latin to a seven year old and to a thirty something non-native English speaker. Or try traveling in a foreign country with your kids. See who can chat fluently with the natives after a month (hint: it probably won't be you).
Kids pick up on arbitrary linguistic conventions much faster than us gray hairs do.
I learned how to program when I was 10 in exactly the way you taught your son. My dad used the GW-Basic interpreter that came with our AT&T PC6300, and we wrote a game where the computer asked you a question, and you had to answer A/B/C. The big advantage to syntax in GW-Basic was that you didn't have multi-line statements. You might want to try something similar. Java, with it's curly braces, might be a little tough.
Example code:
10 PRINT "What color is Big Bird?"
20 PRINT "A. Blue"
30 PRINT "B. Green"
40 PRINT "C. Yellow"
50 INPUT$ ANSWER$
60 IF ANSWER$ = "C" THEN PRINT "Good Job!" ELSE PRINT "Oops, wrong answer!"
I spent hours upon hours using various permutations of that syntax and writing my own "games". And it made me want to learn more... might help.
Tell him about parsers. You just need to add context and reasoning to why things exist. The curly braces are so that the machine that reads the code knows where things start and stop.
I find that most people including children pick up things easily as long as you explain the purpose of them. This is why school was a terrible failure for me, no-one ever explaining the point of learning half the stuff.
Scratch is another one. Developed at MIT specifically for the purpose of teaching programming to children.
I think that Python might fit your needs. It is well known for being easier to learn than many other languages and the interactive interpreter allows programmers to immediately see what happens when a piece of code is executed. The IDLE gui that comes with it is easy to use. It also has a turtle module through TKinter.
https://docs.python.org/library/turtle.html
Developmentally, a seven year-old is unlikely to grasp the basics of syntax even in their spoken language.
Whatever language or environment you use, I would recommend focusing on the idea of programming as play rather than the ability to write actual programs. Towards this end, something you can run from a command line and see immediate results, like Python or, for a more graphical experience, Silverlight, would probably be best.
Microsoft has a couple of interesting efforts that seems a nice fit:
popfly: http://msdn.microsoft.com/en-us/devlabs/cc950523.aspx --- "Popfly includes a simple way to create and share games with your friends. Choose from a variety of built-in templates or start from scratch to create a side scrolling game, a 2D shoot-em-up, or a host of others. And best of all, you can get started without writing a line of code" ... I think it can really help being motivated :)
smallbasic: http://msdn.microsoft.com/en-us/devlabs/cc950524.aspx --- supposed to be simplified but having intellisense+.net framework support (the short description is too marketing like, so I didn't paste it :P)
Try Small Basic, which has a mini-BASIC language and simplified for the younger crowd.
Flee from Java! Try something designed for teaching, like scratch, LOGO, or PLT Scheme.
Why not go back to the days of QBasic? That's the first language I learned (actually it was GW-BASIC, but that's beside the point).
The syntax is much easier to get one's head around (albeit fickle and sometimes downright frustrating). It doesn't teach anything OO, but that's probably above his head anyway, as it would have been mine.
This site may also be of interest.
I'd say use visual basic, or something similar where you don't have to worry about syntax, curly braces, etc as much. I was programming at 7, but it was in LOGO and C64 Basic. I HATED LOGO ... it was so frustrating to me that one of the "big" things you could do was move around a stupid turtle. However, C64 Basic (to me) was great ... once I had that down (a couple years) I was psyched to learn C and even C64 assembler.
Two thoughts come to mind:
My 3 year old son loves playing World of Goo with me. He can't solve problems yet, but I can see he is soaking up loads of information.
Have a go with Alice. My son is too young to try this, but once he is older we'll give it a go if he is keen. FWIW I learnt about this program after watching The Last Lecuture by Randy Pausch (R.I.P)
Have him check out http://scratch.mit.edu. My seven year old is learning this as we type...
Etoys is perhaps the thing you're looking for. It's a partly graphical flavour of smalltalk made just for children. This is used by the olpc project.
I was involved with a primary-grade computer course using Stagecast. This is a graphical programming language designed for children. I found it an ideal introductory language because it is graphical and interactive. It does not require reading or mathematics, it runs on Windows and Mac OS, and is ideal for simple games so children are motivated to learn.
While it appears that it is being redesigned, you can still get the old version of Hackety Hack, which is a ruby programming kit designed by _why for teenagers and beginning programmers.
I am a bit torn about Alice.
On the one hand, it is nice to have a framework where you can program with direct visual gratification. This is really a good idea.
On the other hand, I think that it is a very bad idea to have beginners program exclusively by drag and drop. I fear that this might even lead to a sort of illiteracy, where they are unable to produce properly written code when the drag and drop interface is taken away.
Personally, I think the basics of arithmetic operations and Boolean logic are more important to teach to a child first. After they have grasped these concepts then I think moving on to the basic constructs are appropriate. I just don't see how a child could understand conditionals and looping without Boolean logic, but then again, there are some pretty bright kids out there :)
Assuming the previous statement is met, I would have to cast my vote for python.
I would have looked for one of the many arcade game engines and let him play with that. Choose one where he will need to use loops and conditions, and maybe some procedures.
There a book called Learning to program from pragmatic that is geared towards people who have never programmed before and might not be extremely technical.
It uses Ruby which can be quite easy for new people to pick up.
Squeak Smalltalk system is an implementation of Smalltalk that I have heard much good about when it comes to educating children in programming.
The Etoys project supposedly contains lots of resources for keeping the learning experience fun and motivating.
I became interested in programming when I was introduced to Turing language in high school. Turing was used as a teaching language in many schools at the time, and it worked very well for me to introduce programming concepts. Here is a description of Turing from WikiPedia
Turing is a Pascal-like programming language developed in 1982 by Ric Holt and James Cordy, then of University of Toronto, Canada. Turing is a descendant of Euclid, Pascal and SP/k that features a clean syntax and precise machine-independent semantics.
Named after British computer scientist Alan Turing, Turing is used primarily as a teaching language at the high school and university level. Two other versions exist, Object-Oriented Turing and Turing Plus, a systems programming variant. In September 2001, "Object Oriented Turing" was renamed "Turing" and the original Turing was renamed "Classic Turing". Turing is available from Holt Software Associates in Toronto.
Versions for Microsoft Windows, Linux and Apple Macintosh are available. Turing is still widely used in high schools in Ontario as an introduction to programming.
In November 2007, Turing, which was previously a commercialized programming language, became freeware. As of November 28, 2007, it was available for download from the Holt Software website free of charge for personal, commercial, and educational use.1
You could also use Commodore 64 emulator. It start's right from BASIC.
Might as well throw out Lego™ Mindstorms™ as a possibility. It uses a graphical programming language based on LabView.
I read this post earlier today, and then by chance accidentally went to YUP.com and discovered
Teaching Kids to Hack(Program) with Hackety Hack
Figured I'd post it as an additional resource for anyone looking at this question.
I recently responded to a similar SO question with a pointer to kidbasic, which is open source and cross platform software.
Scheme is nice and syntactically similar to Logo, in the respects of simplicity. Also Scheme offers a very intuitive way of understanding recursion and picking up these type of fundamental concepts in computer science that early on is nothing but good with more good.
UCB Scheme also offers a lot of built in functionality for manipulating sentences, which may make more sense to a 7 year old than constructing polygons and solving number puzzles (not to say that the sky's the limit!).
I was typing programs from the book "BASIC Fun" when I was in 2nd grade.
I distinctly remember that the concepts of infinite loops and INPUT A$ was like discovering gravity. Heady stuff.
Self taught, my progress was glacially slow, although I did reach a point in a program where I wished that GOSUB took variable arguments, which in retrospect meant I understood function pointers.
My early goals included writing LONG programs. A lengthy program not a bad goal for a 7 year old because a program with a well defined spec makes the risk of failure too high. Anyone can write a long program and feel good about it and learn a lot along the way.
There was a whole genre of books for programming in BASIC for kinds from the 80s. That stuff is a great source of programming ideas. However I wouldn't recommend using BASIC even for a 7 year old-- lua has the simple feel of BASIC but it isn't broken crap.
Look no further, there's actually an entire learning platform/ OS designed for this very purpose: Sugar.
The OLPC (One Laptop Per Child) operating system called Sugar is now available to the general public and you can run it as a VM within all major operating systems such as Mac, Windows and Linux.
Download a copy at Sugar Labs.
One interesting activity included is called TurtleArt, a souped up 21st century version of Logo. Also has a kid friendly version of a Python IDE called Pippy. It actually teaches kids Python!
See TurtleArt and Pippy and the other activities found in Sugar.
Alan Kay was behind some of the novel concepts in Sugar OS which is actually a modern incarnation of his visionary DynaBook. Even as an adult (who's an engineer), I find it fun to play with.
And if you love Sugar as a VM, you can even buy the hardware and at the same time help a poor kid somewhere else in the world.
Engadget explains : OLPC XO Buy-One, Give-One program underway
As a bonus to us adults, Sugar is derived from Fedora. So it's a real and complete Linux based OS. Should be fun to hack. ;-)
I'm a totally blind individual who would like to learn more of the theory aspect of computer science. I've had an intro data structures class and the general intro programming but would like to learn more on things such as software design, advanced data structures, and compiler design. I want to do this as a self study course not as part of college classes.
Unfortunately there aren’t many text books available on computer science from Recordings for the Blind and Dyslexic where I normally get my textbooks. I would appreciate any electronic resources preferably free that could help me get more of a computer science education rather then the newest language or platform that a lot of programming sites appear to focus on.
You might find the Experiences of a Blind Computer Scientist a good read.
MIT's Open Courseware would be a good resource for you with the amount of videos/audio they have.
Really though, for the core computer-science topics I find it pretty hard to beat some of the better textbooks out there. Some offer digital versions of their book with purchase and some don't. For those that don't, I would just purchase the book and then download via a torrent site a digital e-book equivelant. Since you already own the book I don't think this would be a major problem.
UC Berkley has a couple of computer science courses online for free as mp3 and video files (including RSS feed for each course). And if reading PDF files aren't an issue you could check out O'Reilly's Safari.
The text book for Structure and Interpretation of Computer Programs appears to be accessible. Software engineering radio is a good podcast that I listen to but recently has focused a lot on model driven development and UML which doesn't interest me. The UC Berkley
lectures are of varying quality, it's like all other college classes it depends on the professor. I've found I can follow along with the cs162 lectures fine but not so much with the cs61b. Part of this is because of the professor and part is probably because 61b is more math heavy since it's a data structures class. Unfortunately the RSS feeds are useless since the file names are meaningless. I used my podcatcher to download the entire lecture series, then used the converting capability of foobar 2000 to rename the files with there track number so I could listen to them in order. I've used Safari at work before and it is accessible although to expensive for me to get a yearly subscription. Open Courseware appears to have a lot of good stuff. Unfortunately I don't use itunes so instead of downloading each mp3 file individually I used the firefox extension DownThemAll! with a custom filter to grab all the mp3 files at once from the specific course I wanted. Another series of books that looks useful are the data structures books by Bruno R. Preiss several of which are available online at
http://www.brpreiss.com/books/opus5/
Some of the equations are represented as graphics but I can often tell what the general idea is by context.
I wonder would the Structure and Interpretation of Computer Programs video lectures by Hal Abelson and Gerald Jay Sussman be of any use?
If the audio content is enough on its own without the video, they are an excellent digital resource.
The podcast "software engineering radio" is excellent. Though not CS courseware, it is the most academic and intellectually stimulating podcast I have found about software development and computer science.
http://www.se-radio.net/
personally I am just blown away by the questioner. I mean, the challenge alone of programming is too much for most people but being without the primary sense used in the task is amazing to me. What is ironic though is I bet that given this challenge the questioner is still FAR more adept at most CS tasks than the people I work with day to day. Just saying.
I'm also a totally blind programmer, currently working for Microsoft. The most valuable resource for te technical books is Safari (safari.oreilly.com). You can read thousands of computer science texts there. if you're in the USA, you can also get many of those titles for free from BookShare (www.bookshare.org). In both cases graphical images will be an issue, but there's no easy solution for that. Most good books have enough descriptive text that one can manage without the diagrams.
I to am a new blind programmer! I only lost my vision 5 years ago. Anyway, I have been programming in Visual Basic 2008 throughout the past year. It turned out to be more accessible than I had at first suspected.
I start a Java class next semester and the required text is a free online text! It is posted below.
Introduction to Programming Using Java, Fifth Edition
http://math.hws.edu/javanotes/
Can some of you seasoned blind programmers share with us any blogs or websites where other blind programmers can be found??
Check out this Stack Overflow question about podcasts.
A language called Quorum is a lot like Python but optimized across a few more syntactic details, and the corresponding development environment is designed with the blind in mind. https://quorumlanguage.com/ This might fit especially well with the use case where most students are using Python.
A 2016 blog about CSed (actually a response to a blog post) points to
program-l discussion board for blind programmers at https://www.freelists.org/list/program-l
The EPIQ conference for blind and other programmers interested in Quorum
https://quorumlanguage.com/epiq.html
Also, see other ideas in a similar question on another SO site: https://cseducators.stackexchange.com/questions/3441/teaching-a-blind-high-school-student