Kangtaum - Scriptophonic microtonal metal generator
Kangtaum.zip
_
_
Kangtaum is an attempt at a real-time implementation of the text-to-(Black Metal)music algorithm proposed by Dave Tremblay.
The algorithm was intended for use with Tolkien’s writing; this version will produce a microtonal scriptophonic ‘metal’ composition from any text file that is input. The default is the poem She Bomber by Eliza Gregory, the text currently being converted is output to the Pd window.
_
_
_
Here's how it works:
·The octave is divided in 26 equal steps (26 microtones, one for each letter).
·The ordering of the letters, from low to high, is:
E-O-V-I-Q-C-F-A-J-Z-P-H-B-Y-S-R-K-D-T-L-X-M-N-G-W-U based on their frequency of use in the sample text (Tolkein).
·One letter represents a duration of 1/8th note.
·One comma, parenthesis or semicolon is a ‘tie’ to the last note played (1/8th duration normally) is continued for a ¼.
·A full stop, colon, exclamation or question mark is a pause of 1/8th measure.
·There are three transcription tracks:
- The melody: It is each letter and punctuation in the text played one after the other.
- The chords: A chord lasts as long as a word in the melody (for example, a three-letter word will last 3 eights notes, and a nine-letter word will last 9 eights). It's comprised of all the different notes/letters of the word played at once.
- The bass: The bass track or chord root consists of the first letter of each word played for the duration of the word. For example, the words THAN and NATH have the same notes and length, but the root and melody of the chords will be different).
·Reverberation for the composition is inversely proportional to the size of the current text chunk or sentence being converted into music. The bigger the chunk, the smaller the virtual space.
·The stereo position of the melody is controlled by the length of the word currently being sonified.
·A counterpoint line is generated from a reordering of the current word/chord’s notes from low to high, which is arpeggiated. The balance between melody and counterpoint is controlled by word length. The longer the word the more melody is present.
This isn't a finished patch, i've kind of reached a dead end with it so thought I'd open it up and see if any one else would like to chip in. I'm really interested in developing the synthesis side of things and making it sound more METAL I suppose.
If nothing else, hopefully some of the list processing is useful to someone working to convert text to music. Many thanks to those on the forum that helped me work some of it out or provide solutions.
This is a video of a slightly earlier version:
Here is an example of Dave's music produced with the original algorithm.
markovGenerator: A music generator based on Markov chains with variable length
Edit: There is a general [markov] abstraction now at https://forum.pdpatchrepo.info/topic/12147/midi-into-seq-and-markov-chains/45
This is one of the early projects by @Jona and me. Happy to finally release it. 
markovGenerator
Generates music from learned material using Markov chains. It is polyphonic, plays endlessly and supports Markov chains with variable length.
markovGenerator.zip (updated)
Usage:
- Record midi notes or load midi files
- Make Markov system
- Play

