# -*- mode: org -*- Archived entries from file /Users/t/oz/music/Strasheela/strasheela/trunk/strasheela/others/TODO/Strasheela-Maybe-TODO.org * DONE Schoenberg Harmony :PROPERTIES: :ARCHIVE_TIME: 2008-05-27 Tue 19:14 :ARCHIVE_FILE: ~/oz/music/Strasheela/strasheela/trunk/strasheela/others/TODO/Strasheela-Maybe-TODO.org :ARCHIVE_OLPATH: Strasheela examples :ARCHIVE_CATEGORY: Strasheela :ARCHIVE_ITAGS: MAYBE STRASHEELA :END: See [[file:~/oz/music/Strasheela/strasheela/trunk/strasheela/examples/HomophonicChordProgression.oz]] [[file:~/oz/music/Strasheela/private/examples/Schoenberg/PlanningAndThinking/SchoenbergHarmony.oz]] Implement subset of Schoenberg's Theory of Harmony see also [[file:~/oz/music/Strasheela/private/examples/Schoenberg/PlanningAndThinking/SchoenbergHarmony.oz]] ** TODO Read my Schoenberg rule collection What important constraints are missing from this ruleset [[file:~/oz/music/Strasheela/private/examples/Schoenberg/PlanningAndThinking/SchoenbergHarmony.oz]] ** TODO ?? Sopran keine Tonwiederholung? ** TODO Allow for non-root inversion - rules on bass if 6/4 ** !! Constraint dissonance treatment Easy alternative: add to database only whether chord is condissonant. In that case, root progression fourth up *** TODO Add dissonant pitch classes to ET31 chord database entries Do I need this for all entries at once? *** TODO Test: is FS of disonant pitch classes accessible in chord object *** Constrain that dissonance is always prepared and resolved **** TODO Formalise this rule **** TODO Implement rule ** TODO Implement Minor - In case of major, all ScaleDegreeAccidentals must be neutral - In case of minor - Use ScaleDegreeNotes and just minor scale - The VI and VII ScaleDegreeAccidentals can be neutral or sharp - Implement Schoenberg's [Wendepunktgesetze] on notes directly (not the chord objects) -> with [Wendepunktgesetze], distribution stategy "first chords, then notes" will not work properly anymore -- likely needs left-to-right with ties broken by "type" ** TODO Implement modulation - scales parallel to chords and scales can overlap - chords only contain pitch classes which are contained in *all* sim scales (neutral chords...) - After "old" scale ends there happens a cadence (in the new scale) - Alternative: after "old" scale ends the new scale is expressed [eindeutig] with chord which contains pitches which have not been in old scale (and which [eindeutig] express new scale) ** ?? Restrict pitch doubling :MAYBE: ?? Only octave (root) doubling ** DONE Stimmabstaende CLOSED: [2008-05-22 Thu 21:16] Zwischen Oberstimmen max octave abstand ** DONE Create top-level def and music representation CLOSED: [2008-05-22 Thu 19:21] ET31 for enharmonic notation Specify which chords to allow (or define chord database which is subset of the ET31 DB ** DONE constrain chords to diatonic chords CLOSED: [2008-05-22 Thu 19:21] Specify scale Chords are only diatonic chords in this scale ?? Can I make this optional I would like to show: either diatonic or [wandernd] -> is this relevant for this article. I can put this in an extra acticle ?? Also, try to allow for modulations as an extension ** DONE Copy constraints on chord sequence CLOSED: [2008-05-22 Thu 19:22] Start with some exiting example in [[file:~/oz/music/Strasheela/strasheela/trunk/strasheela/examples/HarmonicProgressions-31ET.oz]] e.g., - only ascending chord progressions - end in cadence - diatonic ** DONE Copy Constrain "harmonisches Band bleibt liegen" and NoParallels CLOSED: [2008-05-22 Thu 19:22] see [[file:~/oz/music/Strasheela/tmp.oz::proc%20CommonPitchesHeldOver%20C1%20C2%20NotePairs][file:~/oz/music/Strasheela/tmp.oz::proc CommonPitchesHeldOver C1 C2 NotePairs]] ** DONE Add some simple melodic constraints CLOSED: [2008-05-22 Thu 19:23] - ?? only step or small skip (up to fifth) in upper voices (larger skip in bass OK) - ?? restrict total sum of melodic intervals between two chords to be lower than specified amount (except bass?) - most melodic intervals should be steps (in particular in the soprano) - no succession of melodic skips/leaps ** Old *** TODO Add accompaniment figuration with prototype motif(s) *** TODO Define/finetune suitable figuration prototype motif(s) ** Info Constrained inaccessible context: harmonic context of notes Distribution strategies to test: first fail, left-to-right, order depending on parameter types *** Nachdenken: Express chords with accompaniment figuration Why accompaniment figuration: - Avoid voice leading rules - More realistic musical situation ?? Could this be also Olle Romo's example? * DONE Output to K Sprottes PWGL simple format :MAYBE: :PROPERTIES: :ARCHIVE_TIME: 2008-08-07 Thu 18:47 :ARCHIVE_FILE: ~/oz/music/Strasheela/strasheela/trunk/strasheela/others/TODO/Strasheela-Maybe-TODO.org :ARCHIVE_OLPATH: Strasheela design :ARCHIVE_CATEGORY: Strasheela :ARCHIVE_ITAGS: STRASHEELA :END: This format is easily created in Strasheela (similar to fomus..) And it can be transformed into a proportional ENP score Advantage: I could edit resulting scores in the ENP score editor If I later want to translate the score back to Strasheela, then I possibly need to keep some info on the orig nesting etc. But that would be less important in the beginning. I could also edit the tempo curves etc in ENP, even in algorithmic ways. I would need some 'info' slot to keep arbitrary additional info on score objects (e.g., where some motif starts and ends), if I want to do that adaequately * DONE Output to K Sprottes PWGL simple format :MAYBE: CLOSED: [2008-08-07 Thu 18:48] :PROPERTIES: :ARCHIVE_TIME: 2008-08-07 Thu 18:48 :ARCHIVE_FILE: ~/oz/music/Strasheela/strasheela/trunk/strasheela/others/TODO/Strasheela-Maybe-TODO.org :ARCHIVE_OLPATH: Strasheela design :ARCHIVE_CATEGORY: Strasheela :ARCHIVE_TODO: DONE :ARCHIVE_ITAGS: STRASHEELA :END: This format is easily created in Strasheela (similar to fomus..) And it can be transformed into a proportional ENP score Advantage: I could edit resulting scores in the ENP score editor If I later want to translate the score back to Strasheela, then I possibly need to keep some info on the orig nesting etc. But that would be less important in the beginning. I could also edit the tempo curves etc in ENP, even in algorithmic ways. I would need some 'info' slot to keep arbitrary additional info on score objects (e.g., where some motif starts and ends), if I want to do that adaequately * DONE Subscript mixins CLOSED: [2009-03-24 Tue 20:10] :PROPERTIES: :ARCHIVE_TIME: 2009-03-24 Tue 20:10 :ARCHIVE_FILE: ~/oz/music/Strasheela/strasheela/trunk/strasheela/others/TODO/Strasheela-Maybe-TODO.org :ARCHIVE_OLPATH: Strasheela design :ARCHIVE_CATEGORY: Strasheela :ARCHIVE_TODO: DONE :ARCHIVE_ITAGS: MAYBE STRASHEELA :END: Goal: "factor out" specific constraints (and corresponding args) of subscripts to make these defs more flexible Example: having rhythm defined in "mixing" and added only when need to subscripts applying counterpoint constraints and/or constraining pitch countour First idea: extend Score.defSubscript by new arg mixins (complements arg super) Mixin only applies constraints and hands args to constraints Each mixin defined by some abstraction similar to Score.defSubscript: default args are declared and constraint application by proc Score.defSubscript internally then applies procs of all mixins (and cares for the default etc args!) * DONE Define setup for convenient tutorial editing CLOSED: [2009-11-12 Thu 00:34] :PROPERTIES: :ARCHIVE_TIME: 2009-11-17 Tue 15:46 :ARCHIVE_FILE: ~/oz/music/Strasheela/strasheela/trunk/strasheela/others/TODO/Strasheela-Maybe-TODO.org :ARCHIVE_OLPATH: Strasheela documentation :ARCHIVE_CATEGORY: Strasheela :ARCHIVE_TODO: DONE :ARCHIVE_ITAGS: MAYBE STRASHEELA :END: org-babel looks very promising http://orgmode.org/worg/org-contrib/babel/org-babel.php see also file:~/oz/music/Strasheela/StraheelaTutorial/ Org-mode already supports (for all languages) - Code snippets in files are suitably formatted in HTML and Latex - Fortification of code for HTML export - Code can be edited in major Emacs mode of respective language - References in source code - ... Org-babel additionally supports (for supported languages) - Code can be executed and results added automatically to org file - Literate programming (LP): larger code examples can be divided in snippets discussed individually and then combined into longer source files (tangling in LP terminology) --> This can be very useful for explaining examples in detail (don't plan to use that technique for whole Strasheela, though..) - ... ** TODO Add Oz support to Org-babel [documentation of Strasheela examples is paramount -- adds publicity etc] It would be very nice to have Oz support in Org-babel. E.g., something like my Schoenberg example HTML file could almost automatically be updated after a change in the source -- now this change is delayed by ages... Also, existing language defs look relatively short. *** Contact Org-babel developer: Eric Schulte, Dan Davison Eric Schulte http://www.cs.unm.edu/~eschulte/ mail: Eric Schulte Tel: 703.405.0263 Dan Davison http://www.stats.ox.ac.uk/~davison/ Dan Davison Subject: Adding Org-babel support for Oz? Dear Eric Schulte and Dan Davison, Thank you very much for your software Org-babel. Just recently I found out about it, and I am really excited about its capabilities, combined with the features plain Org-mode offers already. I would very much like to use Org-babel to write a tutorial for my software Strasheela, and also to document Strasheela examples in detail and still nicely readable. Strasheela (http://strasheela.sourceforge.net) is a programming environment for modelling music theories and composition, and it is based on the programming language Oz (http://www.mozart-oz.org/, the language is called Oz, the implementation Mozart). I had a brief look at your Org-babel definitions for various programming languages, and I was surprised how concise these definitions are. Is my impression right that it would be relatively strait forward to add support for further languages to Org-babel? Would you help me to extend Org-babel to support the language Oz? How does the communication between Org-babel and work? With Oz, there are at least two different approaches possible. On the one hand, the major emacs mode of Oz allows for interactive code execution (the Emacs mode runs a Mozart compiler in the background). On the other hand, it would be possible to "manually" start a Mozart compiler in a shell, and communicate with this compiler, e.g., via sockets. I really like the fact that Org-babel supports automatic insertion of results of computations into an org file. Actually, for the documentation of Strasheela I often need to output multiple results, typically a score picture and some mp3 sound file. Do you think it is possible to somehow extend/customise an Oz extension of Org-babel (once it is there) to allow for automatic output of multiple results (links to files)? I should also mention that unfortunately I likely will not have the time to start right away to work on adding Oz/Mozart to Org-babel. However, I am so excited about it that at least I want to ask my questions above right away :) Thank you very much indeed! Best regards, Torsten Anders -- Torsten Anders Interdisciplinary Centre for Computer Music Research University of Plymouth Office: +44-1752-586219 Private: +44-1752-558917 http://strasheela.sourceforge.net http://www.torsten-anders.de *** Reply Dan From: davison@stats.ox.ac.uk Subject: Re: Subject: Adding Org-babel support for Oz? Date: 3. November 2009 05:11:34 GMT+00:00 To: torsten.anders@plymouth.ac.uk Cc: schulte.eric@gmail.com Hi Torsten, I really like the sound of this and I'll be happy to help out where I can (but I don't know anything about Oz.) We seem to be a bit light on documentation on how to add support for a new language, so looking at the existing language implementations is certainly the way forward. (Perhaps we could add a simple, commented skeleton language implementation at some point). I'll make a few comments below, but feel free to ask any more questions in the lead-up to actually starting work on this. As you've probably seen, the basic requirement is to implement the function org-babel-execute:oz, which takes the code body, and an alist of parameters and returns the result of evaluating the code. These org-babel-execute: functions are called by org-babel-execute-src-block in org-babel.el.[1] First of all, there are two basic features of our design that you'll need to consider: "output" vs. "value" results, and "session" vs. "non-session" evaluation. In principal, all 4 pairwise combinations of these two pairs are possible, although some may not be meaningful or technically possible for a given language. 1. output vs. value results ':results output' means, basically, that the "results" of the code are whatever text it spits out on standard output. ':results value' means that the "result" is the value of the last expression in the block of code. So in a code block like this #+begin_src python print 'hello' print 'hello again' print 'bye' 4 #+end_src under :results output the result would be 'hello\nhello again\nbye\n'. But under :results value, the result of the block would be the number 4. 2. session vs. non-session You mention this below. Evaluating in a 'session' means that the code if evaluated in an interactive emacs major mode dedicated to the language, if one exists. 'Non-session evaluation' means that the code is passed to an external process to obtain the result. Eric is the expert on this, but I believe that the easiest thing to start off with would usually be ':results output', non-session. I.e. collecting the result of standard output from the external process. This is often easier than :session evaluation, since extracting results from the emacs major mode can be fiddly. ':results value' requires some way of identifying the value of the last expression evaluated (a feature which e.g. python, ruby and R all have). <...> How does the communication between Org-babel and work? With Oz, there are at least two different approaches possible. On the one hand, the major emacs mode of Oz allows for interactive code execution (the Emacs mode runs a Mozart compiler in the background). This would correspond to the :session header argument. On the other hand, it would be possible to "manually" start a Mozart compiler in a shell, and communicate with this compiler, e.g., via sockets. This would be the default (i.e. in the absence of :session) I really like the fact that Org-babel supports automatic insertion of results of computations into an org file. Actually, for the documentation of Strasheela I often need to output multiple results, typically a score picture and some mp3 sound file. Do you think it is possible to somehow extend/customise an Oz extension of Org-babel (once it is there) to allow for automatic output of multiple results (links to files)? I would also like to do this. It is currently most pressing in the language R, where it is natural to produce both graphics and numerical/text output. It's doable. I should also mention that unfortunately I likely will not have the time to start right away to work on adding Oz/Mozart to Org-babel. No worries, we're also both pushed for time at the moment. But this will be the first music-producing capabilities for org-mode, so like I said I'm happy to help. Dan Footnotes: [1] *[Note that because of the way the org-babel-execute: functions are called, 4 variables will be 'magically' available inside the org-babel-execute:oz function: session vars result-params result-type. However this is just for convenience as they are extractable from the alist of params]* *** Reply Eric From: schulte.eric@gmail.com Subject: Re: Subject: Adding Org-babel support for Oz? Date: 3. November 2009 15:53:43 GMT+00:00 To: davison@stats.ox.ac.uk Cc: torsten.anders@plymouth.ac.uk, schulte.eric@gmail.com Hi Torsten, I think Dan pretty well covered the landscape. All I would add is the attached org-babel-template.el which is intended to be used as the starting point for any new language. It includes comments and stubs of all of the important functions. A good first step would be to rename org-babel-template to org-babel-oz and do a file-wide search/replace of template/oz. Best of Luck, and please don't hesitate to ask for help -- Eric ** Info: Further links etc on org-babel, org-mode etc !! Check out Org-babel: an org-mode extension for executable source code blocks in org-mode http://orgmode.org/worg/org-contrib/babel/org-babel.php http://orgmode.org/manual/Literal-examples.html Even syntax colouring is supported. Editing code in respective Emacs mode: C-c ' http://orgmode.org/org.html#Literal-examples built-in support for Noweb http://orgmode.org/worg/org-tutorials/multitarget-tables.php ?? Can I export programs (code) from and org file? *** Example #+BEGIN_SRC oz -n -r local X in {Browse X} (ref:sc) X=10 end #+END_SRC Check out [[(sc)]] bla bla *So, looks like using org-mode would be great for editing the Strasheela tutorial* Fully self-contained examples examples I can run as they are. What about examples consisting of multiple text snippets? * DONE Define setup for convenient tutorial editing CLOSED: [2009-11-12 Thu 00:34] :PROPERTIES: :ARCHIVE_TIME: 2009-11-17 Tue 15:46 :ARCHIVE_FILE: ~/oz/music/Strasheela/strasheela/trunk/strasheela/others/TODO/Strasheela-Maybe-TODO.org :ARCHIVE_OLPATH: Strasheela documentation :ARCHIVE_CATEGORY: Strasheela :ARCHIVE_TODO: DONE :ARCHIVE_ITAGS: MAYBE STRASHEELA :END: org-babel looks very promising http://orgmode.org/worg/org-contrib/babel/org-babel.php see also file:~/oz/music/Strasheela/StraheelaTutorial/ Org-mode already supports (for all languages) - Code snippets in files are suitably formatted in HTML and Latex - Fortification of code for HTML export - Code can be edited in major Emacs mode of respective language - References in source code - ... Org-babel additionally supports (for supported languages) - Code can be executed and results added automatically to org file - Literate programming (LP): larger code examples can be divided in snippets discussed individually and then combined into longer source files (tangling in LP terminology) --> This can be very useful for explaining examples in detail (don't plan to use that technique for whole Strasheela, though..) - ... ** TODO Add Oz support to Org-babel [documentation of Strasheela examples is paramount -- adds publicity etc] It would be very nice to have Oz support in Org-babel. E.g., something like my Schoenberg example HTML file could almost automatically be updated after a change in the source -- now this change is delayed by ages... Also, existing language defs look relatively short. *** Contact Org-babel developer: Eric Schulte, Dan Davison Eric Schulte http://www.cs.unm.edu/~eschulte/ mail: Eric Schulte Tel: 703.405.0263 Dan Davison http://www.stats.ox.ac.uk/~davison/ Dan Davison Subject: Adding Org-babel support for Oz? Dear Eric Schulte and Dan Davison, Thank you very much for your software Org-babel. Just recently I found out about it, and I am really excited about its capabilities, combined with the features plain Org-mode offers already. I would very much like to use Org-babel to write a tutorial for my software Strasheela, and also to document Strasheela examples in detail and still nicely readable. Strasheela (http://strasheela.sourceforge.net) is a programming environment for modelling music theories and composition, and it is based on the programming language Oz (http://www.mozart-oz.org/, the language is called Oz, the implementation Mozart). I had a brief look at your Org-babel definitions for various programming languages, and I was surprised how concise these definitions are. Is my impression right that it would be relatively strait forward to add support for further languages to Org-babel? Would you help me to extend Org-babel to support the language Oz? How does the communication between Org-babel and work? With Oz, there are at least two different approaches possible. On the one hand, the major emacs mode of Oz allows for interactive code execution (the Emacs mode runs a Mozart compiler in the background). On the other hand, it would be possible to "manually" start a Mozart compiler in a shell, and communicate with this compiler, e.g., via sockets. I really like the fact that Org-babel supports automatic insertion of results of computations into an org file. Actually, for the documentation of Strasheela I often need to output multiple results, typically a score picture and some mp3 sound file. Do you think it is possible to somehow extend/customise an Oz extension of Org-babel (once it is there) to allow for automatic output of multiple results (links to files)? I should also mention that unfortunately I likely will not have the time to start right away to work on adding Oz/Mozart to Org-babel. However, I am so excited about it that at least I want to ask my questions above right away :) Thank you very much indeed! Best regards, Torsten Anders -- Torsten Anders Interdisciplinary Centre for Computer Music Research University of Plymouth Office: +44-1752-586219 Private: +44-1752-558917 http://strasheela.sourceforge.net http://www.torsten-anders.de *** Reply Dan From: davison@stats.ox.ac.uk Subject: Re: Subject: Adding Org-babel support for Oz? Date: 3. November 2009 05:11:34 GMT+00:00 To: torsten.anders@plymouth.ac.uk Cc: schulte.eric@gmail.com Hi Torsten, I really like the sound of this and I'll be happy to help out where I can (but I don't know anything about Oz.) We seem to be a bit light on documentation on how to add support for a new language, so looking at the existing language implementations is certainly the way forward. (Perhaps we could add a simple, commented skeleton language implementation at some point). I'll make a few comments below, but feel free to ask any more questions in the lead-up to actually starting work on this. As you've probably seen, the basic requirement is to implement the function org-babel-execute:oz, which takes the code body, and an alist of parameters and returns the result of evaluating the code. These org-babel-execute: functions are called by org-babel-execute-src-block in org-babel.el.[1] First of all, there are two basic features of our design that you'll need to consider: "output" vs. "value" results, and "session" vs. "non-session" evaluation. In principal, all 4 pairwise combinations of these two pairs are possible, although some may not be meaningful or technically possible for a given language. 1. output vs. value results ':results output' means, basically, that the "results" of the code are whatever text it spits out on standard output. ':results value' means that the "result" is the value of the last expression in the block of code. So in a code block like this #+begin_src python print 'hello' print 'hello again' print 'bye' 4 #+end_src under :results output the result would be 'hello\nhello again\nbye\n'. But under :results value, the result of the block would be the number 4. 2. session vs. non-session You mention this below. Evaluating in a 'session' means that the code if evaluated in an interactive emacs major mode dedicated to the language, if one exists. 'Non-session evaluation' means that the code is passed to an external process to obtain the result. Eric is the expert on this, but I believe that the easiest thing to start off with would usually be ':results output', non-session. I.e. collecting the result of standard output from the external process. This is often easier than :session evaluation, since extracting results from the emacs major mode can be fiddly. ':results value' requires some way of identifying the value of the last expression evaluated (a feature which e.g. python, ruby and R all have). <...> How does the communication between Org-babel and work? With Oz, there are at least two different approaches possible. On the one hand, the major emacs mode of Oz allows for interactive code execution (the Emacs mode runs a Mozart compiler in the background). This would correspond to the :session header argument. On the other hand, it would be possible to "manually" start a Mozart compiler in a shell, and communicate with this compiler, e.g., via sockets. This would be the default (i.e. in the absence of :session) I really like the fact that Org-babel supports automatic insertion of results of computations into an org file. Actually, for the documentation of Strasheela I often need to output multiple results, typically a score picture and some mp3 sound file. Do you think it is possible to somehow extend/customise an Oz extension of Org-babel (once it is there) to allow for automatic output of multiple results (links to files)? I would also like to do this. It is currently most pressing in the language R, where it is natural to produce both graphics and numerical/text output. It's doable. I should also mention that unfortunately I likely will not have the time to start right away to work on adding Oz/Mozart to Org-babel. No worries, we're also both pushed for time at the moment. But this will be the first music-producing capabilities for org-mode, so like I said I'm happy to help. Dan Footnotes: [1] *[Note that because of the way the org-babel-execute: functions are called, 4 variables will be 'magically' available inside the org-babel-execute:oz function: session vars result-params result-type. However this is just for convenience as they are extractable from the alist of params]* *** Reply Eric From: schulte.eric@gmail.com Subject: Re: Subject: Adding Org-babel support for Oz? Date: 3. November 2009 15:53:43 GMT+00:00 To: davison@stats.ox.ac.uk Cc: torsten.anders@plymouth.ac.uk, schulte.eric@gmail.com Hi Torsten, I think Dan pretty well covered the landscape. All I would add is the attached org-babel-template.el which is intended to be used as the starting point for any new language. It includes comments and stubs of all of the important functions. A good first step would be to rename org-babel-template to org-babel-oz and do a file-wide search/replace of template/oz. Best of Luck, and please don't hesitate to ask for help -- Eric ** Info: Further links etc on org-babel, org-mode etc !! Check out Org-babel: an org-mode extension for executable source code blocks in org-mode http://orgmode.org/worg/org-contrib/babel/org-babel.php http://orgmode.org/manual/Literal-examples.html Even syntax colouring is supported. Editing code in respective Emacs mode: C-c ' http://orgmode.org/org.html#Literal-examples built-in support for Noweb http://orgmode.org/worg/org-tutorials/multitarget-tables.php ?? Can I export programs (code) from and org file? *** Example #+BEGIN_SRC oz -n -r local X in {Browse X} (ref:sc) X=10 end #+END_SRC Check out [[(sc)]] bla bla *So, looks like using org-mode would be great for editing the Strasheela tutorial* Fully self-contained examples examples I can run as they are. What about examples consisting of multiple text snippets?