From 859f9f9d665f091553b0be82418a54c4b6e34eed Mon Sep 17 00:00:00 2001 From: shoofle Date: Sat, 23 Aug 2025 12:11:22 -0400 Subject: [PATCH] Sorry for not git-ing this until now. --- Hornbostel-Sachs | 576 ++++++++++++++++++ Shapes | 1 + generate_instrument.py | 51 ++ generate_instrument_2.py | 189 ++++++ generate_instrument_3.py | 12 + instrument-generator-notes/.gitignore | 5 + instrument-generator-notes/generator 3.md | 85 +++ .../hornbostel-sachs links.md | 7 + readme.md | 44 ++ 9 files changed, 970 insertions(+) create mode 100644 Hornbostel-Sachs create mode 100644 Shapes create mode 100644 generate_instrument.py create mode 100644 generate_instrument_2.py create mode 100644 generate_instrument_3.py create mode 100644 instrument-generator-notes/.gitignore create mode 100644 instrument-generator-notes/generator 3.md create mode 100644 instrument-generator-notes/hornbostel-sachs links.md create mode 100644 readme.md diff --git a/Hornbostel-Sachs b/Hornbostel-Sachs new file mode 100644 index 0000000..7c52e67 --- /dev/null +++ b/Hornbostel-Sachs @@ -0,0 +1,576 @@ +-1 The vibrations are coupled with a transducer to create an electrical signal that is processed through an amplifier and loudspeaker (Applied only to instruments that have not been structurally modified or designed to be played through a loudspeaker; all these are classed as Electrophones in Group 5) +-11 With non-integral microphones +-12 With non-integral pickups +-8 With keyboard +-9 With mechanical drive +1 IDIOPHONES The substance of the instrument itself, owing to its solidity and elasticity, vibrates and may radiate sound11 without requiring stretched membranes or strings +11 Struck idiophones The instrument is made to vibrate by being struck upon +111 Idiophones struck directly The player himself executes the movement of striking; whether by mechanical intermediate devices, beaters, keyboards, or by pulling ropes, etc., is immaterial; it is definitive that the player can apply clearly defined individual strokes and that the instrument itself is equipped for this kind of percussion +111.1 Concussion idiophones or clappers Two or more complementary sonorous parts are struck against each other +111.11 Concussion sticks or stick clappers Vietnam, India, Marshall Is. +111.12 Concussion plaques or plaque clappers China, India +111.13 Concussion troughs or trough clappers Burma [Myanmar] +111.14 Concussion vessels or vessel clappers Even a slight hollow in the surface of a board counts as a vessel +111.141 Castanets Vessel clappers, either natural, or artificially hollowed out +111.142 Cymbals Vessel clappers with everted rim +111.143 Concussion bells Nigeria +111.2 Percussion idiophones The instrument is struck either with a non- sonorous object (hand, stick, striker) or against a non-sonorous object (human body, the ground) +111.21 Percussion sticks +111.211 (Individual) percussion sticks Japan, Vietnam, Balkans; also the triangle +111.212 Sets of percussion sticks Several percussion sticks of different pitch are combined to form a single instrument All xylophones +111.22 Percussion plaques +111.221 (Individual) percussion plaques In the oriental Christian Church, +111.222 Sets of percussion plaques Lithophone (China), and most metallophones +111.23 Percussion tubes +111.231 (Individual) percussion tubes Tubular bell NB Not slit drums, which are a sub-group of bells, 111.243 +111.232 Sets of percussion tubes Tubaphon, tubular xylophone +111.24 Percussion vessels +111.241 Gongs The vibration is strongest near the vertex +111.241.1 (Individual) gongs S. and E. Asia including the so-called metal drums, or rather kettle-gongs12 +111.241.11 Bossed gongs, flat gongs (with flange) and intermediate types +111.241.12 Gongs with divided surface sounding different pitches Steel drum (Caribbean) +111.241.2 Sets of gongs [gong chimes] +111.241.21 Sets of bossed, flat gongs (with flange) and intermediate types S.E.Asia, E. Asia +111.241.22 Sets of gongs with divided surface sounding different pitches Steel drums (Caribbean) +111.242 Bells The vibration is weakest near the vertex +111.242.1 (Individual) Bells +111.242.11 Resting bells The cup is placed on the palm of the hand or on a cushion; its mouth faces upwards China, Indo-China, Japan +111.242.12 Suspended bells The bell is suspended from the apex +111.242.121 Suspended bells struck from the outside No striker is attached inside the bell, there being a separate beater +111.242.122 Clapper bells A striker (clapper) is attached inside the bell +111.242.123 Bells with attached external clapper/s +111.242.2 Sets of bells [chimes] (subdivided as 111.242.1): +111.242.21 Sets of resting bells +111.242.22 Sets of suspended bells +111.242.221 Sets of suspended bells struck from the outside +111.242.222 Sets of clapper bells +111.242.223 Sets of bells with attached external clappers +111.243 Slit Drums +111.244 Percussion troughs e.g. some forms of ‘slit drum’ such as Fijian lali where the whole ‘mouth’ is open +111.25 Percussion boulders Rock gongs +112 Indirectly struck idiophones The player himself does not go through the movement of striking; percussion results indirectly through some other movement by the player. The intention of the instrument is to yield clusters of sounds or noises, and not to let individual strokes be perceived +112.1 Shaken idiophones or rattles The player executes a shaking motion +112.11 Suspension rattles Perforated idiophones are mounted together, and shaken to strike against each other +112.111 Strung rattles Rattling objects are strung in rows on a cord Necklaces with rows of shells +112.112 Stick rattles Rattling objects are strung on a bar (or ring) Sistrum with rings +112.12 Frame rattles Rattling objects are attached to a carrier against which they strike +112.121 Pendant rattles Rattling objects are hung from a frame Dancing shield with rattling rings +112.122 Sliding rattles Non-sonorous objects slide to and fro in the slots of the sonorous object so that the latter is made to vibrate; or sonorous objects slide to and fro in the slots of a non-sonorous object, to be set in vibration by the impacts Anklung, sistrum with rods +112.13 Vessel rattles Rattling objects enclosed in a vessel strike against each other or against the walls of the vessel, or usually against both. NB The Benue gourd rattles with handle, in which the rattling objects, instead of being enclosed, are knotted into a net slipped over the outer surface, count as a variety of vessel rattle Fruit shells with seeds, ‘pellet bells’ enclosing loose percussion pellets +112.2 Scraped idiophones The player causes a scraping movement directly or indirectly: a non-sonorous object moves along the notched surface of a sonorous object, to be alternately lifted off the teeth and flicked against them; or an elastic sonorous object moves along the surface of a notched non-sonorous object to cause a series of impacts. This group must not be confused with that of friction idiophones +112.21 Scraped sticks A notched stick is scraped with a little stick +112.211 Scraped sticks without resonator S. America, India (notched musical bow), Congo +112.212 Scraped sticks with resonator Usumbara, E. Asia (tiger) +112.22 Scraped tubes S. India +112.23 Scraped vessels The corrugated surface of a vessel is scraped S. America, Congo region +112.24 Scraped wheels or cog rattles A cog wheel, whose axle serves as the handle, and a tongue fixed in a frame which is free to turn on the handle; when whirled, the tongue strikes the teeth of the wheel one after another Europe, India +112.25 Scraped boards Jazz washboard +112.3 Split idiophones Instruments in the shape of two springy arms connected at one end and touching at the other; (in some examples) the arms are forced apart by a little stick, to jingle or vibrate on recoil China (huan t'u), Malacca now West Malaysia, Iran (qašik), Balkans +12 Lamellaphones13 (or plucked idiophones) Lamellae, i.e. elastic plaques, fixed at one end, are flexed and then released to return to their position of rest +121 In the form of a frame The lamella vibrates within a frame or hoop +121.1 Clack idiophones (cricri) The lamella is carved in the surface of a fruit shell, which serves as a resonator Melanesia +121.2 Guimbardes (trumps,14 also known as jew’s harps) The lamella is mounted in a rod- or plaque-shaped frame and depends on the player’s mouth cavity for resonance +121.21 Idioglot guimbardes The lamella is carved in the frame itself, its base remaining joined to the frame India, Indonesia, Melanesia +121.22 Heteroglot guimbardes A lamella is attached to a frame +121.221 (Single) heteroglot guimbardes Europe, India, China +121.222 Sets of heteroglot guimbardes Several heteroglot guimbardes of different pitches are combined to form a single instrument Aura +122 In board- or comb-form The lamellae are attached to a board or cut out from a board like the teeth of a comb +122.1 With laced-on, or hooked-in15 lamellae +122.11 Without resonator All lamellaphones16 on a plain board +122.12 With resonator All lamellaphones with a box or bowl below the board +122.2 With cut-out lamellae (musical boxes) Pins on a cylinder pluck the lamellae +13 Friction Idiophones The instrument is made to vibrate by friction +131 Friction sticks +131.1 (Individual) friction sticks Sandpaper blocks +131.2 Sets of friction sticks +131.21 With direct friction The sticks themselves are rubbed Nail fiddle, nail piano, Stockspiele +131.22 With indirect friction The sticks are connected with others which are rubbed and, by transmitting their longitudinal vibration, stimulate transverse vibration in the former Chladni’s euphon +132 Friction plaques +132.1 (Individual) friction plaques (unknown) +132.2 Sets of friction plaques [livika] New Ireland +133 Friction vessels +133.1 (Individual) friction vessels Brazil (tortoise shell) +133.2 Sets of friction vessels Verillon (glass armonica) +134 Friction sheet Theatrical wind machine +14 Blown idiophones The instrument is made to vibrate by being blown upon +141 Blown sticks +141.1 (Individual) blown sticks Unknown +141.2 Sets of blown sticks Aeolsklavier +142 Blown plaques +142.1 (Individual) blown plaques Unknown +142.2 Sets of blown plaques Piano chanteur +15 Metal sheets the vibrating material consists of a flexible sheet of metal +151 Played by friction Bowed musical saw +152 Directly struck Hammered musical saw, theatrical thunder sheet played with a hammer17 +153 Played by shaking Theatrical thunder sheet (played without hammer) +154 Shaken and indirectly struck Flexatone +16 Flexed diaphragms A diaphragm is flexed when a string passing through its centre is pulled, before returning to rest. England, modified yoghurt pot or metal watering-can rose mimicking the sound of a clucking cockerel +2 MEMBRANOPHONES The sound is excited by tightly stretched membranes +# Suffixes for use with any division of membranophones: +-6 With membrane glued to drum +-7 With membrane nailed to drum +-8 With membrane laced to drum +-81 Cord-(ribbon-) bracing The cords are stretched from membrane to membrane or arranged in the form of a net, without employing any of the devices described below +-811 With tension ligature Cross ribbons or cords are tied round the middle of the lacing to increase its tension Sri Lanka +-812 With tension loops The cords are laced in a zigzag; every pair of strings is caught together with a small ring or loop India +-813 With wedge-bracing Wedges are inserted between the wall of the drum and the cords of the lacing; by adjusting the position of the wedges it is possible to control the tension India, Indonesia, Africa +-82 Cord-and-hide bracing The cords are laced at the lower end to a non- sonorous piece of hide Africa +-83 Cord-and-board bracing The cords are laced to an auxiliary board at the lower end Sumatra +-84 Cord-and-flange bracing The cords are laced at the lower end to a flange carved from the solid Africa +-85 Cord-and-belt bracing The cords are laced at the lower end to a belt of different material India +-86 Cord-and-peg bracing The cords are laced at the lower end to pegs stuck into the wall of the drum Africa NB +-9 With membrane lapped on A ring is slipped over the edge of the membrane +-91 With membrane lapped onto a ring of cord Africa +-92 With membrane lapped onto a hoop +-921 With mechanism Machine timpani +-9211 With pedals Pedal timpani +21 Struck drums The membranes are struck +211 Drums struck directly The player himself executes the movement of striking; this includes striking by any intermediate devices, such as beaters, keyboards, etc; drums that are shaken are excluded +211.1 Vessel drums The single playing head encloses a body in the form of a vessel that is curvilinear or rectilinear in profile Kettledrums +211.11 Separate vessel drums European timpani +211.12 Sets of vessel drums W. Asian permanently joined pairs of kettledrums +211.2 Tubular drums The body is tubular, with membranes enclosing one or both ends +211.21 Cylindrical drums The diameter is essentially the same at the middle and the ends. Occasionally the ends will taper slightly or have projecting discs +211.211 Single-skin cylindrical drums The drum has only one membrane and the opposite end is open +211.211.1 Individual single-skin cylindrical drums, with single membranes and open ends Malacca, now West Malaysia +211.211.2 Sets of single-skin cylindrical drums, with single membranes and open ends +211.212 Double-skin cylindrical drums, the drum has two18 membranes +211.212.1 Individual double-skin cylindrical drums +211.212.11 Individual double-skin cylindrical drums, one skin used for playing Side drum, tenor drum, tambourin de Provence +211.212.12 Individual double-skin cylindrical drums, both heads played Turkey (davul). Almost world-wide (bass drum in marching band). +211.212.2 Sets of double-skin cylindrical drums +211.212.21 Sets of double-skin cylindrical drums with single playing heads USA/Europe drum kit +211.212.22 Sets of double-skin cylindrical drums, both heads played +211.22 Barrel-shaped drums The diameter is larger at the middle than at the ends; the body is curvilinear Asia, Africa, Ancient Mexico Subdivisions as for 211.21 +211.221 Single-skin barrel drums +211.221.1 Individual single-skin barrel drums +211.221.2 Sets of single-skin barrel drums +211.222 Double-skin barrel drums +211.222.1 Individual double-skin barrel drums +211.222.11 Individual double-skin barrel drums, one skin used for playing +211.222.12 Individual double-skin barrel drums, both heads played +211.222.2 Sets of double-skin barrel drums +211.222.21 Sets of double-skin barrel drums with single playing heads +211.222.22 Sets of double-skin barrel drums, both heads played +211.23 Double-conical drums The diameter is larger at the middle than at the ends; the body is rectilinear with angular profile India (mrdanga, pakhavaj) Subdivisions as for 211.21 +211.231 Single-skin double-conical drums +211.231.1 Individual single-skin double-conical drums +211.231.2 Sets of single-skin double-conical drums +211.232 Double-skin double-conical drums +211.232.1 Individual double-skin double-conical drums +211.232.11 Individual double-skin double-conical drums, one skin used for playing +211.232.12 Individual double-skin double-conical drums, both heads played +211.232.2 Sets of double-skin double-conical drums +211.232.21 Sets of double-skin double-conical drums with single playing heads +211.232.22 Sets of double-skin double-conical drums, both heads played +211.24 Hourglass-shaped drums The diameter is smaller at the middle than at the ends Asia, Melanesia, E. Africa Subdivisions as for 211.21 +211.241 Single-skin hourglass-shaped drums +211.241.1 Individual single-skin hourglass-shaped drums +211.241.2 Sets of single-skin hourglass-shaped drums +211.242 Double-skin hourglass-shaped drums +211.242.1 Individual double-skin hourglass-shaped drums +211.242.11 Individual double-skin hourglass-shaped drums, one skin used for playing +211.242.12 Individual double-skin hourglass-shaped drums, both heads played +211.242.2 Sets of double-skin hourglass-shaped drums +211.242.21 Sets of double-skin hourglass-shaped drums with single playing heads +211.242.22 Sets of double-skin hourglass-shaped drums, both heads played +211.25 Conical drums The diameter at the ends differ considerably; some minor departures from strict conicity, inevitably met, are disregarded here +211.251 Single-skin conical drums +211.251.1 Individual single-skin conical drums +211.251.2 Sets of single-skin conical drums +211.252 Double-skin conical drums +211.252.1 Individual double-skin conical drums +211.252.11 Individual double-skin conical drums, one skin used for playing +211.252.12 Individual double-skin conical drums, both heads played +211.252.2 Sets of double-skin conical drums +211.252.21 Sets of double-skin conical drums with single playing heads +211.252.22 Sets of double-skin conical drums, both heads played +211.26 Goblet-shaped drums The body consists of a main section which is either cup shaped or cylindrical, and a slender stem; borderline cases of this basic design like those occurring notably in Indonesia, do not affect the identification, so long as a cylindrical form is not in fact reached Darabukka +211.27 Cylindro-conical drums. The body is in two sections, a cylindrical upper and a conical lower section +211.271 Single-skin cylindro-conical drums +211.271.1 Individual single-skin cylindro-conical drums. Sometimes the foot is flared. +211.271.2 Sets of single-skin cylindro-conical drums +211.272 Double-skin cylindro-conical drums +211.272.1 Individual double-skin cylindro-conical drums +211.272.11 Individual double-skin cylindro-conical drums, one skin used for playing Uganda drum +211.272.12 Individual double-skin cylindro-conical drums, both heads played +211.272.2 Sets of double-skin cylindro-conical drums +211.272.21 Sets of double-skin cylindro-conical drums with single playing heads Uganda (Entenga drum chime) +211.272.22 Sets of double-skin cylindro-conical drums, both heads played +211.28 Vase-shaped drums. The body is waisted and rests on an open foot that may be flared. The upper section is conical, and the lower section, which is rectilinear or curvilinear in profile, tapers towards the foot. These drums have a single membrane +211.3 Frame drums The depth of the body does not exceed the radius of the membrane. NB The European side-drum, even in its most shallow form, is a development from the long cylindrical drum and hence is not included among frame drums +211.31 Frame drums (without handle) +211.311 Single-skin frame drums Tambourine +211.312 Double-skin frame drums N. Africa, Portugal +211.32 Frame drum with handle A stick is attached to the frame in line with its diameter +211.321 Single-skin frame drums with handle Inuit +211.322 Double-skin frame drums with handle Tibet +212 Rattle drums (sub-divisions as for drums struck directly, 211) The drum is shaken; percussion is by impact of pendant or enclosed pellets, or similar objects India, Tibet +212.1 Vessel rattle drums +212.2 Tubular rattle drums +212.21 Cylindrical rattle drums +212.211 Individual cylindrical rattle drums +212.212 Sets of cylindrical rattle drums +212.22 Barrel-shaped rattle drums +212.221 Individual barrel-shaped rattle drums +212.222 Sets of barrel-shaped rattle drums +212.23 Double-conical rattle drums +212.231 Individual double-conical rattle drums +212.232 Sets of double-conical rattle drums +212.24 Hourglass-shaped rattle drums +212.241 Individual hourglass-shaped rattle drums +212.242 Sets of hourglass-shaped rattle drums +212.3 Frame rattle drums +212.31 Single-skin frame rattle drums +212.32 Double-skin frame rattle drums +212.321 Individual double-skin frame rattle drums +212.322 Sets of double-skin frame rattle drums +23 Friction drums The membrane is made to vibrate by friction +231 Friction drums with stick A stick in contact with the membrane is either itself rubbed, or is employed to rub the membrane +231.1 With inserted stick The stick passes through a hole in the membrane +231.11 Friction drums with fixed stick The stick cannot be moved; the stick alone is subjected to friction by rubbing Africa +231.12 Friction drums with semi-fixed stick The stick is movable to a sufficient extent to rub the membrane when it is itself rubbed by the hand Africa +231.13 Friction drums with free stick The stick can be moved freely; it is not itself rubbed, but is employed to rub the membrane Venezuela +231.2 With tied stick The stick is tied to the membrane in an upright position Europe +232 Friction drum with cord A cord, attached to the membrane, is rubbed +232.1 Stationary friction drums with friction cord the drum is held stationary Europe, Africa +232.11 Single-skin stationary drums with friction-cord +232.12 Double-skin stationary drums with friction-cord +232.2 Friction drum with whirling stick The drum is whirled on a cord which rubs on a [resined] notch in the holding stick Waldteufel [cardboard buzzer] (Europe, India, E. Africa) +233 Hand friction drums The membrane is rubbed by the hand NB This does not include the orchestral tambourine which remains a frame drum +24 Singing membranes (Kazoos) The membrane is made to vibrate by speaking or singing into it; the membrane does not yield a note of its own but merely modifies the voice Europe, W. Africa +241 Free kazoos The membrane is incited directly, without the wind first passing through a chamber Comb-and-paper +242 Tube- or vessel-kazoos The membrane is placed on top of a tube or box Africa; while also E. Asian flutes with a lateral hole sealed by a membrane, exhibit an affinity with the principle of the tube kazoo +3 CHORDOPHONES One or more strings are stretched between fixed points +-2 Sounded by scraping +-21 Scraping the string devil’s fiddle +-22 Scraping the string bearer some musical bows +-3 Sounded by blowing !gora, aeolian harps +-4 Sounded by hammers or beaters +-5 Sounded with the bare fingers +-6 Sounded by plectrum +-7 Sounded by bowing +-71 With a bow +-72 By a wheel +-73 By a ribbon [Band] +31 Simple chordophones or zithers The instrument consists solely of a string bearer, or of a string bearer with a resonator which is not integral and can be detached without destroying the sound-producing apparatus +311 Bar zithers The string bearer is bar-shaped; it may be a board placed edgewise +311.1 Musical bows The string bearer is flexible (and curved) +311.11 ldiochord musical bows The string is cut from the bark of the cane, remaining attached at each end +311.111 Mono-idiochord musical bows The bow has one idiochord string only New Guinea (Sepik R.), Togo +311.112 Poly-idiochord musical bows or harp-bows The bow has several idiochord strings which pass over a toothed stick or bridge W. Africa (Fan) +311.12 Heterochord musical bows The string is of separate material from the bearer +311.121 Mono-heterochord musical bows The bow has one heterochord string only +311.121.1 Without resonator NB If a separate, unattached resonator is used, the specimen belongs to 311.121.21. The human mouth is not to be taken into account as a resonator +311.121.11 Without tuning noose Africa (ganza, samuius, to) +311.121.12 With tuning noose A fibre noose is passed round the string, dividing it into two sections South-equatorial Africa (n’kungo, uta) +311.121.2 With resonator +311.121.21 With independent resonator Borneo (busoi) +311.121.22 With resonator attached +311.121.221 Without tuning noose S. Africa (hade, thomo) +311.121.222 With tuning noose S. Africa, Madagascar (gubo, hungo, bobre) +311.122 Poly-heterochord musical bows The bow has several heterochord strings +311.122.1 Without tuning noose Oceania (kalove) +311.122.2 With tuning noose Oceania (pagolo) +311.2 Stick zithers The string carrier is rigid +311.21 Musical bow cum stick The string bearer has one flexible, curved end. NB Stick zithers with both ends flexible and curved, like the Basuto bow, are counted as musical bows India +311.22 (True) stick zithers NB Round sticks which happen to be hollow by chance do not belong on this account to the tube zithers, but are round-bar zithers; however, instruments in which a tubular cavity is employed as a true resonator, like the modern Mexican harpa, are tube zithers +311.221 With one resonator gourd India (tuila), Celebes (suleppe) +311.222 With several resonator gourds India (vina) +312 Tube zithers The string bearer is a vaulted surface +312.1 Whole-tube zithers The string carrier is a complete tube +312.11 ldiochord (true) tube zithers Africa and Indonesia (gonra, togo, valiha) +312.12 Heterochord (true) tube zithers +312.121 Without extra resonator S.E.Asia (alligator) +312.122 With extra resonator An internode length of bamboo is placed inside a palm leaf tied in the shape of a bowl Timor +312.2 Half-tube zithers The strings are stretched along the convex surface of a gutter East Asia +312.21 ldiochord half-tube zithers Flores +312.22 Heterochord half-tube zithers E. Asia +313 Raft zithers The string bearer is composed of canes tied together in the manner of a raft +313.1 ldiochord raft zithers India, Upper Guinea, Central Congo +313.2 Heterochord raft zithers N. Malawi region +314 Board zithers The string bearer is a board; the ground too, is to be counted as such +314.1 True board zithers The plane of the strings is parallel with that of the string bearer +314.11 Without resonator Borneo +314.12 With resonator +314.121 With resonator bowl The resonator is a fruit shell or similar object, or an artificially carved equivalent Malawi region +314.122 With resonator box (box zither) The resonator is made from slats NB This is true of the early piano only; modern pianos have no bottom and are board zithers. Harpsichords and some clavichords are box zithers Qin, koto, zither, Hackbrett, pianoforte +314.2 Board zither variations The plane of the strings is at right angles to the string bearer +314.21 Ground zithers The ground is the string bearer; there is only one string Malacca now West Malaysia, Madagascar +314.22 Harp zithers A board serves as string bearer; there are several strings and a notched bridge Borneo, Africa: Bokongo, harp zither from the Bambinga people of the Uele district, Congo-Kinshasa +315 Trough zithers The strings are stretched across the mouth of a trough Tanzania +315.1 Without resonator +315.2 With resonator The trough has a gourd or a similar object attached to it +316 Frame zithers The strings are stretched across an open frame +316.1 Without resonator Perhaps amongst medieval psalteries +316.2 With resonator W. Africa, amongst the Kru (kani) +32 Composite chordophones A string bearer and a resonator are organically united and cannot be separated without destroying the instrument +321 Lutes The plane of the strings runs parallel with the sound-table +321.1 Bow lutes [pluriarc] Each string has its own flexible carrier Africa (akam, kalangu, wambi) +321.2 Yoke lutes or lyres The strings are attached to a yoke which lies in the same plane as the sound-table and consists of two arms and a cross-bar +321.21 Bowl lyres A natural or carved-out bowl serves as the resonator Lyra, E. African lyre +321.22 Box lyres A built-up wooden box serves as the resonator Kithara, crwth +321.3 Handle lutes The string bearer is a plain handle. Subsidiary necks, as e.g. in the Indian prasarini vina are disregarded, as are also lutes with strings distributed over several necks, like the harpolyre, and those like the Lyre- guitars, in which the yoke is merely ornamental +321.31 Spike lutes The handle passes diametrically through or over19 the resonator +321.311 Spike bowl lutes The resonator consists of a natural or carved-out bowl Iran, India, Indonesia +321.312 Spike box lutes or spike guitars The resonator is built up from wood, the body of the instrument is in the form of a box Banjo, Egypt (rebab) +321.313 Spike tube lutes The handle passes diametrically through the walls of a tube China, Indochina +321.32 Necked lutes The handle is attached to or carved from the resonator, like a neck +321.321 Necked bowl lutes Mandolin, theorbo, balalaika +321.322 Necked box lutes or necked guitars NB Lutes whose body is built up in the shape of a bowl are classified as bowl lutes Violin, viol guitar +321.33 Half-spike lutes or tanged20 lutes the handle is neither attached to the resonator nor passes all the way through it but terminates within the body W.Africa +321.331 Half-spike or tanged bowl lutes +321.332 Half-spike or tanged box lutes +322 Harps The plane of the strings lies at right angles to the sound-table; a line joining the lower ends of the strings would point towards the neck +322.1 Open harps The harp has no pillar +322.11 Arched harps The neck curves away from the resonator Burma [Myanmar] and Africa +322.111 Arched harps - Wachsmann type 1 the neck rests on the bottom of the resonator ‘like a spoon in a cup’21 Uganda +322.112 Arched harps - Wachsmann type 2 the tanged neck fits tightly into a hole at the narrow end of the resonator ‘like a cork in a bottle’22 Democratic Republic of Congo, Zande, Nzakara, Banda, Mangebetu +322.113 Arched harps - Wachsmann type 3 a carved finial extends from the resonator, usually in the form of a human head; it is often tied to the neck. +322.12 Angular harps The neck makes a sharp angle with the resonator Assyria, Ancient Egypt, Ancient Korea, Mauretania (ardin) +322.2 Frame harps The harp has a pillar +322.21 Without tuning action All medieval harps +322.211 Diatonic frame harps +322.212 Chromatic frame harps +322.212.1 With the strings in one plane Most of the older chromatic harps +322.212.2 With the strings in two planes crossing one another The Lyon chromatic harp +322.212.3 With the strings in two or more parallel planes Triple harp +322.22 With tuning action The strings can be shortened by mechanical action +322.221 With manual action The tuning can be altered by hand-levers Hook harp, dital harp, harpinella +322.222 With pedal action The tuning can be altered by pedals +323 Spike harps with tall stringholders The plane of the strings lies at right angles to the soundtable; a tall stringholder or bridge holds the strings at successive levels, their sounding lengths increasing with their distance from the soundtable; the body resembles a spike lute, with a neck bisecting a calabash resonator +323.1 Arched spike harps with tall stringholders the neck curves away from the resonator Guinea (bolon), Gambia (simbango) +323.2 Spike harps with pressure bridges (bridge harps or harp-lutes) a line joining the lower ends of the strings would be perpendicular to the straight neck, notched bridge Gambia (kora) +324 Tanged harps with tall stringholders a carved extension of the resonator forms the socket for the shaft of the neck24 +33 Variable tension chordophones or ‘plucked drums’ +331 With loose string attached to the drum-head India (anandalahari) +332 With string attached to the end of a neck and to the drum-head India (gopi yantra) +4 AEROPHONES The air itself is the vibrator in the primary sense. In this group also belong reed instruments sounded by a flow of air in which the reed is the primary vibrator +# Suffixes for use with any division of this class (aerophones): +-4 With lengths of tube (crooks etc.) to set nominal pitches preparatory to playing +-5 With wind-cap +-6 With air reservoir +-61 With rigid air reservoir +-62 With flexible air reservoir +-7 With fingerhole stopping; We can cover ‘Natural labrosones’ that have a fingerhole, such Fijian conches and African sideblown horns, by using the suffix -7 +-71 With keys +-72 With Bandmechanik [presumably a perforated roll or ribbon] +41 Free aerophones The vibrating air is not confined by the instrument +411 Displacement free aerophones The air-stream meets a sharp edge, or a sharp edge is moved through the air. In either case, according to more recent views, a periodic displacement of air occurs to alternate flanks of the edge Whip, sword-blade +412 Interruptive free aerophones The air-stream is interrupted periodically +412.1 Idiophonic interruptive aerophones or reeds The air-stream is directed against a lamella, setting it in periodic vibration to interrupt the stream intermittently. In this group also belong reeds with a ‘cover’, i.e. a tube in which the air vibrates only in a secondary sense, not producing the sound but simply adding roundness and timbre to the sound made by the reed’s vibration; generally recognizable by the absence of fingerholes Organ reed stops +412.11 Paired reeds Two lamellae make a gap which closes periodically during their vibration A split grass-blade +412.12 Beating reeds A single lamella periodically opens and closes an aperture +412.121 Individual beating reeds Brit. Columbia. Also single-note motor horn +412.122 Sets of beating reeds The earlier reed stops of organs +412.13 Free reeds The lamella vibrates through a closely-fitting slot +412.131 (Individual) free reeds +412.132 Sets of free reeds NB In instruments like the Chinese sheng the fingerholes do not serve to modify the pitch and are therefore not equivalent to the fingerholes of other pipes Reed organ, mouthorgan, accordion +412.14 Ribbon reeds The air-stream is directed against the edge of a stretched band or ribbon. The acoustics of this process has not yet been studied Brit. Columbia +412.15 Retreating reeds Elements naturally or artificially sprung together that separate periodically when blown Morocco, British Columbia25 +412.2 Non-idiophonic interruptive instruments The interruptive agent is not a reed +412.21 Rotating aerophones The interruptive agent rotates in its own plane Sirens, whirring disc +412.22 Whirling aerophones The interruptive agent turns on its axis Bullroarer, ventilating fan The whirring disc rotates in its own plane and does not turn on its axis +413 Plosive aerophones The air is made to vibrate by a single density stimulus condensation shock +413.1 Explosive aerophones The air is forced out Pop guns +413.2 Implosive aerophones The air is forced in W.Africa, shantu +42 Wind instruments proper The vibrating air is confined within the instrument itself +420 Edge-tone instruments that are not flutes Widgeon whistles +421 Edge instruments or flutes A narrow stream of air is directed against an edge to excite a column of air in a tube or a body of air in a cavity +421.1 Flutes without duct The player himself creates a ribbon-shaped stream of air with his lips +421.11 End-blown flutes The player blows against the sharp rim at the upper open end of a tube +421.111 (Single) end-blown flutes +421.111.1 Open single end-blown flutes The lower end of the flute is open +421.111.11 Without fingerholes Bengal +421.111.12 With fingerholes Almost world-wide +421.111.2 Stopped single end-blown flutes The lower end of the flute is closed +421.111.21 Without fingerholes The bore of a key +421.111.211 Used in sets Lithuania, S.Africa Venda and others +421.111.22 With fingerholes Especially New Guinea +421.111.3 Partly-stopped single end-blown flutes +421.111.31 Partly-stopped single end-blown flutes without fingerholes +421.111.32 Partly-stopped single end-blown flutes with fingerholes +421.112 Sets of end-blown flutes or panpipes Several end-blown flutes of different pitch are combined to form a single instrument +421.112.1 Open panpipes +421.112.11 Open (raft) panpipes The pipes are tied together in the form of a board, or they are made by drilling tubes in a board China +421.112.12 Open bundle (pan-) pipes The pipes are tied together in a round bundle Solomon Is., New Britain, New Ireland, Admiralty Is. NB This is misprinted as 421.112.2 in GSJ +421.112.2 Stopped panpipes Europe, S. America +421.112.3 Mixed open and stopped panpipes Solomon Is., S. America +421.12 Side-blown flutes The player blows against the sharp rim of a hole in the side of the tube +421.121 (Single) side-blown flutes +421.121.1 Open side-blown flutes +421.121.11 Without fingerholes S. W. Timor +421.121.12 With fingerholes European flute +421.121.2 Partly-stopped side-blown flutes The lower end of the tube is a natural node of the pipe pierced by a small hole N. W. Borneo +421.121.3 Stopped side-blown flutes +421.121.31 Without fingerholes +421.121.311 With fixed stopped lower end Apparently non-existent +421.121.312 With adjustable stopped lower end (piston flutes) Malacca, New Guinea +421.121.32 With fingerholes E. Bengal, Malacca +421.122 Sets of side-blown flutes +421.122.1 Sets of open side-blown flutes Chamber flute-orum +421.122.2 Sets of stopped side-blown flutes N. W. Brazil (among the Siusi) +421.13 Vessel flutes (without distinct beak) The body of the pipe is not tubular but vessel-shaped Brazil (Karaja), Lower Congo (Bafiote) +421.14 Notch flutes The player blows into a notch at the top of the tube (treat as 421.11) +421.141 (Single) notch flutes +421.141.1 Open single notch flutes +421.141.11 Open single notch flutes without fingerholes +421.141.12 Open single notch flutes with fingerholes +421.141.2 Stopped single notch flutes +421.141.21 Stopped single notch flutes without fingerholes +421.141.211 Stopped notch flutes without fingerholes used in sets +421.141.22 Stopped single notch flutes with fingerholes +421.142 Sets of notch flutes or panpipes +421.142.1 Open sets of notch-flutes or panpipes +421.142.2 Stopped sets of notch-flutes or panpipes +421.2 Flutes with duct or duct flutes A narrow duct directs the air stream against the sharp edge of a lateral orifice +421.21 Flutes with external duct The duct is outside the wall of the flute; this group includes flutes with the duct chamfered in the wall under a ring-like sleeve and other similar arrangements +421.211 (Single) flutes with external duct +421.211.1 Open flutes with external duct +421.211.11 Without fingerholes China, Borneo +421.211.12 With fingerholes Indonesia +421.211.2 Partly-stopped flutes with external duct Malacca +421.211.3 Stopped flutes with external duct +421.212 Sets of flutes with external duct Tibet (subdivisions as for single flutes with external duct) +421.22 Flutes with internal duct The duct is inside the tube. (Flutes with duct formed by an internal baffle [natural node, block of resin] and an exterior tied-on cover [cane, wood, hide] are classed as 421.23) +421.221 (Single) flutes with internal duct +421.221.1 Open flutes with internal duct +421.221.11 Without fingerholes European signalling whistle +421.221.12 With fingerholes Recorder, flageolet +421.221.2 Partly-stopped flute with internal duct India and Indonesia +421.221.3 Stopped flutes with internal duct +421.221.31 Without fingerholes +421.221.311 With fixed stopped lower end European signalling whistle +421.221.312 With adjustable stopped lower end Piston pipes [swanee whistle] +421.221.32 Stopped flutes with internal duct with fingerholes Morocco +421.221.4 Vessel flutes with duct +421.221.41 Without fingerholes Zoomorphic pottery whistles (Europe, Asia) +421.221.42 With fingerholes +421.221.421 With single fingerhole Dog whistles etc +421.221.422 With two or more fingerholes Ocarina +421.222 Sets of flutes with internal duct +421.222.1 Sets of open flutes with internal duct +421.222.11 Without fingerholes Open flue stops of the organ +421.222.12 With fingerholes Double flageolet +421.222.2 Sets of partly-stopped flutes with internal duct Rohrflöte stops of the organ +421.222.3 Sets of stopped flutes with internal duct Stopped flue stops of the organ +421.222.4 Sets of dissimilar flutes with internal duct Two or more flutes of more than one kind (open, partly stopped or stopped) are combined to form a set. +421.23 Flutes with internal duct formed by an internal baffle (natural, node, block of resin) plus an external duct American Plains, S.E.Asia, Indonesia +422 Reedpipes The column of air is made to vibrate by the intermittent access of an air stream produced by means of a lamella or lamellae +422.1 Reedpipes with double (or quadruple) reeds (oboes) The pipe has a reed (usually a flattened stem) of paired lamellae which periodically open and close, controlling the flow of air26 +422.11 (Single) reedpipes with double (or quadruple) reeds oboes +422.111 With cylindrical bore +422.111.1 Without fingerholes Brit. Columbia +422.111.2 With fingerholes Aulos, crumhorn +422.112 With conical bore European oboe +422.12 Sets of reedpipes with double (or quadruple) reeds oboes +422.121 With cylindrical bore Double aulos +422.122 With conical bore India +422.2 Reedpipes with single reeds (clarinets) The pipe has a [single] ‘reed’ consisting of a lamella which periodically opens and closes an aperture, controlling the flow of air +422.21 Individual reedpipes with single reeds +422.211 With cylindrical bore +422.211.1 Without fingerholes Brit. Columbia +422.211.2 With fingerholes European clarinet +422.212 With conical bore Saxophone +422.22 Sets of reedpipes with single reeds Egypt (zummara) +422.3 Reedpipes with a reed which vibrates through a closely fitted frame. The air column must be the dominant partner in determining the frequency of vibration, as is the case for instruments with fingerholes, otherwise the instrument belongs to the free reeds 412.13 +422.31 Single reedpipes with free reeds +422.32 Double reedpipes with free reeds +422.33 Horns with free reed Burma [Myanmar] +422.4 Dilating reeds Grass and similar stems with one or more longitudinal slits. The ‘reed’ area is wholly enclosed within the mouth +422.41 Dilating reeds without fingerholes27 +422.42 Dilating reeds with fingerholes Sami (fadno) 28 +423 Labrosones (or lip-reed instruments)The air-stream passes through the player’s vibrating lips, so gaining intermittent access to the air column which is to be made to vibrate +423.1 Natural labrosones Without extra devices to alter pitch other than lengths of tube (crooks etc.) to set the nominal pitch preparatory to playing +423.11 Conches A conch shell serves as a labrosone +423.111 End-blown +423.111.1 Without mouthpiece India +423.111.2 With mouthpiece (material has been added to the tube to form a mouthpiece) Japan (rappakai) +423.112 Side-blown Oceania +423.12 Tubular labrosones +423.121 End-blown labrosones +423.121.1 End-blown straight labrosones The tube is neither curved nor folded +423.121.11 Without mouthpiece Some alphorns +423.121.12 With mouthpiece (material has been added to the tube to form a mouthpiece) Almost world-wide +423.121.2 End-blown labrosones with curved or folded tubes +423.121.21 Without mouthpiece Asia +423.121.22 With mouthpiece (material has been added to the tube to form a mouthpiece) Lurs +423.122 Side-blown labrosones The embouchure is in the side of the tube +423.122.1 Side-blown straight labrosones S. America, Africa +423.122.2 Side-blown curved labrosones Africa +423.2 Chromatic labrosones With extra devices to alter the pitch while playing +423.21 Labrosones with fingerholes Cornetti, key bugles +423.211 With cylinder bore Key trumpet +423.212 With [narrow] conical bore Cornetti +423.213 With [wider] conical bore Key bugles, serpents +423.22 Slide trumpets The tube can be lengthened by extending a telescopic section of the instrument whilst it is played. (This category includes slide trombones with one or two thumb valves) European trombone +423.23 Labrosones with valves The tube is lengthened or shortened by connecting or disconnecting auxiliary lengths of tube Europe +423.231 Valve bugles The tube is predominantly conical +423.231.1 With narrow bore +423.231.11 With short air column (less than 2m) NB some Eastern European flugel horns have a wider bore but can be included here with Western European narrow bore instrumens Flugel horn +423.231.12 With long air column (more than 2m) Wagner tuba +423.231.2 With wide bore Euphonium, tuba +423.232 Valve horns The tube is of intermediate bore profile +423.232.1 With narrow bore +423.232.11 With short air column (less than 2m) Cornet, F alto horn, B flat altissimo horn +423.232.12 With long air column (more than 2m) Most French horns +423.232.2 With wider bore Althorn; tenor and baritone saxhorns +423.233 Valve trumpets The tube is predominantly cylindrical +423.233.1 With short air column (less than 2m) Most valve trumpets +423.233.2 With long air column (more than 2m) Most valve trombones +424 Membranopipes The column of air is made to vibrate by the intermittent access of an air stream produced by means of a membrane that periodically opens and closes an aperture +5 ELECTROPHONES Instruments that use materials generating acoustic sounds, mechanically-driven signal sources, electronically stored data or electronic circuitry to produce electrical signals that are passed to a loudspeaker to deliver sound. (Unmodified acoustic instruments with attached microphones or pickups are classed within groups 1-4, according to the primary source of sound.) +51 Electro-acoustic instruments and devices Modules and configurations of acoustic, vibratory mechanisms (often resembling traditional acoustic instruments) and electronic circuitry such as transducers and amplifiers. The acoustic or mechanical vibration is transduced into an analogue fluctuation of an electric current. All instruments built or structurally modified to deliver a signal to an amplifier and loudspeaker are classed as electrophones, even if they have some capability of sounding acoustically +511 Electro-acoustic idiophones Fender-Rhodes, Wurlitzer electric piano, Hohner Electra Piano +512 Electro-acoustic membranophones +513 Electro-acoustic chordophones Electric guitar, Neo-Bechstein electric piano, Yamaha Electric Grand, electric violin +514 Electro-acoustic aerophones +515 Transducers Microphones, pick-ups, loudspeakers +52 Electromechanical instruments and devices Configurations of (electrically excited) silent, mechanical moving parts with encoded patterns, and electronic circuitry. The movement enables the encoded patterns to be transduced into an analogue fluctuation of an electric current +521 Tone wheel instruments Electromagnetic, electrostatic, photoelectric etc.) Hammond tone wheel organ +522 Photoelectric electromechanical instruments +523 Record/playback devices (Electromechanical, electromagnetic etc.), Tape recorder EMI BTR/2 +524 Electromechanical samplers Mellotron, Chamberlin +525 Electromechanical sound processing devices Spring line reverberation unit, tape echo (Watkins/WEM CopiCat tape echo unit) +53 Analogue electronic instruments, modules and components . Continuously varying electrical signals are passed to a loudspeaker to produce sound. The electrical signals are generated using electronic circuitry. Modules and configurations containing analogue fully electronic devices used to produce, process and communicate electronic sound signals and/or sequences of signals +531 Analogue synthesizers and other electronic instruments with thermionic valve (vacuum-tube) or solid state circuitry (transistor and/or analogue integrated circuitry) generating and/or processing electric sound signals +531.1 Analogue synthesizers and other electronic instruments with electronic valve/vacuum tube based devices generating and/or processing electric sound signals Trautonium, Theremin, ondes Martenot, Ondioline, Clavioline +531.2 Analogue synthesizers and other electronic instruments with solid state circuitry (transistor and/or integrated circuitry) generating and processing electric sound signals +531.21 Analogue synthesizers with solid state circuitry based devices generating and processing electric sound signals using additive synthesis +531.22 Analogue synthesizers with solid state circuitry based devices generating and processing electric sound signals using subtractive synthesis +531.221 Modular analogue synthesizers with solid state circuitry based devices generating and processing electric sound signals using subtractive synthesis +531.222 Preset analogue synthesizers with solid state circuitry based devices generating and processing electric sound signals using subtractive synthesis +531.222.1 Preset, monophonic analogue synthesizers with solid state circuitry based devices generating and processing electric sound signals using subtractive synthesis +531.222.2 Preset, partially or fully polyphonic analogue synthesizers with solid state circuitry based devices generating and processing electric sound signals using subtractive synthesis +531.23 Analogue synthesizers using hybrid subtractive and additive synthesis +532 Voltage control sources +532.1 Voltage control sources - control voltage sequence generators (Envelope generator, low frequency oscillator, sequencer, slew generator, peak amplitude follower/envelope follower, sample and hold) Analogue sequencer +532.2 Voltage control sources - controllers and interfaces Human interface devices, keyboards, foot switches, sensors, wheels, touchpad +533 Other analogue modules or configurations +533.1 Analogue modules: audio signal generators; analogue signal combining, modifying, reproducing and processing devices +533.11 Analogue modules: audio signal generators (oscillators producing sine, square and saw tooth waves, beat frequency oscillator and heterodyne systems); Ring modulator +533.12 Analogue modules: signal modifiers or processors analogue signal combining, modifying, reproducing and processing devices (mixers, sum/difference/multiple output generator etc. timbre modifier, filter devices; amplitude modifier, amplifier device, reverb modifier) +533.2 Analogue configurations: mixer consoles (also containing filters, ring modulators etc.), sequencer based configurations, experimental configurations, sound sculptures BBC Mark III Radio Mixing Desk, Funktionsgenerator +533.3 Modules communicating between devices/signal convertors other than transducers +54 Digital instruments, modules and components. Electrical signals are generated in the form of quantized sequences of pulses. These are converted to continuous signals that activate a loudspeaker. Modules and configurations containing devices to digitally design and process electronic sound signals and/or sequences of signals +541 Digital synthesizers +541.1 Digital synthesizers using frequency modulation synthesis +541.11 Digital synthesizers using frequency modulation synthesis without fixed keyboard controllers +541.12 Digital synthesizers using frequency modulation synthesis with fixed keyboard controllers Yamaha DX7 +541.2 Digital Synthesizers using additive synthesis +541.21 Digital Synthesizers using additive synthesis without fixed keyboard controllers +541.22 Digital Synthesizers using additive synthesis with fixed keyboard controllers Kawai K5 +541.3 Digital synthesizers using phase distortion techniques +541.31 Digital synthesizers using phase distortion techniques without fixed keyboard controllers +541.32 Digital synthesizers using phase distortion techniques with fixed keyboard controllers Casio CZ series +541.4 Digital synthesizers using physical modelling techniques +541.41 Digital synthesizers using physical modelling techniques without fixed keyboard controllers +541.42 Digital synthesizers using physical modelling techniques with fixed keyboard controllers Yamaha VL70 +542 Digital control sources and interfaces Human interface devices, keyboards, joy-sticks/wheels, touchpad/touch screen, foot switches, sensors, detectors of environmental change.29 Digital sequencer, MIDI controller +543 Digital signal mixing, modifying, reproducing and processing devices Timbre modifier, filter device, amplitude modifier, amplifier device, reverb modifier Mixer, PA, digital delay, Effects box +544 Digital samplers and sampling synthesizers Korg DSS-1 +545 Digital record/playback devices +546 Other digital modules, components or configurations +547 Digital modules communicating between devices/signal convertors +55 Hybrid analogue/digital configurations Devices with analogue oscillators and digital filters etc. +56 Software \ No newline at end of file diff --git a/Shapes b/Shapes new file mode 100644 index 0000000..6fd8e14 --- /dev/null +++ b/Shapes @@ -0,0 +1 @@ +Shapes \ No newline at end of file diff --git a/generate_instrument.py b/generate_instrument.py new file mode 100644 index 0000000..093be87 --- /dev/null +++ b/generate_instrument.py @@ -0,0 +1,51 @@ +#!python3 +import random + +"""generates a musical instrument by choosing at random a hornbostel-sachs category. + +this version is uniformly distributed between the options at each level, but does not include suffxes.""" + + +strip_dashes_and_dots = lambda x: x.replace("-", "").replace(".", "").replace(" ", "") +def generate_instrument(listing): + """ listing contains a hornbostel-sachs dictionary; this steps through index-by-index + picking numbers at random one by one until it's gotta stop, so this has even chances + of every category, rather than an even chance to every listing.""" + + nice_from_stripped = {strip_dashes_and_dots(x): x for x in listing.keys()} + stripped_keys = [strip_dashes_and_dots(x) for x in listing.keys()] + + prefix = random.choice([x for x in stripped_keys if len(x) == 1]) + + final_code = pick_code(prefix, [x for x in stripped_keys if x.startswith(prefix)]) + return nice_from_stripped[final_code] + +# this defines a threshhold for quitting early dependent on the length of the code so far. +# so there's a 0% chance of stopping with a zero-length code, 0% with a 1-length code, 1% with 2-length... +chance_of_stopping = [0, 0, 0.01, 0.01, 0.01, 0.05, 0.05, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2] +def pick_code(prefix, keys): + if random.random() < chance_of_stopping[len(prefix)]: + return prefix + + # only look at keys that are one longer than the current key + next_keys = [x for x in keys if len(x) == len(prefix) + 1] + if len(next_keys) == 0: + return prefix # if we can't find any successors then stop + + next_prefix = random.choice(next_keys) + + return pick_code(next_prefix, [x for x in keys if x.startswith(next_prefix)]) + + + + +if __name__ == "__main__": + with open("Hornbostel-Sachs") as f: + hornbostelsachs = {line.split(" ")[0]: " ".join(line.split(" ")[1:]) for line in f.readlines()} + + val = generate_instrument(hornbostelsachs) + + parents = [val[0:x+1] for x in range(len(val)) if val[x].isdigit()] + + for x in parents: + print(x, " : ", hornbostelsachs[x].strip()) diff --git a/generate_instrument_2.py b/generate_instrument_2.py new file mode 100644 index 0000000..c6e7b20 --- /dev/null +++ b/generate_instrument_2.py @@ -0,0 +1,189 @@ +#!python3 +"""this one should be a little more ordered and also work with suffixes.""" +import random + +def dots(something): + t = something[:] + for i in range(3, int(len(something)*4/3)-1, 4): + t = t[:i] + "." + t[i:] + return t + +class HSNode: + def __init__(self, parent, code, description): + self.parent = parent + self.code = code + self.description = description + self.nexts = dict() + self.suffixes = None + + def printout(self): + code_with_dots = dots(self.code) + print(f"{code_with_dots}: {self.description}") + + if self.suffixes is not None: + self.suffixes.printout() + + for n in sorted(self.nexts.keys()): + self.nexts[n].printout() + + def add_code(self, code, description): + if len(code) == 0: + raise Exception(f"some kinda problem trying to add a blank code to a listing for {self.code}") + + digit = code[0] + + if len(code) == 1: + if digit not in self.nexts: + self.nexts[digit] = HSNode(self, self.code + digit, description) + else: + self.printout() + raise Exception(f"Collision found! {self.code}, adding {code}") + return self.nexts[digit] + else: + if digit not in self.nexts: + self.nexts[digit] = HSNode(self, self.code + digit, "HUH???") + return self.nexts[digit].add_code(code[1:], description) + + def add_suffix(self, code, description): + if self.suffixes is None: + self.suffixes = HSNode(None, "-", f"suffixes for {self.code}") + + return self.suffixes.add_code(code, description) + + def random_child(self, stopping_chances): + this_threshhold, rest_chances = stopping_chances[0], stopping_chances[1:] + if random.random() < this_threshhold: + return self + + if not self.nexts: + return self + + digit, next_node = random.choice(list(self.nexts.items())) + + return next_node.random_child(rest_chances) + + +# actually build the data from the data file +taxonomy = HSNode(None, "", "an instrument") + +with open("Hornbostel-Sachs") as f: + current = taxonomy + + for line in f.readlines(): + code = line.split(" ")[0].replace(".", "") + description = " ".join(line.split(" ")[1:]).strip() + + if code.startswith("#"): + pass + elif code.startswith("-"): + current.add_suffix(code.replace("-", ""), description) + else: + current = taxonomy.add_code(code, description) + +def generate_instrument(): + # this defines a threshhold for quitting early dependent on the length of the code so far. + # so there's a 0% chance of stopping with a zero-length code, 0% with a 1-length code, 1% with 2-length... + chance_of_stopping = [0, 0, 0.01, 0.01, 0.01, 0.05, 0.05, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2] + + base_code = taxonomy.random_child(chance_of_stopping) + + candidate_suffix_trees = set() + current = base_code + + while current is not None: + if current.suffixes: + candidate_suffix_trees.add(current.suffixes) + current = current.parent + + additionals = [] + # a 15% chance of adding a second code?? + while random.random() < 0.15: + length = len(base_code.code) # possible points to bifurcate at + bifurcation_point = max(random.randrange(length), random.randrange(length)) # weighted towards the end + steps_back = length - bifurcation_point + new_base = base_code + for x in range(steps_back): + new_base = base_code.parent + + new_code = new_base.random_child([0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1]) + additionals.append(new_code) + + current = new_code + while current is not None: + if current.suffixes: + candidate_suffix_trees.add(current.suffixes) + current = current.parent + + suffixes = [] + chance_of_suffix = 0.5 + for s in candidate_suffix_trees: + if random.random() > 0.5: + continue + + suffixes.append(s.random_child([0, 0.25, 0.5, 0.5, 0.5, 0.5, 0.5])) + + return (base_code, additionals, suffixes) + +def explain(hs): + """returns a list of lines explaining the meaning of each digit in the code passed in""" + # output the base code + ancestry = [] + c = hs + while c is not None: + ancestry.append(c) + c = c.parent + + output = [] + for c in reversed(ancestry): + output.append(f"{dots(c.code)}: {c.description}") + + return output + +def print_random_instrument(): + multi = False + base_code, additionals, suffixes = generate_instrument() + + # print out the whole code + base_string = dots(base_code.code) + adds_string = "+".join(map(lambda x: dots(x.code), additionals)) + if adds_string: + adds_string = "+" + adds_string + suffixes_string = "".join(map(lambda x: x.code, suffixes)) + print(f"Generated instrument: {base_string}{adds_string}{suffixes_string}") + print() + + output = [] + # output the base code + output.extend(explain(base_code)) + + # output additional codes: + for code in additionals: + output.append("but also:") + for line in explain(code): + if line not in output: + output.append(line) + + # output suffixes: + for code in suffixes: + output.extend(explain(code)) + + for x in output: + print(x) + + print() + shapes = "round,rectangular,blobby,like an animal,triangular,long,short,oblong,squat,curved,straight,arched,bell-like,tubular".split(',') + shape = random.choice(shapes) + print(f"Its shape is {shape}.") + if random.random() < 0.6: + style = random.choice("sharp,soft,stationary,hand-held,bent,simple,decorated,sitting,standing".split(',')) + print(f"It is a {style} instrument.") + material = random.choice("bone,wood,metal,ceramic,leather,gourds,glass,fiber".split(',')) + print(f"It is made of {material}.") + +if __name__ == "__main__": + + #taxonomy.printout() # print out the whole taxonomy + #print("\n\n\n") + + print_random_instrument() + diff --git a/generate_instrument_3.py b/generate_instrument_3.py new file mode 100644 index 0000000..80b7378 --- /dev/null +++ b/generate_instrument_3.py @@ -0,0 +1,12 @@ +#!python3 + +shapes = "round,rectangular,blobby,like an animal,triangular,long,short,oblong,squat,curved,straight,arched,bell-like,tubular".split(',') +shape = random.choice(shapes) +print(f"Its shape is {shape}.") + +if random.random() < 0.6: + style = random.choice("sharp,soft,stationary,hand-held,bent,simple,decorated,sitting,standing".split(',')) + print(f"It is a {style} instrument.") + +material = random.choice("bone,wood,metal,ceramic,leather,gourds,glass,fiber".split(',')) +print(f"It is made of {material}.") \ No newline at end of file diff --git a/instrument-generator-notes/.gitignore b/instrument-generator-notes/.gitignore new file mode 100644 index 0000000..af53416 --- /dev/null +++ b/instrument-generator-notes/.gitignore @@ -0,0 +1,5 @@ +# to exclude Obsidian's settings (including plugin and hotkey configurations) +.obsidian/ +.trash/ +.DS_Store + diff --git a/instrument-generator-notes/generator 3.md b/instrument-generator-notes/generator 3.md new file mode 100644 index 0000000..4ac2dd8 --- /dev/null +++ b/instrument-generator-notes/generator 3.md @@ -0,0 +1,85 @@ +- [ ] type + - [ ] idiophone + - [ ] membranophone + - [ ] chordophone + - [ ] aerophone + - [ ] electrophone + - [ ] aquaphone? +- [ ] list of parts + - [ ] resonator + - [ ] neck (parallel and under strings) + - [ ] yoke (holds ends of strings) + - [ ] rack (holds many long things?) + - [ ] bellows + - [ ] pipe/bore + - [ ] reed + - [ ] mouthpiece + - [ ] hose + - [ ] membrane + - [ ] frame + - [ ] desk + - [ ] chair + - [ ] fipple + - [ ] bridge + - [ ] tuning pegs + - [ ] tuning machines + - [ ] air reservoir +- [ ] structural parts + - [ ] neck + - [ ] shaft + - [ ] body + - [ ] rack + - [ ] joint +- [ ] relationships between parts + - [ ] through + - [ ] atop + - [ ] to + - [ ] +- [ ] ways two things can be attached together (the resonator is _ to the neck) + - [ ] tied + - [ ] glued + - [ ] integral + - [ ] clamped + - [ ] nailed + - [ ] welded +- [ ] shapes + - [ ] round + - [ ] like an animal (list of animals?) + - [ ] sharp + - [ ] rectangular + - [ ] circular + - [ ] oblong + - [ ] bowl +- [ ] sounds +- [ ] input types + - [ ] valves + - [ ] slide + - [ ] keyboard + - [ ] button keyboard + - [ ] janko keyboard + - [ ] fingering w/ frets (strings only) + - [ ] fingering fretless neck (strings only) + - [ ] levers + - [ ] mallet + - [ ] bowed + - [ ] crank + - [ ] plucked + - [ ] plectrum + - [ ] pedal +- [ ] adjectives + - [ ] movable + - [ ] large + - [ ] small + - [ ] decorated + - [ ] curved + - [ ] rigid + - [ ] flexible +- [ ] materials + - [ ] wood + - [ ] bone + - [ ] metal + - [ ] textile + - [ ] leather + - [ ] gourds + - [ ] glass + - [ ] stone \ No newline at end of file diff --git a/instrument-generator-notes/hornbostel-sachs links.md b/instrument-generator-notes/hornbostel-sachs links.md new file mode 100644 index 0000000..4d32023 --- /dev/null +++ b/instrument-generator-notes/hornbostel-sachs links.md @@ -0,0 +1,7 @@ +H-S latest revision: https://cimcim.mini.icom.museum/wp-content/uploads/sites/7/2019/01/H-S_20classification_20final_20version_20_282013_29_20without_20editorial_20markings-2.pdf + +original 61 translation https://web.archive.org/web/20230724131509/https://bbs.acusteme.org/wordpress/2023/07/17/the-hornbostel-sachs-classification-revised-by-guizzi/ + +"Hornbostel-Sachs Classification of Musical Instruments" by Deborah Lee https://article.imrpress.com/journal/KO/47/1/10.5771/0943-7444-2020-1-72/967741ec19da9927758fa1929e55133a.pdf + +more about hornbostel-sachs https://www.isko.org/cyclo/hornbostel \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..35c8f48 --- /dev/null +++ b/readme.md @@ -0,0 +1,44 @@ +# Origins + +I had an idea: Dwarf Fortress generates musical instruments as part of its worldbuilding. I like imagining those. What if I challenged myself to draw them? + +So I set out doing so! And rapidly discovered that there are only pretty limited variations in the Dwarf Fortress generator. I mean, no shade to it! It works wonderfully. But it didn't provide the variety I was looking for. + +So I decided to build a musical instrument generator of my own! + +# Hornbostel-Sachs + +On various wikipedia trawls I have come across the [Hornbostel-Sachs classification system](https://en.wikipedia.org/wiki/Hornbostel%E2%80%93Sachs). I knew it classified musical instruments, so I figured it might be a good place to start. And indeed, it does! It is similar to and inspired by the [Dewey decimal system](https://en.wikipedia.org/wiki/Dewey_Decimal_Classification). Here's the basics: + +* An instrument is catalogued as a string of digits. Starting from the left, you choose digits to describe the instrument. +* Each digit narrows down the category of instruments described. +* A `.` separates groups of three digits for readability. +* It categorizes instruments according to the mechanism by which they make sound; thus the first digit determines whether it's an idiophone (the material of the thing itself vibrates), membranophone (stretched drum head membrane), chordophone (strings), or aerophone (column or body of air). + +It was designed for cataloguing instruments in collections; everyone loves it and it's doing a great job. + +I figured, it'll be easy to generate a random Hornbostel-Sachs code, and then I can draw it, and then I've accomplished my goal! I have a generator with a wide variety of instruments (given that the Hornbostel-Sachs system is supposed to classify all known instruments). So I set about building it. + +# Generator 1 + +The first thing I did was download the latest widely-accepted version of Hornbostel-Sachs, available from Musical Instruments Museum Online [as a pdf](https://cimcim.mini.icom.museum/wp-content/uploads/sites/7/2019/01/H-S_20classification_20final_20version_20_282013_29_20without_20editorial_20markings-2.pdf) showing the meaning of all the codes. I basically copy-pasted the actual data section, did a little bit of REPL wrangling to get it into a vaguely usable line-by-line format, and saved it as the file `Hornbostel-Sachs` in this repository. You're fine by me to use that, by the way. + +I wanted something a little more fancy than just grabbing a random code from the list, so I wrote some python (`generate_instrument.py`) to select a random starting digit, then a random next digit, and so on, so the output is evenly distributed across each level of categories, rather than evenly distributed across all the codes together. Thus, even though there are ~150 aerophone categories and less than 100 chordophones, it is as likely to generate an aerophone as a chordophone. It then prints out the meaning of all the digits in order, thus providing a full description of an instrument. Hooray! + +# Generator 2 + +Then I got bored and built a second one. This is not the best python I've ever written and I've always found tree-type structures very difficult to write on the seat of your pants, but I resolutely refused to plan this out. However! This builds a whole data structure representing the tree of categories Hornbostel-Sachs describes. Thus this is able to do the same evenly-spread generation as in generator 1, but it's *also* capable of effectively using suffixes. + +Suffixes are supplemental information that cuts across many categories; for example, "played with a keyboard" is a suffix, because essentially any mechanism can be played with some kind of keyboard. Each suffix is "scoped", in that some suffixes apply to all chordophones, some to all aerophones, etc.. For example, any aerophone may have the suffix `-7` to indicate that it has fingerholes which can be covered. `-71` indicates that the holes are covered by keys, and `-72` means it has some kind of mechanism like a perforated roll or sheet (think a [crank-powered organ](https://en.wikipedia.org/wiki/Street_organ)). + +I've been toying with the idea of making modifications to the system (the original authors envisioned the system being updated and extended over the years!) to account for some things I consider mistakes - for example, the suffixes for membranophones include `-8` and `-9` as membranophone-specific categories, whereas all other categories allow for `-8` meaning "with keyboard" and `-9` meaning "with mechanism". This means you couldn't have a set of drums actuated by a keyboard - I've never heard of such a thing, but there's certainly no reason it can't be. I think we should get to generate - I mean classify - such things! + +Anyway, generator 2 (`generate_instrument_2.py`) is another script that reads in the file, builds a tree, and then walks that tree to generate instruments. I threw in a couple extra bits of information like a shape hint, a material hint, and sometimes a descriptor, to spice it up. The big differences between generators 2 and 1 are that it can generate compound instruments (for when an instrument has multiple differently-coded parts) and it can make use of suffixes. + +# Generator 3 + +I'm working on generator 3 now. I had a lot of fun exploring Hornbostel-Sachs, but I'm not convinced I actually need it for what I'm envisioning. So I'm going to try making a generator in the "traditional" style - essentially, a template string with a bunch of stand-ins for elements or phrases randomly selected from a list. Like mad-libs! I'm heavily inspired by [Nora Reed's generators](https://nora.zone/) in this. We'll see how it goes! The plan is to build it around a set of components that can be randomly selected to go together. I'm embracing the possibility that they clash; I want to generate weird instruments so I'm forced to imagine and draw them! + +# Oh Yeah, Drawing Them + +Oh right, that was the original point. No matter, I had fun, which is the real point of all this. But I do want to try to do drawings! I'm posting them on the [fediverse](https://beach.city/tags/musicalMenagerie) and [bluesky](https://bsky.app/hashtag/musicalMenagerie) under the tag `#musicalMenagerie` which is maybe the fancy name for this project... Although there seem to be a couple other people using that name on the internet. If they come calling I'll change this to something else. It's fun and challenging! \ No newline at end of file