-
Record midi notes or load midi files
Until you reset the memory, each new recording will be added to the memory. The recorded material is seen as a loop, so that the last note is followed by the the first note, for endless play. markovGenerator handles recording midi and loading midi files differently: When you record midi, it will record notes according to the midi clock every sixth midi tick. This is defined in the counter in [pd midiclock]. So that way, breaks are being recorded and the rhythm is preserved. When loading midi files, no breaks are being recorded, the notes are just recorded in order, so the rhythm will be lost. In any case, simultaneous notes will be recorded as chords, so polyphony is preserved. -
Make Markov system
Set markovOrder to specify the length of the Markov chain. The higher the order, the more musical information will be kept, the lower the order, the more random it gets. You can use soundFilter and channelFilter to only use notes of the specified sound or channel. This is especially useful when working with midi files. Note that if there are no notes of the specified sound or channel, the Markov system will be empty and nothing will be played. Set the filters to zero to disable them. If you change the settings for the Markov system, click makeMarkov again for them to take effect. You can make new Markov systems with different settings out of the same recorded material over and over again, even when playing. If you record additional notes, click makeMarkov again to incorporate them into the Markov system. -
Play
While playing, you can change the note length, sound and midi out channel. Set soundOut and channelOut to zero to use the sound and channel information of the original material. Playing starts with the Markov chain of the last recorded notes, so the first note might be played first.
Use the markovAll section on the right to control all Markov channels at once. Here you can also set tempo, swing and midiSync, and you can save the project or load previous projects.
Have fun! 
If it does not play, make sure that
- you recorded some notes,
- you hit the makeMarkov button,
- soundFilter and channelFilter are not set to values where there are no notes. Try setting the filters to zero and hit makeMarkov again.
About the Markov system:
You can see the Markov system of each Markov channel in [text define $0markov]. Notes are stored as symbols, where the values are joined by "?". A note might look like 42?69?35?10 (pitch?velocity?sound?channel). Chords are joined by "=". A chord of two notes might look like 40?113?35?10=42?49?35?10. Notes and chords are joined to Markov chains by "-". The velocity values are not included in the chains. Sound and midi channel values are only included, if soundFilter or channelFilter are off, respectively. Markov chains of order three may look like 42?35?10-36?35?10=42?35?10-60?35?2 with filters off and simply like 42-37-40 with both filters active, only using the pitch value.
Requires Pd 0.47.1 with the libraries cyclone, zexy and list-abs.
Noob Trying to Create a MIDI Chorder/Harmonizer
Made a bit of progress. Just in case it helps someone, here’s a few more details.
Adapted the patch to work in harmonic minor mode and streamlined a bit by routing lists of intervals instead of connecting each wire individually.
harmo-chorder.pd
As there are only four types of seventh chords in the major mode, it does make things a bit clearer.
major-chorder.pd
Among my next steps is a generalization of the whole thing to work in different modes, and with different root notes. Not completely sure how to make that work but it should also help me in terms of randomizing chord selection.
Might also tweak voicings to fit a couple of concepts from classical harmony/counterpoint (avoiding parallel fifths, etc.). Eventually, it’d be great to choose a given voicing based on the preceding chord (for instance, the F in a G7 chord could resolve on the E in a C Major 7 chord). Should be doable, but will probably require more learning.
Something which should be relatively easy to tweak is to decrease the velocity of the inner voices, to emphasize the top part.
Another thing which will be quite fun is to produce sounds directly in Pd. Wavetable synth might be especially fitting for a wind controller. In that case, it should be easier to run it on a Raspberry Pi, without requiring an external synth. Would make for a very compact setup.
Been experiencing some issues with some scale notes not producing chords. In fact, Pd doesn’t show that incoming note, but it plays on my external synth. Probably an issue with my current MIDI setup (WX-11 wind controller hooked to a laptop which controls the iWavestation app on an iPad using MIDImux). In some ways, it makes for a bit more variety.
It’s a fun learning experience, so far. Been occasionally thinking about a project like this for some years, actually. But kept being too overwhelmed to take it on. Today’s experience really energized me.
Thanks, @shindeibrauns!!
Noob Trying to Create a MIDI Chorder/Harmonizer
Newbie alert! Been interested in Pd for quite a while, though long after hearing a lot about Max in college (ca. 1990). But my attempts to do anything in it were thwarted by many factors, including the lack of a clear plan. As is often the case, the most appropriate approach to learning a new language is to find a use for it.
Now got what sounds to me like the ideal project: should be simple enough but it teaches me important lessons about Pure data.
Been trying to create a basic chorder/harmonizer taking input from a MIDI keyboard or wind controller and outputting multiple notes to an external synth connected via MIDI as well. Later on, this project might end up with Pd-synthesized sounds, but my first need is for a simple tool which generates different chords based on incoming MIDI notes.
More specifically, the idea is to create something like the “Michael Brecker Effect”, based on something the sax player would do with his Akai EWI and Oberheim Xpander. Brecker would play melodic lines on his (monophonic) EWI and the Xpander would generate random chords under that. There are tools out there which do this but it’s probably best for me to create my own. Been using a tool which does something a bit different (using the incoming MIDI notes as chord roots instead of top notes) and it’s just too much fun. Creating my own chorder/harmonizer would allow me to appropriate the whole thing to my own context.
My sense is that much of this is really trivial, by Pd standards. Even surprised not to readily find multiple examples of just this thing. Maybe my search skills are off. But my understanding of Pure data is so fragmentary that it quickly gets me stuck.
Here’s where things stand at this point. Can easily generate a given chord type (say, a major chord) under any incoming note. Offset the [notein] MIDI note number by a certain amount does create an interval, obviously. And sending multiple numbers to [noteout] actually works. Quite neat. It even deals correctly with note off messages, which was somewhat surprising to me. So far, so good. Can play major chords on any note, which is already a fun effect for a monodic instrument (but something which is already possible for me to easily do).
Where things get really tricky really quickly is in generating different chord types for each incoming note. For instance, in a C major context, would like an incoming C or G to produce major chords, but an incoming D or E should produce minor chords. A non-scale incoming note could work as a passing tone (not producing a chord). Basically, each of the 12 notes in the 12TET octave would trigger a different set of notes.
Therein lies the rub. Triggering different events based on different notes is easy enough with [mod] and [select]. But, for some unobvious-to-me reason, sending those “mixed messages” breaks the whole thing. This is when note off messages stop being interpreted correctly (so: stuck notes). It’s also been impossible to produce passing tones (an offset of 0 for each voice doesn’t appear to have an effect).
It’s fairly clear to me that there’s a basic misunderstanding on my part. About many things. Like which inlet produces which results and how/when messages are interpreted. To my surprise, it sounds like Pd objects have memory, which is reset by closing the patch and opening it again.
Lots to learn!
At any rate, here’s my current attempt at making a chorder/harmonizer patch. Tried many different things leading to different problems. This version gives me stuck notes. Which is what got me stuck.
Any help would be greatly appreciated!
Yousician for sight reading?
@lzr For note recognition [fiddle~] is the built-in object that you are looking for.
[helmholtz~] is an external that can often do better, especially with more complex sounds.
http://katjaas.nl/helmholtz/helmholtz.html
Chords are another matter...... and this thread....... http://forum.pdpatchrepo.info/topic/5989/detecting-chord-s-with-adc/24 ..........is almost certainly still relevant today......
The answer is most likely still....... "not possible?"...... unless you can attempt some kind of pattern matching (simple waveforms). Accoustic instruments are probably impossible. Personally, I would not even start down that road.
I would suggest keeping your project within the patch. That is..... match what is being played (midi input) to your saved sheet music midi file and ignore the audio altogether (apart from producing the sounds for the player). That should be fairly easy, as you have all of the chord information already!
Unfortunately it means keyboard only, unless your student possesses a midi violin, flute, or midi (their choice of instrument).
Notation is another problem. You will have to google around.
https://puredata.info/downloads/click-tracker is interesting, and could help you keep your musician synced with the score that they should be playing........
David.
[chrd] - Musical chord creator
Similar to [muse], containing many of the same functions, except that [muse] sends new midi/frequency values through the same two outlets, whereas [chrd] uses a 1-to-1 note-to-outlet approach. More creation arguments results in more inlets and outlets. If we created the object:
[chrd 45 22 26 29 33]
This would have 6 inlets and 5 outlets.
The first inlet receives lists, floats, and bang messages. Numeric lists reassign the scale, floats send a single frequency through the appropriate outlet, and bang messages send the respective frequencies through each available outlet. The inlets that follow assign each of the creation arguments to a new value.
use the message [midi 1|0( to switch between using either midi notes or frequencies (default).
Midi programming
Hey,
I have a midi file with chords and automated CCs under them. The chords are seperated by rests. I need to remove these rests, adjust the length of the chords to a rhythmical row and quantize the CC-changes exactly to note-on of each chord.
Is there a way to create a kind of converter in pd which does that? Any suggestions where I should start?
Regards,
Philipp
Last reminder EMERGEANDSEE media arts festival 2011
Last reminder EMERGEANDSEE media arts festival:
submit your SHORT FILMS / ABSTRACTS / INSTALLATIONS and other AUDIO/VISUAL WORKS until MARCH 15! ___ This year's topic is EN DÉTAIL
Call for participation
Since 2000 the EMERGEANDSEE media arts festival offers an independent work showcase of young audio-visual works from all over the globe. Within the interaction of short film competition, audio-visual exhibition and lectures different works and opinions come together. With EMERGEANDSEE 2011 the festival`s focus is turned to “En Détail” and the smallest things on the fringes of our daily perception, thinking and creating, which challenge our attention and sharpen our wits, independent from the connection to the big scheme of things.
For this we are looking for your position!
Artistic and theoretic perspectives on and examinations of the detail, which will be presented in Berlin in June 2011. With pictures, thoughts, sound or gestures you can add your detail to EMERGEANDSEE 2011...
Call for entries/papers:
<http://emergeandsee.org/call-for-entries/>
PDF version:
<http://emergeandsee.org/wordpress/wp-content/uploads/2010/12/Cfe-2011-en.pdf>
You can submit:
- Short films up to 20 minutes long for the big screen
- Audio/visual installations, pictures, loops, performances for the exhibition
- 20-minute contributions leaving some room for discussion and exchange for the lecutres
>> Short films
Within the short film competition, innovative feature films, animations, documentaries and experimental worlds of images from around the globe will explore the topic of the detail in the eye of the jury and the audience.
>> Exhibition
Within the exhibition no boundaries should restrict the artistic medium: performances, sound productions for the “audio-cinema”, visual artistic works, video installations, cross-medial works, etc. all toy around with the detail.
>> Lectures
Within the lectures, thinkers and makers from diverse areas (social & cultural sciences, natural sciences, media and art, etc.) will gather. Here, we are looking for new theories and ideas presented via short lectures.
Submissions for all sections until 15.03.2011 under:
http://submit.emergeandsee.org
For more details on each section please have a look at the webpage:
http://emergeandsee.org
Philipp from the EMERGEANDSEE-team
Simple condition?
ok, i never owned such a device, but i was tinkering around a bit and built the attached patch, witch is nearly as confusing as the last one.... 
if you hit a single note on your keyboard, it will play a major chord, if you hit two keys, it will play a minor chord based on the lowest key.
is this what you wanted?
edit: if you want the theremins values as basic pitch to build a minor or major chord upon (depending on if you hit a note on your keyboard), this would be much easier.
Large table or list of numbers
I"m studying PD, and doing by myself some experimental exercises. Well, in this exercise that I made, the idea was to create 3 midi chords, and I created a random object (random 3) , in order to play one of those chords:
If random object send 1, then play the first chord, if random object send 2, then play the second chord... if random object send 3 then play the third chord...
But now, I want to create a table or list , with a secuence of a lot o numbers, and how to loop that table of numbers, I mean (for example) a table with [ 1 2 3 1 1 2 1 2 3 1 2 2 1 2 3 1 3 1 2 2 2 2 1 3 3 1 3 1 3 1 2 ], I'm looking play all those numbers ( that will be a chord depending of the number) in that sequence.
I added my example patch..
Thanks a lot for your time.
Cheers.



