<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ccarh.org/index.php?action=history&amp;feed=atom&amp;title=Music21%3A_Loading_a_Humdrum_file</id>
	<title>Music21: Loading a Humdrum file - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ccarh.org/index.php?action=history&amp;feed=atom&amp;title=Music21%3A_Loading_a_Humdrum_file"/>
	<link rel="alternate" type="text/html" href="https://wiki.ccarh.org/index.php?title=Music21:_Loading_a_Humdrum_file&amp;action=history"/>
	<updated>2026-06-20T17:12:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.ccarh.org/index.php?title=Music21:_Loading_a_Humdrum_file&amp;diff=1971&amp;oldid=prev</id>
		<title>Craig: Created page with &#039;From the music21 documentation page:    http://mit.edu/music21/doc/html/overviewFormats.html#parsing-humdrum-files  To read a Humdrum file into Music21, first you must import…&#039;</title>
		<link rel="alternate" type="text/html" href="https://wiki.ccarh.org/index.php?title=Music21:_Loading_a_Humdrum_file&amp;diff=1971&amp;oldid=prev"/>
		<updated>2011-08-05T00:01:03Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;From the music21 documentation page:    http://mit.edu/music21/doc/html/overviewFormats.html#parsing-humdrum-files  To read a Humdrum file into &lt;a href=&quot;/wiki/Music21&quot; title=&quot;Music21&quot;&gt;Music21&lt;/a&gt;, first you must import…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;From the music21 documentation page:&lt;br /&gt;
   http://mit.edu/music21/doc/html/overviewFormats.html#parsing-humdrum-files&lt;br /&gt;
&lt;br /&gt;
To read a Humdrum file into [[Music21]], first you must import the music21 module in python:&lt;br /&gt;
   from music21 import *&lt;br /&gt;
&lt;br /&gt;
You can see what functions/variables were imported from music21 by typing this command in the python interpreter:&lt;br /&gt;
   dir(music21)&lt;br /&gt;
&lt;br /&gt;
If you want basic online help for a particular function use the help() command:&lt;br /&gt;
   help(music21.converter)&lt;br /&gt;
&lt;br /&gt;
 NAME&lt;br /&gt;
    music21.converter - Public interface for importing &lt;br /&gt;
    various file formats into music21.&lt;br /&gt;
   &lt;br /&gt;
 FILE&lt;br /&gt;
    /usr/lib/python2.6/site-packages/music21/converter.py&lt;br /&gt;
   &lt;br /&gt;
 DESCRIPTION&lt;br /&gt;
    The most powerful and easy to use tool is the &lt;br /&gt;
    :func:`~music21.converter.parse` function. Simply provide a &lt;br /&gt;
    URL and, if the format is supported, a :class:`~music21.stream.Stream` &lt;br /&gt;
    will be returned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The music21.converter is used to load in a Humdrum file, either from the hard disk or from a URL:&lt;br /&gt;
   work = converter.parse(&amp;#039;http://kern.ccarh.org/data?l=beethoven/sonatas&amp;amp;file=sonata01-1.krn&amp;#039;)&lt;br /&gt;
Note that in order to download data from the internet you must first allow auto-downloading in the music21 environment.&lt;br /&gt;
&lt;br /&gt;
or in the shell, download a humdrum file to the hard disk:&lt;br /&gt;
   wget &amp;#039;http://kern.ccarh.org/data?l=beethoven/sonatas&amp;amp;file=sonata01-1.krn&amp;#039; -O sonata01-1.krn&lt;br /&gt;
or with the [[Humdrum Extras]] tool [[humcat]]:&lt;br /&gt;
   humcat h://beethoven/sonatas/sonata01-1.krn &amp;gt; sonata01-1.krn&lt;br /&gt;
and then type in python:&lt;br /&gt;
   work = converter.parse(&amp;#039;sonata01-1.krn&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once the file has been loaded you can display it with the show command:&lt;br /&gt;
   work.show()&lt;/div&gt;</summary>
		<author><name>Craig</name></author>
	</entry>
</feed>