<?xml version="1.0"?>
<rss version="2.0"><channel><title>Function Examples Latest Topics</title><link>https://opusmodus.com/forums/forum/36-function-examples/</link><description>Function Examples Latest Topics</description><language>en</language><item><title>tendencies and vector-smooth</title><link>https://opusmodus.com/forums/topic/4100-tendencies-and-vector-smooth/</link><description><![CDATA[<p>Hello,</p><p>when using vector-smooth my tendencies start around 0.1 but end &gt;0.2 (should be around 0.1 as well)</p><p>How can I prevent that?<br></p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>(setf tend-list
'(0.1 0.4 0.2 0.6 0.5 0.5 0.9 0.7 0.7 1 0.9 1.2 0.9 0.9 0.5 0.5 0.6 0.2 0.2 0.1))

(list-plot
(setf dur-mults
(loop for i in durlens
with seed = (init-seed 123)
collect
(vector-smooth 0.3
(gen-tendency i tend-list :variance 0.2))))
:zero-based t :join-points t)</code></pre><p></p><p>Thanks for help, Achim</p>]]></description><guid isPermaLink="false">4100</guid><pubDate>Mon, 13 Apr 2026 17:35:13 +0000</pubDate></item><item><title>All previous rewrite functions used together</title><link>https://opusmodus.com/forums/topic/4098-all-previous-rewrite-functions-used-together/</link><description><![CDATA[<p>Ciao, Opusmoders </p><p></p><p>All previous rewrite functions used in conjunction for transformations.</p><p></p><p>Ciao !</p><p></p><p><a rel="" href="https://opusmodus.com/forums/topic/4097-rewrite-len-function/#comment-14209">https://opusmodus.com/forums/topic/4097-rewrite-len-function/#comment-14209</a></p><p></p><p><code>(setf expressao-omn '((s eb4 d4 e a4 -s s eb4) (h eb4 a4 -s eb4 d4 -s)</code></p><p><code>                      (e. d4 a4 eb4 d4)</code></p><p><code>                      (-q e f4 s c5 qs fs4)))</code></p><p></p><p><img class="ipsImage ipsRichText__align--block ipsRichText__align--width-custom" data-fileid="4399" src="https://opusmodus.com/forums/uploads/monthly_2026_04/image.png.b235b138e82177f81d861f209aeaf392.png" alt="image.png" title="" width="912" height="144" style="--i-media-width: 510px;" loading="lazy"></p><p></p><p></p><p><code>(rewrite-pit </code></p><p><code>(rewrite-dyn </code></p><p><code>(rewrite-len expressao-omn </code></p><p><code>'(h -e s q -h q -q s s s)) </code></p><p><code>'(pp&lt; ff mf fff p &lt; &lt; fff ppp fff mf fff p))</code></p><p><code>'(c4 g5))</code></p><p></p><p><img class="ipsImage ipsRichText__align--block ipsRichText__align--width-fullwidth" data-fileid="4398" src="https://opusmodus.com/forums/uploads/monthly_2026_04/image.png.1c1654b4a3d931779f730579ea1de1d2.png" alt="image.png" title="" width="1657" height="339" loading="lazy"></p><p></p><p></p><div class="ipsEmbeddedOther" data-og-user_text="https://opusmodus.com/forums/topic/4096-rewrite-pit-function/#comment-14208"><iframe src="https://opusmodus.com/forums/topic/4096-rewrite-pit-function/?do=embed&amp;comment=14208&amp;embedComment=14208&amp;embedDo=findComment#comment-14208" data-embedcontent="" data-internalembed="" data-controller="core.front.core.autosizeiframe" data-embedauthorid="394" data-ipsembed-contentapp="forums" data-ipsembed-contentclass="forums_Topic" data-ipsembed-contentid="4096" data-ipsembed-timestamp="1775874151" data-ipsembed-contentcommentid="14208" allowfullscreen="" data-og-user_text="https://opusmodus.com/forums/topic/4096-rewrite-pit-function/#comment-14208" loading="lazy"></iframe></div><p></p><p></p><p><a rel="" href="https://opusmodus.com/forums/topic/4097-rewrite-len-function/#comment-14209">https://opusmodus.com/forums/topic/4097-rewrite-len-function/#comment-14209</a></p><p></p><p></p><div class="ipsEmbeddedOther" data-og-user_text="https://opusmodus.com/forums/topic/4095-rewrite-dyn-function/#comment-14207"><iframe src="https://opusmodus.com/forums/topic/4095-rewrite-dyn-function/?do=embed&amp;comment=14207&amp;embedComment=14207&amp;embedDo=findComment#comment-14207" data-embedcontent="" data-internalembed="" data-controller="core.front.core.autosizeiframe" data-embedauthorid="394" data-ipsembed-contentapp="forums" data-ipsembed-contentclass="forums_Topic" data-ipsembed-contentid="4095" data-ipsembed-timestamp="1775874180" data-ipsembed-contentcommentid="14207" allowfullscreen="" data-og-user_text="https://opusmodus.com/forums/topic/4095-rewrite-dyn-function/#comment-14207" loading="lazy"></iframe></div><p></p>]]></description><guid isPermaLink="false">4098</guid><pubDate>Sat, 11 Apr 2026 02:24:47 +0000</pubDate></item><item><title>rewrite-len function</title><link>https://opusmodus.com/forums/topic/4097-rewrite-len-function/</link><description><![CDATA[<p>Last one... Time to go to bed in Brasil</p><p></p><p>Function to rewrite lengths</p><p></p><p>BEst,</p><p>Julio</p><p></p><p><code>(defun rewrite-len (expressao-omn new-lengths-list)</code></p><p><code>  "Substitui os comprimentos (lengths) de uma expressão OMN por uma lista fornecida, </code></p><p><code>   repetindo-a ciclicamente e mantendo a estrutura de sublistas original."</code></p><p><code>  (let* ((dis (disassemble-omn expressao-omn))          ;; Desmonta a expressão original [2]</code></p><p><code>         (old-pit (getf dis :pitch))                    ;; Extrai as alturas [4]</code></p><p><code>         (old-vel (getf dis :velocity))                 ;; Extrai as velocidades [4]</code></p><p><code>         (old-art (getf dis :articulation))             ;; Extrai as articulações [4]</code></p><p><code>         </code></p><p><code>         ;; 1. Mapeia a estrutura original (quantidade de eventos por sublista)</code></p><p><code>         ;; Captura o número de elementos rítmicos em cada compasso [3, 5]</code></p><p><code>         (structure (mapcar #'length (getf dis :length))) </code></p><p><code>         (total-events (apply #'+ structure))           ;; Soma total de eventos [6]</code></p><p><code>         </code></p><p><code>         ;; 2. Gera a sequência rítmica cíclica com base no total de eventos</code></p><p><code>         ;; gen-trim estende a lista do usuário para preencher todos os espaços [3, 7]</code></p><p><code>         (new-flat-lengths (gen-trim total-events new-lengths-list))</code></p><p><code>         </code></p><p><code>         ;; 3. Re-organiza os novos ritmos na estrutura de sublistas original [3, 8]</code></p><p><code>         (new-structured-lengths (gen-divide structure new-flat-lengths)))</code></p><p><code>    ;; 4. Remonta o objeto OMN completo com os parâmetros preservados [3, 4]</code></p><p><code>    (make-omn :pitch old-pit</code></p><p><code>              :length new-structured-lengths</code></p><p><code>              :velocity old-vel</code></p><p><code>              :articulation old-art)))</code></p><p></p><p>;;USE</p><p></p><p></p><p><code>(setf expressao-omn '((s eb4 d4 e a4 -s s eb4) (h eb4 a4 -s eb4 d4 -s)</code></p><p><code>                      (e. d4 a4 eb4 d4)</code></p><p><code>                      (-q e f4 s c5 qs fs4)))</code></p><p><code>(omn-to-time-signature (rewrite-len expressao-omn '(h -e s q -h q -q s s s)) '(3 4))</code></p><p></p><p>;;RESULT</p><p></p><p><code>((h eb4 mf -e s d4 a4 tie) (e. a4 -h s eb4 mf tie) (e. eb4 mf -q s a4 eb4 d4 e eb4 tie) (q. eb4 -e s d4 mf e. a4 tie) (s a4 -h e. f4 mf tie) (s f4 mf -q s c5 fs4))</code></p>]]></description><guid isPermaLink="false">4097</guid><pubDate>Sat, 11 Apr 2026 02:14:20 +0000</pubDate></item><item><title>rewrite-pit function</title><link>https://opusmodus.com/forums/topic/4096-rewrite-pit-function/</link><description><![CDATA[<p>Hey, Opusmoders</p><p></p><p>Here is one more function in the style of the previous one (rewrite-dyn). This time to rewrite pitches.</p><p></p><p></p><p><code>(defun rewrite-pit (expressao-omn pitch-list)</code></p><p><code>  "Substitui as alturas de uma expressão OMN por uma lista customizada, </code></p><p><code>   fazendo a repetição cíclica se a lista for menor que o número de notas."</code></p><p><code>  (let* ((dis (disassemble-omn expressao-omn))          ;; Desmonta a expressão [3, 6]</code></p><p><code>         (pitches (getf dis :pitch))                    ;; Extrai alturas atuais</code></p><p><code>         (lengths (getf dis :length))                  ;; Extrai durações (inclui rests) [7]</code></p><p><code>         (velocities (getf dis :velocity))              ;; Extrai dinâmicas [8]</code></p><p><code>         (articulations (getf dis :articulation))        ;; Extrai articulações/ties [9, 10]</code></p><p><code>         ;; 1. Mapeia a quantidade de notas em cada sublista/compasso</code></p><p><code>         (counts (mapcar #'length pitches))             ;; [2, 5]</code></p><p><code>         ;; 2. Calcula o total de eventos de nota para o preenchimento</code></p><p><code>         (total-notes (apply #'+ (flatten counts)))     ;; [2, 11]</code></p><p><code>         ;; 3. Gera a lista de novas alturas repetindo o padrão do usuário</code></p><p><code>         (flat-pitches (gen-trim total-notes pitch-list)) ;; [2, 4]</code></p><p><code>         ;; 4. Redistribui as alturas na estrutura de sublistas original</code></p><p><code>         (structured-pitches (gen-divide counts flat-pitches))) ;; [2, 5]</code></p><p><code>    </code></p><p><code>    ;; 5. Remonta o objeto OMN completo preservando os demais parâmetros</code></p><p><code>    (make-omn :pitch structured-pitches</code></p><p><code>              :length lengths</code></p><p><code>              :velocity velocities</code></p><p><code>              :articulation articulations)))            ;; [2, 3]</code></p><p></p><p>;;USE</p><p></p><p></p><p><code>(setf expressao-omn '((s eb4 d4 e a4 -s s eb4 tie) (h eb4 a4 -s eb4 d4 -s tie) </code></p><p><code>               (e. d4 a4 eb4 d4) </code></p><p><code>               (-q e f4 s c5 qs fs4)))</code></p><p></p><p>Using both rewrite-dyn and rewrite-pit </p><p></p><p><code>(rewrite-pit expressao-omn '(c4 e4 d4 c4 c4))</code></p><p><code>(rewrite-dyn (rewrite-pit expressao-omn '(c4 e4 d4 c4 c4)) '(ff &gt; p p&lt; ff&gt; pp ff p p&lt; ff p mf ppp p &lt; ff))</code></p><p></p><p>Best !!</p><p></p><p>Julio Herrlein</p>]]></description><guid isPermaLink="false">4096</guid><pubDate>Sat, 11 Apr 2026 01:24:46 +0000</pubDate></item><item><title>rewrite-dyn function</title><link>https://opusmodus.com/forums/topic/4095-rewrite-dyn-function/</link><description><![CDATA[<p>Hello, Opusmoders</p><p></p><p>This is a very cool and easy to use function to rewrite dynamics.</p><p>Check it out. Hope you like it !</p><p>Best,</p><p>Julio</p><p></p><p><code>(defun rewrite-dyn (expressao-omn dynamic-list)</code></p><p><code>  "Substitui as dinâmicas de uma expressão OMN por uma lista customizada, </code></p><p><code>   fazendo a rotação cíclica se a lista for menor que o número de notas."</code></p><p><code>  (let* ((dis (disassemble-omn expressao-omn))          ; [2, 3]</code></p><p><code>         (pitches (getf dis :pitch))</code></p><p><code>         (lengths (getf dis :length))</code></p><p><code>         (articulations (getf dis :articulation))</code></p><p><code>         ;; 1. Mapeia a estrutura de cada sublista (quantidade de notas por compasso)</code></p><p><code>         (counts (mapcar #'length pitches))             ; [6]</code></p><p><code>         ;; 2. Calcula o total de notas para gerar dinâmicas suficientes</code></p><p><code>         (total-notes (apply #'+ (flatten counts)))     ; [7]</code></p><p><code>         ;; 3. Cria a lista plana de dinâmicas repetindo o padrão do usuário [4]</code></p><p><code>         (flat-vels (gen-trim total-notes dynamic-list))</code></p><p><code>         ;; 4. Redistribui as dinâmicas na estrutura de sublistas original [5]</code></p><p><code>         (structured-vels (gen-divide counts flat-vels)))</code></p><p><code>    </code></p><p><code>    ;; 5. Remonta o objeto OMN completo com os novos parâmetros [3]</code></p><p><code>    (make-omn :pitch pitches</code></p><p><code>              :length lengths</code></p><p><code>              :velocity structured-vels</code></p><p><code>              :articulation articulations)))</code></p><p></p><p>;; USE</p><p>;; Exemplo 1: Dinâmicas simples</p><p></p><p><code>(setf expressao-omn '((s eb4 d4 e a4 -s s eb4 tie) (h eb4 a4 -s eb4 d4 -s tie) </code></p><p><code>               (e. d4 a4 eb4 d4) </code></p><p><code>               (-q e f4 s c5 qs fs4)))</code></p><p></p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4396" src="https://opusmodus.com/forums/uploads/monthly_2026_04/image.png.8cc59f1ade67e4efc78c6e8e30c476d2.png" alt="image.png" title="" width="937" height="125" loading="lazy"></p><p></p><p><code>(rewrite-dyn expressao-omn '(p mf ff))</code></p><p></p><p><code>;; &gt;&gt; ((s eb4 p d4 mf e a4 ff -s eb4 p tie) (h eb4 mf a4 ff -s eb4 p d4 mf - d4 ff tie) (e. d4 p a4 mf eb4 ff d4 p) (-q e f4 mf s c5 ff qs fs4 p))</code></p><p></p><p></p><p>;; Exemplo 2: Incluindo crescendos</p><p></p><p><code>(rewrite-dyn expressao-omn '(ff &gt; p p&lt; ff&gt; pp ff p p&lt; ff p mf ppp p &lt; ff))</code></p><p></p><p><code>;; ((s eb4 ff d4 &gt; e a4 p -s eb4 p&lt; tie) (h eb4 ff&gt; a4 pp -s eb4 ff d4 p - d4 p&lt; tie) (e. d4 ff a4 p eb4 mf d4 ppp) (-q e f4 p s c5 &lt; qs fs4 ff))</code></p><p></p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4397" src="https://opusmodus.com/forums/uploads/monthly_2026_04/image.png.c6f67f048aace69b80455cb68917ba0e.png" alt="image.png" title="" width="1270" height="148" loading="lazy"></p>]]></description><guid isPermaLink="false">4095</guid><pubDate>Sat, 11 Apr 2026 00:52:19 +0000</pubDate></item><item><title>shift-rhythm Function</title><link>https://opusmodus.com/forums/topic/4094-shift-rhythm-function/</link><description><![CDATA[<p>Hello, Opusmoders</p><p></p><p>Sometime ago I was here searching for a function to displace rhtyhms by a length amount, not just like a list rotation.</p><p>Now I did this prototype. I think that this can be very useful, specially inside counterpoint dictums where patterns can be displaced ( I did not tried inside the counterpoint function but seems like it will work).</p><p>Hope it can be useful to you too.</p><p></p><p>All the best,</p><p>Julio</p><p></p><p><code>(defun shift-rhythm (rhythm shift-length &amp;key span)</code></p><p></p><p><code>;"Moves rhythmic material by inserting a pause at the beginning.</code></p><p><code>;Use length-adjust to ensure the result fits within the span."</code></p><p></p><p><code>(let* ((rhy (flatten rhythm))</code></p><p><code>;;;; Ensures a linear list for processing</code></p><p><code>;; Adds the offset value as a negative pause at the beginning [5]</code></p><p><code>(with-offset (append (list (- (abs shift-length))) rhy))</code></p><p></p><p><code>;;Define the target span: either the requested one or the original rhythm.</code></p><p><code>(target-span (or span (get-span rhythm))))</code></p><p></p><p><code>;; The length-adjust function adjusts the total to the desired span [1].</code></p><p><code>;; With :position 'e (default), it removes or adds from the end of the list [6].</code></p><p><code>(length-adjust target-span with-offset :omn t :type 'r)))</code></p><p></p><p><code>;;; USE</code></p><p><code>;Exemplo 1: Span de 4/4 (1/1)</code></p><p><code>(setf ideia '(e c5 e d4 q f4 -h)) ;; Span original de 1/1</code></p><p><code>(shift-rhythm ideia 1/8 :span 3/4)</code></p><p><code>;; (-e e c5 d4 q f4 -e)</code></p><p><code>(shift-rhythm ideia 3/8 :span 5/4)</code></p><p><code>;; (-q. e c5 d4 q f4 -q.)</code></p><p></p><p>also with negative displacement</p><p></p><p><code>(setf ideia '(-h e c5 e d4 q f4 -h))</code></p><p><code>(shift-rhythm ideia -1/8 :span 7/4)</code></p><p><code>;;(-e -h e c5 d4 q f4 -h -e)</code></p><p>It could be perfected to deal with nested sublists and with different displacements for each sublist, like</p><p></p><p>(setf ideia '((-h e c5 e d4 q f4 -h)(-h e c5 e d4 q f4 -h.)(-h e c5 e d4 q f4 -q))</p><p>(shift-rhythm ideia '((-1/8) (2/16) (3/8)) :span 7/4)</p><p></p><p>etc</p>]]></description><guid isPermaLink="false">4094</guid><pubDate>Fri, 10 Apr 2026 16:56:39 +0000</pubDate></item><item><title>merge-rotated-sublists function</title><link>https://opusmodus.com/forums/topic/4082-merge-rotated-sublists-function/</link><description><![CDATA[<p>Hello, Opusmoders</p><p></p><p>I did (with a little help of Notebooklm) this cool function whose function is to concatenate 2 diferent lists with sublists, merging the first sublist of the list A with the first sublist of list B, with the options <br>1) to choose how many elements of each list to use; and</p><p>2) the possibility of not only mix different numbers of elements in each list but also the possibility to select the starting element of the list to pick elements.</p><p>3) The function also consider each list as a rotating element: for example, if 5 elements are required from the list (1 2 3), starting in the first element, the result will be (1 2 3 1 2), if the start is on the second element, the result will be (2 3 1 2 3) and so on.</p><p></p><p>This is useful for me. Hope you like it.</p><p></p><p>Best,</p><p>Julio</p><p></p><p></p><p><code>(defun get-rotated-elements (lst start count)</code></p><p><code>"Extracts COUNT elements from LST starting at index START, wrapping around if needed."</code></p><p><code>(let ((len (length lst)))</code></p><p><code>(loop for i from 0 below count</code></p><p><code>collect (nth (mod (+ start i) len) lst))))</code></p><p><code>(defun merge-rotated-sublists (list-a list-b counts-a counts-b starts-a starts-b)</code></p><p><code>"Merges sublists from A and B based on specific counts and starting positions with rotation."</code></p><p><code>(mapcar #'(lambda (sub-a sub-b n m s-a s-b)</code></p><p><code>(append (get-rotated-elements sub-a s-a n)</code></p><p><code>(get-rotated-elements sub-b s-b m)))</code></p><p><code>list-a list-b counts-a counts-b starts-a starts-b))</code></p><p><code>Example of Usage</code></p><p></p><p><code>(setf list-a '((1 2 3 4) (a b c) (q w e r t)))</code></p><p><code>(setf list-b '((4 5 6 7) (d e f) (a s d f g)))</code></p><p><code>(merge-rotated-sublists list-a list-b '(2 1 5) '(1 5 3) '(0 2 2) '(0 0 1))</code></p><p><code>;; Result: ((1 2 4) (c d e f d e) (e r t q w s d f))</code></p><p><code>(merge-rotated-sublists list-a list-b '(2 7 1) '(4 3 7) '(0 0 0) '(1 1 0))</code></p><p><code>;((1 2 5 6 7 4) (a b c a b c a e f d) (q a s d f g a s))</code></p>]]></description><guid isPermaLink="false">4082</guid><pubDate>Fri, 20 Mar 2026 18:20:09 +0000</pubDate></item><item><title>remove successive repeated dynamics and attributes</title><link>https://opusmodus.com/forums/topic/4080-remove-successive-repeated-dynamics-and-attributes/</link><description><![CDATA[<p>Does anyone has an idea how to get rid of all successive repeated dynamics and attributes?</p><p>Thanks a lot, Achim</p><p></p><p><code>((-w) (-w) (w cs6 &lt;mp&gt; -14c) (w c6 &lt;mp&gt; -31c) (w c6 &lt;mp&gt; -31c) (w c6 &lt;mp&gt; -31c) (w c6 &lt;mp&gt; -31c) (w c6 &lt;mp&gt; -31c) (w cs6 &lt;mp&gt; -49c) (w cs6 &lt;mp&gt; -49c) (w cs6 &lt;mp&gt; -49c) (w cs6 &lt;mp&gt; -49c) (w cs6 &lt;mp&gt; 5c) (w cs6 &lt;mp&gt; 5c) (w cs6 &lt;mp&gt; 5c) (w c6 &lt;mp&gt;) (w c6 &lt;mp&gt; 2c) (w c6 &lt;mp&gt; 2c) (w c6 &lt;mp&gt; 2c) (w c6 &lt;mp&gt; 2c) (w c6 &lt;mp&gt; 5c) (w c6 &lt;mp&gt; 5c) (w c6 &lt;mp&gt; 5c) (w a5 &lt;mp&gt; -31c) (w a5 &lt;mp&gt; -31c) (w a5 &lt;mp&gt; -31c) (w gs5 &lt;mp&gt; -14c))</code></p>]]></description><guid isPermaLink="false">4080</guid><pubDate>Tue, 17 Mar 2026 18:46:18 +0000</pubDate></item><item><title>harmonics function</title><link>https://opusmodus.com/forums/topic/4069-harmonics-function/</link><description><![CDATA[<p>Using this expression</p><p><code>(harmonics 'a2 8 :quantize nil :type :hertz)</code></p><p>I am getting</p><p><code>(110.0 220.0 329.62756 440.0 546.4174 659.2551 772.751 880.0)</code></p><p>but I am expecting</p><p><code>(110.0 220.0 330.0 440.0 550.0 660.0 770.0 880.0)</code></p><p>What am I understanding wrong?</p><p>Best, Achim</p>]]></description><guid isPermaLink="false">4069</guid><pubDate>Fri, 27 Feb 2026 12:59:05 +0000</pubDate></item><item><title>def-score :tempo keyword</title><link>https://opusmodus.com/forums/topic/4074-def-score-tempo-keyword/</link><description><![CDATA[<p>Are there any examples about how to apply the different features in the :tempo keyword in def-score?</p><p>Achim</p>]]></description><guid isPermaLink="false">4074</guid><pubDate>Sat, 07 Mar 2026 14:03:55 +0000</pubDate></item><item><title>N-Tonic-Library Creator</title><link>https://opusmodus.com/forums/topic/4060-n-tonic-library-creator/</link><description><![CDATA[<p>Hi alltogether, with this post, I want to share with you my Math-N-Tonic-Library creators. They use 2 different naming shemes and are compiled in two lisp files. </p><p>They have been algorithmically created in order to collect all the mathematically possible tonalities:</p><p></p><p>;; Complete Summary</p><p>;; ==============================================================</p><p>;; Ditonic‑note scales: 66</p><p>;; Tritonic‑note scales: 220</p><p>;; Tetratonic‑note scales: 495</p><p>;; Pentatonic‑note scales: 792</p><p>;; Hexatonic‑note scales: 924</p><p>;; Heptatonic‑note scales: 792</p><p>;; Octatonic‑note scales: 495</p><p>;; Nonatonic‑note scales: 220</p><p>;; Decatonic‑note scales: 66</p><p>;; Undecatonic‑note scales: 12</p><p>;; Total mathematical tonalities: 4082</p><p></p><p>Once executed, the tonalities are available in Opusmodus. Place the chosen (or both) lisp file(s) into your Extensions Folder.</p><p></p><p>Here are the starts of the two files:</p><p></p><p>(in-package :Opusmodus)</p><p>;;; ==============================================================</p><p>;;; Math‑Tonalities — Complete Output</p><p>;;; ==============================================================</p><p>;; ditonic‑note tonalities (66 total)</p><p>;; ---------------------------------------------------------------</p><p>;; Group 01 (starting on 0)</p><p>;; ----------------------------------------------</p><p>(create-tonality math-ditonic-01-001 '(0 1))</p><p>(create-tonality math-ditonic-01-002 '(0 2))</p><p>(create-tonality math-ditonic-01-003 '(0 3))</p><p>(create-tonality math-ditonic-01-004 '(0 4))</p><p>(create-tonality math-ditonic-01-005 '(0 5))</p><p>(create-tonality math-ditonic-01-006 '(0 6))</p><p>(create-tonality math-ditonic-01-007 '(0 7))</p><p>(create-tonality math-ditonic-01-008 '(0 8))</p><p>(create-tonality math-ditonic-01-009 '(0 9))</p><p>(create-tonality math-ditonic-01-010 '(0 10))</p><p>(create-tonality math-ditonic-01-011 '(0 11))</p><p>;; Group 02 (starting on 1)</p><p>;; ----------------------------------------------</p><p>(create-tonality math-ditonic-02-001 '(1 2))</p><p>(create-tonality math-ditonic-02-002 '(1 3))</p><p>(create-tonality math-ditonic-02-003 '(1 4))</p><p>(create-tonality math-ditonic-02-004 '(1 5))</p><p>(create-tonality math-ditonic-02-005 '(1 6))</p><p>......</p><p></p><p>(in-package :Opusmodus)</p><p>;;; ==============================================================</p><p>;;; Math‑Tonalities — Complete Output</p><p>;;; ==============================================================</p><p>;; Ditonic‑note tonalities (66 total)</p><p>;; ---------------------------------------------------------------</p><p>;; Group 01 (starting on 0)</p><p>;; ----------------------------------------------</p><p>(create-tonality math-02-tonic-01-001 '(0 1))</p><p>(create-tonality math-02-tonic-01-002 '(0 2))</p><p>(create-tonality math-02-tonic-01-003 '(0 3))</p><p>(create-tonality math-02-tonic-01-004 '(0 4))</p><p>(create-tonality math-02-tonic-01-005 '(0 5))</p><p>(create-tonality math-02-tonic-01-006 '(0 6))</p><p>(create-tonality math-02-tonic-01-007 '(0 7))</p><p>(create-tonality math-02-tonic-01-008 '(0 8))</p><p>(create-tonality math-02-tonic-01-009 '(0 9))</p><p>(create-tonality math-02-tonic-01-010 '(0 10))</p><p>(create-tonality math-02-tonic-01-011 '(0 11))</p><p>;; Group 02 (starting on 1)</p><p>;; ----------------------------------------------</p><p>(create-tonality math-02-tonic-02-001 '(1 2))</p><p>(create-tonality math-02-tonic-02-002 '(1 3))</p><p>(create-tonality math-02-tonic-02-003 '(1 4))</p><p>(create-tonality math-02-tonic-02-004 '(1 5))</p><p>(create-tonality math-02-tonic-02-005 '(1 6))</p><p>......<a class="ipsAttachLink" data-fileid="4354" href="https://opusmodus.com/forums/applications/core/interface/file/attachment.php?id=4354&amp;key=c4cbbb1bb2109b5f94ab34e79de30f5c" data-fileext="lisp" rel="">Math-N-Tonic-Library-Creator.lisp</a></p><p>
<a class="ipsAttachLink" href="https://opusmodus.com/forums/applications/core/interface/file/attachment.php?id=4355&amp;key=abe867bfba01e3413d183dc6bcf81049" data-fileExt='lisp' data-fileid='4355' data-filekey='abe867bfba01e3413d183dc6bcf81049'>Math-Tonality-Library-Creator.lisp</a></p>]]></description><guid isPermaLink="false">4060</guid><pubDate>Wed, 18 Feb 2026 18:13:25 +0000</pubDate></item><item><title>Sample Slicing, Chopping and Breakbeats</title><link>https://opusmodus.com/forums/topic/4002-sample-slicing-chopping-and-breakbeats/</link><description><![CDATA[<p>Dear Friends,</p><p></p><p>With the audio tools in windows can we make some breakbeats, like chopping audio files, like beat slicing and starting in different parts of the audio file, like the video below (serato sample plugin), and also sync accurately with midi parts in Opusmodus ?</p><p>All the best !</p><p>Julio</p><p></p><p>SOME HISTORY</p><p></p><div class="ipsEmbeddedVideo" contenteditable="false" data-og-user_text="https://youtu.be/i4ViYJn9MhU" style="--i-media-width: 100%;"><iframe width="200" height="113" src="https://www.youtube-nocookie.com/embed/i4ViYJn9MhU?feature=oembed" frameborder="0" allow="encrypted-media; picture-in-picture; fullscreen" title="Chopping up The Amen Break in Serato Studio #seratostudio" loading="lazy"></iframe></div><p></p><div class="ipsEmbeddedVideo" contenteditable="false" data-og-user_text="https://youtu.be/eJf9Jptq7VY" style="--i-media-width: 100%;"><iframe width="200" height="113" src="https://www.youtube-nocookie.com/embed/eJf9Jptq7VY?feature=oembed" frameborder="0" allow="encrypted-media; picture-in-picture; fullscreen" title="Breakbeat Deconstruction: From hip hop to drum &amp; bass and beyond | Loop" loading="lazy"></iframe></div><p></p><p>Here are some breakbeats (amen sample)</p><div class="ipsEmbeddedVideo" contenteditable="false" data-og-user_text="https://youtu.be/izc8xtNR7LU" style="--i-media-width: 100%;"><iframe width="200" height="113" src="https://www.youtube-nocookie.com/embed/izc8xtNR7LU?feature=oembed" frameborder="0" allow="encrypted-media; picture-in-picture; fullscreen" title="Amen Break Samples (174 bpm)" loading="lazy"></iframe></div><p></p><div class="ipsEmbeddedVideo" contenteditable="false" data-og-user_text="https://youtu.be/zqTB5XSjmzI" style="--i-media-width: 100%;"><iframe width="200" height="113" src="https://www.youtube-nocookie.com/embed/zqTB5XSjmzI?feature=oembed" frameborder="0" allow="encrypted-media; picture-in-picture; fullscreen" title="10 MOST ICONIC AMEN PATTERNS IN JUNGLE HISTORY!! | HOW TO CHOP BREAKS" loading="lazy"></iframe></div><p></p><p>If possible, would be great to includ a sample of the amen beat inside the documentation with an example of breakbeat.</p><p>This function can also serve to launch samples of any nature for electroacoustic or mixed music.</p>]]></description><guid isPermaLink="false">4002</guid><pubDate>Sun, 23 Nov 2025 21:05:09 +0000</pubDate></item><item><title>Display Issues with Quintuplets and Septuplets with Rests in OMN</title><link>https://opusmodus.com/forums/topic/4053-display-issues-with-quintuplets-and-septuplets-with-rests-in-omn/</link><description><![CDATA[<p>Hi,<br><br>I have a valid rhythmic notation (quarter notes, eighth notes, triplets, etc.) where only quintuplets and septuplets display incorrectly as soon as rests are included in the group (-5q, -7q).<br>Triplets don't cause any problems, but for 5 and 7, the grouping breaks (incorrect braces), as if the engine is closing/reopening the tuplets.<br><br>Is this a known limitation of how rests are handled within odd-numbered tuplets (5, 7) in OMN, or is there a strict rule to follow to avoid this behavior?</p><p></p><p>Thank you for your help.</p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4332" src="https://opusmodus.com/forums/uploads/monthly_2026_02/image.png.cc0ceb6b45e98a9229993aa26273bcbd.png" alt="image.png" title="" width="1312" height="118" loading="lazy"></p><p></p><p>(setf accent   '((q -q -q ) </p><p>                 (e -e -e e -e -e)</p><p>                 (3q -3q -3q 3q -3q -3q 3q -3q -3q)</p><p>                 (s -s -s s -s -s s -s -s s -s -s) </p><p>                 (5q -5q -5q 5q -5q -5q 5q -5q -5q 5q -5q -5q 5q -5q -5q)  </p><p>                 (6q -6q -6q 6q -6q -6q 6q -6q -6q 6q -6q -6q 6q -6q -6q 6q -6q -6q)</p><p>                 (7q -7q -7q 7q -7q -7q 7q -7q -7q 7q -7q -7q 7q -7q -7q 7q -7q -7q 7q -7q -7q)</p><p>                 (8q -8q -8q 8q -8q -8q 8q -8q -8q 8q -8q -8q 8q -8q -8q 8q -8q -8q 8q -8q -8q 8q -8q -8q) </p><p>                 (8q -8q -8q 8q -8q -8q 8q -8q -8q 8q -8q -8q 8q -8q -8q 8q -8q -8q 8q -8q -8q 8q -8q -8q) </p><p>                 (7q -7q -7q 7q -7q -7q 7q -7q -7q 7q -7q -7q 7q -7q -7q 7q -7q -7q 7q -7q -7q)</p><p>                 (6q -6q -6q 6q -6q -6q 6q -6q -6q 6q -6q -6q 6q -6q -6q 6q -6q -6q)</p><p>                 (5q -5q -5q 5q -5q -5q 5q -5q -5q 5q -5q -5q 5q -5q -5q) </p><p>                 (s -s -s s -s -s s -s -s s -s -s) </p><p>                 (3q -3q -3q 3q -3q -3q 3q -3q -3q)</p><p>                 (e -e -e e -e -e)</p><p>                 (q -q -q)))</p><p></p><p>(setf pitacc '(e4   ;(1 notes)</p><p>            e4 fs4  ;(2 notes)</p><p>            e4 fs4 g4  ;(3 notes)</p><p>            e4 fs4 g4 fs4  ;( 4 notes)</p><p>            e4 fs4 g4 fs4 g4  ;(5 notes)</p><p>            e4 fs4 g4 fs4 g4 a4  ;(6 notes)</p><p>            e4 fs4 g4 fs4 g4 a4 g4  ;(7 notes)</p><p>            e4 fs4 g4 fs4 g4 a4 g4 a4  ;(8 notes)</p><p>            e4 fs4 g4 fs4 g4 a4 g4 a4  ;(8 notes)</p><p>            e4 fs4 g4 fs4 g4 a4 g4  ;(7 notes)</p><p>            e4 fs4 g4 fs4 g4 a4  ;(6 notes)</p><p>            e4 fs4 g4 fs4 g4  ;(5 notes)</p><p>            e4 fs4 g4 fs4  ;( 4 notes)</p><p>            e4 fs4 g4  ;(3 notes)</p><p>            e4 fs4  ;(2 notes)</p><p>            e4  ;(1 notes)</p><p>                ))</p><p>(setf exo3acc (omn-to-time-signature (make-omn</p><p>             :length accent</p><p>             :pitch pitacc)</p><p>             '(3 4)))</p><p></p><p>same with def-score </p><p><img src="https://opusmodus.com/forums/uploads/monthly_2026_02/image.png.cc0ceb6b45e98a9229993aa26273bcbd.png" class="ipsRichText__align--block" width="1312" height="118" alt="image.png.cc0ceb6b45e98a9229993aa26273bcbd.png" data-fileid="4332" loading="lazy"></p><p></p><p></p><p>(def-score kona-score</p><p>  (:title "kona"</p><p>   :key-signature 'atonal</p><p>   :time-signature '(3 4)</p><p>   :tempo 50)</p><p>  (instrument</p><p>   :omn exo3acc</p><p>   :channel 1</p><p>   :sound 'gm</p><p>   :program 'acoustic-grand-piano))</p><p></p>]]></description><guid isPermaLink="false">4053</guid><pubDate>Mon, 09 Feb 2026 13:59:39 +0000</pubDate></item><item><title>harmonics</title><link>https://opusmodus.com/forums/topic/4055-harmonics/</link><description><![CDATA[<p>I am reading the documentation of "harmonics":<br>"The coeff keyword can be used to manipulate the pitches by adjusting the coefficients of the sine waves that correspond to each note. For example, by increasing the coefficient of the sine wave that corresponds to the fundamental frequency of a note, the pitch of that note can be raised. Similarly, by decreasing the coefficient of a higher harmonic, the pitch can be lowered. The use of coefficients in music theory is a mathematical approach to analysing and manipulating the frequency of a note."</p><p>I have following questions:</p><p>What is "the sine wave corresponding to each note"?</p><p>I cannot change the coefficient of higher harmonics since I have only one coefficient argument. What does that mean?</p><p>Where can I find the explanation of "coefficients used in music theory"?</p><p>Where can I find the "mathematical approach" explained?</p><p>Thanks for help.</p><p>Achim</p>]]></description><guid isPermaLink="false">4055</guid><pubDate>Thu, 12 Feb 2026 17:23:20 +0000</pubDate></item><item><title>Infinity series from binary numbers</title><link>https://opusmodus.com/forums/topic/4045-infinity-series-from-binary-numbers/</link><description><![CDATA[<p>You can create the infinity series from binary numbers. ones are added, zeros reverse sign.</p><p></p><p>Jesper</p><p></p><p><code>(defun inf-ser (n &amp;optional (offset 0) &amp;aux tmp)</code></p><p><code>  (loop for i to (1- n) do</code></p><p><code>          (setf tmp 0)</code></p><p><code>          (loop for bin in (decimal-to-binary i) </code></p><p><code>                do</code></p><p><code>                  (setf tmp (if (zerop bin) (- tmp) (+ tmp bin))))</code></p><p><code>        ;(format t "~B = ~D~%" i tmp)  </code></p><p><code>        collect (+ tmp offset)))</code></p><p></p><p><code>(integer-to-pitch (inf-ser 128))</code></p><p><code>(integer-to-pitch (inf-ser 128 12))</code></p><p> </p>]]></description><guid isPermaLink="false">4045</guid><pubDate>Sun, 25 Jan 2026 14:54:29 +0000</pubDate></item><item><title>Recursive Function for finding complementary set of notes in Chord/Scale relationship</title><link>https://opusmodus.com/forums/topic/2061-recursive-function-for-finding-complementary-set-of-notes-in-chordscale-relationship/</link><description><![CDATA[<p>
	Hey, people !
</p>

<p>
	 
</p>

<p>
	I´m doing a function to extract the complementary set of notes.
</p>

<p>
	For example:
</p>

<p>
	 
</p>

<p>
	1) Specify a set of notes, like a chord, Dm7
</p>

<p>
	 
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted"><span class="pln">(setf note-list '(d5 f5 a5 c6))</span></pre>

<p>
	 
</p>

<p>
	Specify a tonality, like Cmajor or D dorian (same notes)
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted"><span class="pln">(expand-tonality '(c5 major))</span></pre>

<p>
	 
</p>

<p>
	Now, I want a function that gives me all the other available notes from the mode, except the chord tones (the first set of notes).
</p>

<p>
	 
</p>

<p>
	So, this function gives me exactly what I need (for ONE tonality at a time and ONE chord at a time):
</p>

<p>
	 
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted"><span class="pln">(let ((rem (expand-tonality '(c5 major)))
      (super (ambitus '(c5 b5) note-list)))
  (loop for i in super
    do (setf rem (remove i rem))
    finally (return rem)))</span></pre>

<p>
	 
</p>

<p>
	Ok, this give me the right result, I.E., the complementary set of notes of C major in relation to Dm7
</p>

<p>
	=&gt; (e5 g5 b5)
</p>

<p>
	 
</p>

<p>
	<strong>The question is simple:</strong>
</p>

<p>
	 
</p>

<p>
	<strong>How can I do it for a list with many tonalities and many chords. How to do this recursively in nested lists, like</strong>
</p>

<p>
	 
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted"><span class="pln">(setf note-list '((d5 f5 a5 c6)(eb4 gb4 bb4 db4)(fs4 as4 cs4)))</span></pre>

<p>
	 
</p>

<p>
	to sucessive tonalities, like:
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted"><span class="pln">(expand-tonality '((c5 major) (db4 major) (gb4 major)))</span></pre>

<p>
	 
</p>

<p>
	Since this WON´T work
</p>

<p>
	 
</p>

<pre class="ipsCode prettyprint lang-html prettyprinted"><span class="pln">(let ((rem (ambitus '(c5 b5) (expand-tonality '((c5 major) (db5 major) (gb5 major)))))
      (super (ambitus '(c5 b5) '((d5 f5 a5 c6)(eb4 gb4 bb4 db4)(fs4 as4 cs4)))))
  (loop for i in super
    do (setf rem (remove i rem))
    finally (return rem)))</span></pre>

<p>
	 
</p>

<p>
	The expected result, if the above worked would be:
</p>

<p>
	 
</p>

<p>
	 ((e5 g5 b5)  (f5 ab5 c5) (gs4 cb5 ds5))
</p>

<p>
	 
</p>

<p>
	Thanks in advance !!
</p>

<p>
	 
</p>

<p>
	Best !
</p>

<p>
	Julio
</p>
]]></description><guid isPermaLink="false">2061</guid><pubDate>Sat, 19 Jun 2021 23:52:27 +0000</pubDate></item><item><title>Idea for a function  "motive-subdivision" or "motif-subdivision"</title><link>https://opusmodus.com/forums/topic/4040-idea-for-a-function-motive-subdivision-or-motif-subdivision/</link><description><![CDATA[<p>Dear All,</p><p></p><p>Here is a proto-function idea... If Janusz or someone are interested in transform it in a core function, I think it could be interesting...</p><p></p><p>Sometimes I like to take a motive or chorale texture and use it to make a kind of accompaniment or texture ala Reich.</p><p>I created my way to do it, but it could be perfected in a better function and integrated in the core system.</p><p></p><p>Here is the idea:</p><p></p><p><code>;; Motive</code></p><p><code>(setf mat '(h c4 q. d4 e e4 -q w c4 h d4 q e4 -q))</code></p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4313" src="https://opusmodus.com/forums/uploads/monthly_2026_01/image.png.53aa06bae1d1f2842317e1cc96d47e63.png" alt="image.png" title="image.png" width="447" height="88" loading="lazy"></p><p></p><p>;; small value</p><p></p><p><code>(setf fig-value '(e))</code></p><p></p><p>The "proto-function". What I could not achieve was how to make it respect the rests in the motive, but it works for generating the texture, respecting the pitch and length boundaries of the motive.</p><p></p><p><code>(flatten (make-omn</code></p><p><code>:pitch (omn :pitch (omn-to-time-signature mat (get-time-signature (omn-to-measure (length-legato mat) (flatten (length-legato (omn :length mat)))))))</code></p><p><code>:length (omn-to-time-signature</code></p><p><code>(length-span (get-span mat)</code></p><p><code>(gen-repeat 200 fig-value))</code></p><p><code>(get-time-signature (omn-to-measure (length-legato mat) (flatten (length-legato (omn :length mat))))))</code></p><p><code>))</code></p><p></p><p>RESULT</p><p></p><p><code>(e c4 mf c4 c4 c4 e d4 mf d4 d4 e e4 mf e4 e4 e c4 mf c4 c4 c4 c4 c4 c4 c4 e d4 mf d4 d4 d4 e e4 mf e4 e4 e4)</code></p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4314" src="https://opusmodus.com/forums/uploads/monthly_2026_01/image.png.dd663a12f74a7b10af99e8322621f636.png" alt="image.png" title="image.png" width="653" height="120" loading="lazy"></p><p></p><p>It could be perfected to result this:</p><p></p><p>(e c4 mf c4 c4 c4 d4 d4 d4 e4 -q e c4 c4 c4 c4 c4 c4 e c4 c4 d4 mf d4 d4 d4 e4 e4 -q)</p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4315" src="https://opusmodus.com/forums/uploads/monthly_2026_01/image.png.63d7de88b1c662275669b6cf62f1a15f.png" alt="image.png" title="image.png" width="659" height="105" loading="lazy"></p><p></p><p>Same texture with the fig-value set do 16th note</p><p></p><p><code>(setf fig-value '(s))</code></p><p></p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4316" src="https://opusmodus.com/forums/uploads/monthly_2026_01/image.png.b593f45461b46e9e038416235f5c34a2.png" alt="image.png" title="image.png" width="1073" height="110" loading="lazy"></p><p></p><p>Best wishes,</p><p>Julio</p>]]></description><guid isPermaLink="false">4040</guid><pubDate>Wed, 14 Jan 2026 15:15:20 +0000</pubDate></item><item><title>Missing Documentation</title><link>https://opusmodus.com/forums/topic/4032-missing-documentation/</link><description><![CDATA[<p>Hello,</p><p></p><p>I found a function that is missing documentation: <strong>2d-matrix-&gt;linearized-upper-trangular</strong>.  Would you mind explaining this briefly?  I hope to see the documentation added to the next update. </p><p>Thanks!</p>]]></description><guid isPermaLink="false">4032</guid><pubDate>Mon, 05 Jan 2026 20:38:25 +0000</pubDate></item><item><title><![CDATA[Jazz Shell Voicings Type A & B in OM]]></title><link>https://opusmodus.com/forums/topic/4031-jazz-shell-voicings-type-a-b-in-om/</link><description><![CDATA[<p>As hobbyist I am trying to learn how Jazz works and then explore what I have learned using OM for composition.</p><p>For the composers and musicians among you following might seem trivial, so this post is probably only relevant for beginners like me (except for the question at the end of the post)</p><p>But for me it's all new and exploring and discovering new concepts is fascinating.</p><p>OM helps me a lot as learning tool to conceptualize and reuse in a principled, reproducible manner.</p><p></p><p>In Jazz for piano comping, the use of rootless shell-voicings is common as far as I have learned.</p><p></p><p>I have learned in a text book (Jeremy Siskind, Jazz Band Pianist), that typically for chord comping</p><ul><li><p>the bass pitch is removed as it's already covered by the bass player, see a question on that to community at the end of this post.</p></li></ul><ul><li><p>the left hand plays the "essential tones" of the chord, which are 3rd and 7th</p></li><li><p>the right hand plays the "color tones" of the chord, which are the 5th and 9th.</p></li></ul><p></p><p>I have learned that there 2 types of voicings</p><ul><li><p>Type A: left-hand: 3rd below 7th; right-hand: 9th below 5th</p></li><li><p>Type B is flipped version, so left-hand: 7th below 3rd; right-hand: 5th below 9th.</p></li></ul><p></p><p>Here's a screenshot of the book were both voicings are demonstrated for 3 chords.</p><p>Now I have tried to reproduce this with OM and want to share my findings in this post.</p><p></p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4293" src="https://opusmodus.com/forums/uploads/monthly_2026_01/JazzBandPianist-BasicSkillsfortheJazzBandPianist.jpeg.d737eb2b198090d40a4bf7f3cbfabf03.jpeg" alt="Jazz Band Pianist - Basic Skills for the Jazz Band Pianist.jpeg" title="Jazz Band Pianist - Basic Skills for the Jazz Band Pianist.jpeg" width="1832" height="1370" loading="lazy"></p><p></p><p>Turns out, that</p><ul><li><p>Type A: is accomplished with <code>drop-voicing :type '(2) :leading '(l)</code></p></li><li><p>Type B: is accomplished with <code>drop-voicing :type '(2) :leading '(h)</code></p></li><li><p>and in both cases then splitting the chord to both hands with <code>(split-chord 13 &lt;&gt; :lower-size 2 :upper-size 2)</code></p></li></ul><p></p><p>Here's the code to reproduce the text book example:</p><pre spellcheck="" class="ipsCode language-ini" data-language="ini"><code>(asdf:load-system :arrows)


(setf chord '((w (e3 m9))   ; e3g3b3d4fs4
              (w (d3 9))    ; d3fs3a3c4e4
              (w (bb2 maj9)); bb2d3f3a3c4
              ))

; Type A voicing
(setf chord-voiced-a
      (arrows:-&lt;&gt;
       ; remove bass from 5 note chord
       (loop for n in (reverse '(1 2 3 4))
        collect (pitch-demix n chord))
       (matrix-transpose)
       (mapcar 'pitch-mix &lt;&gt;)
       ; restore original length
       (omn-replace :length (omn :length chord) &lt;&gt;)
       ; voice-leading type a
       (drop-voicing :type '(2) :leading '(l))
       ; distribute to both hands
       (split-chord 13 &lt;&gt; :lower-size 2 :upper-size 2)
       ))


; Type B voicing
(setf chord-voiced-b
      (arrows:-&lt;&gt;
       ; remove bass from 5 note chord
       (loop for n in (reverse '(1 2 3 4))
        collect (pitch-demix n chord))
       (matrix-transpose)
       (mapcar 'pitch-mix &lt;&gt;)
       ; restore original length
       (omn-replace :length (omn :length chord) &lt;&gt;)
       ; voice-leading type a
       (drop-voicing :type '(2) :leading '(h))
       ; distribute to both hands
       (split-chord 13 &lt;&gt; :lower-size 2 :upper-size 2)
       ))

(setf rh-a (assemble-voices 1 chord-voiced-a))
(setf lh-a (assemble-voices 2 chord-voiced-a))
(setf rh-b (assemble-voices 1 chord-voiced-b))
(setf lh-b (assemble-voices 2 chord-voiced-b))

(ps 'gm 
    :title "Type A"
    :p (list rh-a lh-a))

(ps 'gm 
    :title "Type B"
    :p (list rh-b lh-b))

</code></pre><p></p><p>Result:</p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4294" src="https://opusmodus.com/forums/uploads/monthly_2026_01/Bildschirmfoto2026-01-04um11_01_21.png.cbafa0b2782615645036cd6c9d8b3914.png" alt="Bildschirmfoto 2026-01-04 um 11.01.21.png" title="Bildschirmfoto 2026-01-04 um 11.01.21.png" width="560" height="344" loading="lazy"></p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4295" src="https://opusmodus.com/forums/uploads/monthly_2026_01/Bildschirmfoto2026-01-04um11_02_08.png.33e8e6432376c98c93da28609a69655b.png" alt="Bildschirmfoto 2026-01-04 um 11.02.08.png" title="Bildschirmfoto 2026-01-04 um 11.02.08.png" width="550" height="352" loading="lazy"></p><p></p><p><strong>Question to community:</strong></p><p>Are there smarter ways to remove the root pitch in a omn-notation chord-sequence like the one I defined in variable <code>chord</code> (which just drops the lowest pitch while retaining the other omn parameters like length from original) ?</p><p></p><p>Thanks for any hints.</p><p></p><p></p>]]></description><guid isPermaLink="false">4031</guid><pubDate>Sun, 04 Jan 2026 10:08:48 +0000</pubDate></item><item><title>List Generation and Randomization</title><link>https://opusmodus.com/forums/topic/4023-list-generation-and-randomization/</link><description><![CDATA[<p>Hi All,</p><p></p><p>I am taking my first steps into Opus Modus, and it is a big change from using Open Music. I'm trying not to miss the visual environment, which has always worked better for my brain, but there are definitely growing pains along the way.</p><p></p><p>I am trying to complete a fairly simple task, but I just cannot figure out which functions allow me to do so. I want to complete the following;</p><p></p><ul><li><p>Create a list <em>B</em> of length <em>n </em>and fill that list with elements randomly selected from list <em>A</em>.</p><p></p><p>If list A contains ((1 2) (3 4) (5 6) (7 8) (9 0))</p><p>And list B is length 2;</p><p>We should be able to generate list <em>B </em>that contains two selections of those tuples now in their own list</p><ul><li><p>Ex; A = ((3 4) (9 0))</p></li></ul></li></ul><p></p><p>I am attempting to create a sublist that selects from a pool of PC-sets, which I will then further modify. I plan to split each selected chord into two groups using gen-divide, which I have successfully implemented on a hardcoded set of chords.</p><p></p><p>I have drafted the following. However, substitute-map does not behave how I expected it to.</p><p></p><p><code>(setf set_1 '(0 1 3 5 7))</code></p><p><code>(setf permutes (permute set_1))</code></p><p><code>(substitute-map 'permutes '(0 1 2 3) (rndn 5 1 (length permutes)))</code></p><p></p><p>Additionally, I have found gen-loop, which does almost exactly what I want. However, as it loops the random selection, there is the possibility for it to select the same choice twice. Is there a way to avoid this? That is why, rather than looping a random selector, I wanted to just pick a set amount from my established list.</p><p></p><p><code>(gen-loop 5</code></p><p><code>          (rnd-pick permutes)</code></p><p><code>)</code></p><p><code>=&gt; ((7 5 3 1 0) (7 5 1 0 3) (1 5 0 3 7) (7 5 1 0 3) (0 5 7 1 3))</code></p><p></p><p>Thanks in advance!</p>]]></description><guid isPermaLink="false">4023</guid><pubDate>Fri, 26 Dec 2025 18:22:55 +0000</pubDate></item><item><title>"Voice-leading" monophonic lines</title><link>https://opusmodus.com/forums/topic/4016-voice-leading-monophonic-lines/</link><description><![CDATA[<p>I just want to share a AHA-moment and nothing more than my admiration for OM...</p><p></p><p>The function <code>closest-path</code> is documented to voice-lead chords, which already in my view is a great use-case.</p><p></p><p>But do you know that it also helps to get a cohesive monophonic line from otherwise pretty scattered pitch collection as its often the result of a stochastic generation processes ?</p><p></p><p>Most of you will know this already, having a musician background and it might feel trivial (the mere name voice-leading already indicates it).</p><p>So I am writing this more to share my surprise and learning for those coming rather from „outside“.</p><p></p><p>I was so nudged by the docu which covers chords, so that I did not recognize that its highly generalizing.</p><p></p><p>Example:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>;; Random noise
(setf vector (gen-noise 32 :seed 42))

;; Map to 3 Octaves
,; OK I am making this up, its just an example, 
;; showing what one can expect for stochastic material.

(setf pitch-mat (vector-to-pitch '(c3 c6) vector))
(pitch-list-plot pitch-mat)</code></pre><p><img class="ipsImage ipsRichText__align--block" data-fileid="4265" src="https://opusmodus.com/forums/uploads/monthly_2025_12/Bildschirmfoto2025-12-19um22_24_39.png.040514d109f79f7e4e619279272b5749.png" alt="Bildschirmfoto 2025-12-19 um 22.24.39.png" title="Bildschirmfoto 2025-12-19 um 22.24.39.png" width="1346" height="704" loading="lazy"></p><p></p><p>With <code>closest-path</code> :</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>;; Voice leading also for melodies :-)
(setf pitch-mat-vl (closest-path pitch-mat))
(pitch-list-plot pitch-mat-vl)
</code></pre><p><img class="ipsImage ipsRichText__align--block" data-fileid="4266" src="https://opusmodus.com/forums/uploads/monthly_2025_12/Bildschirmfoto2025-12-19um22_26_07.png.49d41296b048eca7b415153e24f2c707.png" alt="Bildschirmfoto 2025-12-19 um 22.26.07.png" title="Bildschirmfoto 2025-12-19 um 22.26.07.png" width="1344" height="694" loading="lazy"></p>]]></description><guid isPermaLink="false">4016</guid><pubDate>Fri, 19 Dec 2025 21:30:03 +0000</pubDate></item><item><title>gen-binary-solo</title><link>https://opusmodus.com/forums/topic/4006-gen-binary-solo/</link><description><![CDATA[<p>As far as I have read OMs excellent documentation, there's no function which</p><ul><li><p>helps to prepare a binary-list for driving a do-timeline to play/pause solo-instruments with occasional multiplay,</p></li><li><p>where a couple of constraints like probability and max multplay can be defined</p></li><li><p>and one of many possible solutions is returned.</p></li></ul><p></p><p>I tried with help of chat-gpt to code to do this.</p><p>Although tests look plausible I believe this is not a well coded function (robustness, edge cases, seed handling, etc).</p><p></p><p>Any thoughts ?</p><p></p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>;;;
;;; n solo-instruments play in a band for l periods
;;; the ratio of multiplay is defined by r
;;; max-n instruments can play together
;;;
;;; Function which supports definition
;;; of binary list which can be passed to do-timeline
;;;


(defun gen-binary-solo (n l r max-n)
  "Generate a n binary sublists for n instruments.
   Each sublist has length l.
   Ratio r defines probaility for multiplay.
   Number max-n defined maximun allowed number 
   of instruments playing together."
  ;; validations
  (unless (and (integerp n) (&gt;= n 1) (&lt;= n 4))
    (error "n must be an integer between 1 and 4 inclusive"))
  (unless (and (integerp l) (&gt; l 0))
    (error "l must be a positive integer"))
  (unless (and (numberp r) (&gt;= r 0.0) (&lt;= r 1.0))
    (error "r must be a number between 0 and 1"))
  (unless (and (integerp max-n) (&gt;= max-n 1) (&lt;= max-n n))
    (error "max-n must be integer between 1 and n"))

  (let* ((max-k (min max-n n))
         (multi-count (if (&lt; max-k 2) 0 (round (* r l))))
         ;; indices 0..l-1
         (indices (loop for i from 0 below l collect i))
         ;; choose exactly multi-count distinct positions (partial Fisher-Yates)
         (multi-positions
          (let ((vec (coerce indices 'vector)))
            (loop for i from 0 below multi-count do
                  (rotatef (aref vec i)
                           (aref vec (+ i (random (- l i))))))
            (loop for i below multi-count collect (aref vec i))))
         (multi-hash (let ((h (make-hash-table :test 'eql)))
                       (dolist (pos multi-positions) (setf (gethash pos h) t))
                       h))
         ;; rows as arrays for efficient setting
         (rows (loop repeat n collect (make-array l :initial-element 0)))
         (min-k 2))

    ;; build columns for each time index
    (loop for time-idx from 0 below l do
          (let* ((is-multi (gethash time-idx multi-hash))
                 (k (if is-multi
                        (if (&lt;= max-k min-k) min-k
                            ;; uniform integer in [2..max-k]
                            (+ min-k (random (1+ (- max-k min-k)))))
                        1))
                 ;; choose k distinct instruments (simple partial pick)
                 (available (loop for i below n collect i))
                 (chosen
                  (loop repeat k
                        for pick = (nth (random (length available)) available)
                        do (setf available (remove pick available))
                        collect pick)))
            (dolist (inst chosen)
              (setf (aref (nth inst rows) time-idx) 1))))

    ;; convert arrays back to lists and return
    (mapcar #'(lambda (arr) (coerce arr 'list)) rows)))


;; Tests

(gen-binary-solo 4 8 1 2)
=&gt; ((1 1 1 0 0 1 1 0) 
    (1 1 0 0 0 0 0 0) 
    (0 0 0 1 1 1 0 1) 
    (0 0 1 1 1 0 1 1))

(gen-binary-solo 4 8 0 1)
=&gt; ((1 0 1 0 0 0 0 0) 
    (0 1 0 1 0 0 1 1) 
    (0 0 0 0 1 0 0 0) 
    (0 0 0 0 0 1 0 0))


(gen-binary-solo 4 8 0.5 2)
=&gt; ((1 0 0 0 1 1 0 0) 
    (0 1 0 0 0 0 1 1) 
    (0 0 1 1 0 0 1 1) 
    (0 1 0 1 0 0 0 0))

(gen-binary-solo 4 8 0.7 3)
=&gt; ((1 0 0 0 1 0 1 0) 
    (1 1 1 1 1 0 1 0) 
    (0 0 0 0 0 1 1 1) 
    (1 1 1 0 0 0 0 1))

(gen-binary-solo 4 8 0.1 3)
=&gt; ((0 0 0 0 0 1 0 0) 
    (0 1 0 1 0 0 1 1) 
    (1 0 1 0 1 0 0 0) 
    (0 0 1 0 0 0 0 0))</code></pre>]]></description><guid isPermaLink="false">4006</guid><pubDate>Mon, 01 Dec 2025 16:11:07 +0000</pubDate></item><item><title>Take #3: Lydian Chromatic Concept of Tonal Organization - George Russell</title><link>https://opusmodus.com/forums/topic/3998-take-3-lydian-chromatic-concept-of-tonal-organization-george-russell/</link><description><![CDATA[<p>Followup on post: <a rel="" href="https://opusmodus.com/forums/topic/3989-om-lydian-chromatic-concept-of-tonal-organization-george-russell/"><u>https://opusmodus.com/forums/topic/3989-om-lydian-chromatic-concept-of-tonal-organization-george-russell/</u></a></p><p></p><p>According to LCCOTO chords which are derived from a parent scale have a nice property as they all lean on the same lydian parent-scale- tonic, hence may feel similar in harmonic environment.</p><p>This may be used for various compositional purposes.</p><p></p><p>Example:</p><p>A G7 -&gt; Cmaj7 cadence is in LCCOTO basically a movement of F-lydian-parent-scale-tonic to C-lydian-parent-scale-tonic.</p><p>Moving clockwise on circle of fifths with regards to parent scales tonic.</p><p>G7 is a chord on mode 2 in f-lydian.</p><p>Cmaj7 is chord on mode 1 in c-lydian.</p><p></p><p>According to LCCOTO it should be possible to exchange G7</p><p>by various other chords as long as they are derived from F-lydian parent scale or derived ones, like F-lydian augmented, etc.</p><p></p><p>For that a function I called "find-chord-in-parent-scale" may be useful.</p><p></p><p>New function</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>

;;; ---------------------------------------------------------------------------
;;;
;;; Find chord in a parent scale according to LCCOTO 
;;; for a list of chords quality symbols and a list of parent scales
;;;
;;;   Conceptual framework: 
;;;   Lydian Chromatic Concept of Tonal Organization, LCCOTO
;;;   by George Russell, 1953, Concept Publishing Company) 
;;;
;;; This function helps to get all possible chords in a parent scale
;;; given their quality, i.e. maj, m7, sus2, 7, etc.
;;; Parameter "quality" must be a list with elemens which comply to OMs 
;;; definition of chord-symbols (see docu chord-symbols.pdf).
;;;
;;; The parameters scale and quality are lists.
;;; The return value is a nested list.
;;;
;;; Version 1, 2025-11-17
;;; Author: Cliff Scherer
;;;
;;;
;;; v1: initial version
;;; 
;;; ---------------------------------------------------------------------------


(defun find-chord-in-parent-scale (scale quality)
  "Find chords in a list of parent scales and a list of chord qualities"
  
  ;; Main function for one scale
  (defun find-chord-in-parent-scale-one-scale (scale quality)
  
    ;; Main function for one chord quality
    (defun find-chord-in-parent-scale-one-chord (scale quality)
      "Find chords in one parent scale for one chord quaity"

      ;; We use the lydian parent-scale with lydian tonic c
      (setf parent-scale (flatten  scale))
      (setf parent-scale-pcs (get-pcs (expand-tonality parent-scale)))

      ;; Next we define a chord symbol
      (setf chord-symbol quality)

      ;; Prepare all possible chords for symbol and pcs of scale
      (setf chord-symbol-candidates (cartesian 
                               (list (integer-to-pitch parent-scale-pcs) 
                                     chord-symbol)))

      ;; Get their PC
      (setf chord-pc-candidates (get-pcs (expand-chord chord-symbol-candidates)))

      ;; Test for intersection
      (setf test-intersect-pc (mapcar (lambda (x) (intersection x parent-scale-pcs))
                                      chord-pc-candidates))

      ;; Test for full intersection
      (setf chord-size (length (first chord-pc-candidates)))
      (setf test-intersect-pc-complete (mapcar (lambda (x) 
                                                 (equal (length x) chord-size))
                                               test-intersect-pc))

      ;; Return chord symbols
      (setf result (remove nil
                           (loop for test in test-intersect-pc-complete
                                 for chord in chord-symbol-candidates
                                 collect (if test chord nil))))

      result

      )

    (mapcar (lambda (x) (find-chord-in-parent-scale-one-chord scale x)) quality)

    )

  (mapcar (lambda (x) (find-chord-in-parent-scale-one-scale x quality)) scale)

  )



;; Tests ---
;;

(find-chord-in-parent-scale '((c lydian)) '((maj)))
;; ((((c4 maj) (d4 maj) (g4 maj))))

;; Use of the nested list result may require use of (multiple) flatten-sublist calls
(expand-chord (flatten-sublist (find-chord-in-parent-scale '((c lydian)) '((maj)))))
;; ((c4e4g4 d4fs4a4 g4b4d5))

(find-chord-in-parent-scale '((c lydian)) '((maj)(m7)))
;; (
;;  ( -&gt; for scale
;;   ((c4 maj) (d4 maj) (g4 maj)) -&gt; for first quality
;;   ((e4 m7) (a4 m7) (b4 m7)) -&gt; for second quality
;;  )
;; )

;; Use
(expand-chord (flatten-sublist (find-chord-in-parent-scale '((c lydian)) '((maj)(m7)))))
;; ((c4e4g4 d4fs4a4 g4b4d5) (e4g4b4d5 a4c5e5g5 b4d5fs5a5))


(find-chord-in-parent-scale '((f lydian)(c lydian)) '((maj)(m7)))
;; (
;;  ( -&gt; for first scale
;;   ((f4 maj) (g4 maj) (c4 maj)) -&gt; for first quality
;;   ((a4 m7) (d4 m7) (e4 m7)) -&gt; for second quality
;;  ) 
;;  ( -&gt; for second scale
;;   ((c4 maj) (d4 maj) (g4 maj)) -&gt; for first quality
;;   ((e4 m7) (a4 m7) (b4 m7)) -&gt; for second quality
;;  )
;; )



;; Experiments to exchange G7 in V7-&gt;Cmaj7 ---

;; First the original -
(assemble-seq 
 (flatten-sublist (flatten-sublist  (find-chord-in-parent-scale '((f lydian)) '((7)))))
 '(c4 maj7))
;; ((g4 7) (c4 maj7))


;; Try m7 -
(assemble-seq 
 (first (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f lydian)) '((m7))))))
 '(c4 maj7))
;; ((a4 m7) (c4 maj7))

(assemble-seq 
 (second (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f lydian)) '((m7))))))
 '(c4 maj7))
;; ((d4 m7) (c4 maj7))

(assemble-seq 
 (third (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f lydian)) '((m7))))))
 '(c4 maj7))
;; ((e4 m7) (c4 maj7))

;; Try maj7 -
(assemble-seq 
 (first (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f lydian)) '((maj7))))))
 '(c4 maj7))
;; ((f4 maj7) (c4 maj7))

(assemble-seq 
 (second (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f lydian)) '((maj7))))))
 '(c4 maj7))
;; ((c4 maj7) (c4 maj7)) :-)

;; Try dim7 -
(assemble-seq 
 (first (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f lydian-diminished)) '((dim7))))))
 '(c4 maj7))
;; ((f4 dim7) (c4 maj7))

(assemble-seq 
 (second (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f lydian-diminished)) '((dim7))))))
 '(c4 maj7))
;; ((gs4 dim7) (c4 maj7))

;; Try 7/b5 -
(assemble-seq 
 (first (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f whole-half-tone-scale)) '((7/b5))))))
 '(c4 maj7))
;; ((g4 7/b5) (c4 maj7))

(assemble-seq 
 (second (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f whole-half-tone-scale)) '((7/b5))))))
 '(c4 maj7))
;; ((bb4 7/b5) (c4 maj7))

(assemble-seq 
 (third (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f whole-half-tone-scale)) '((7/b5))))))
 '(c4 maj7))
;; ((cs4 7/b5) (c4 maj7))


(assemble-seq 
 (fourth (flatten-sublist (flatten-sublist (find-chord-in-parent-scale '((f whole-half-tone-scale)) '((7/b5))))))
 '(c4 maj7))
;; ((e4 7/b5) (c4 maj7))


;; Stay inside similar parent scales with same tonic but vary the chord quality ---
;; See chord pregression below
(assemble-seq
 (find-chord-in-parent-scale '((f lydian)) '((maj7)(7/sus4)))
 (find-chord-in-parent-scale '((f lydian-augmented)) '((maj7)(aug)(m7)))
 (find-chord-in-parent-scale '((f lydian-diminished)) '((dim7)(aug)(m7)))
 (find-chord-in-parent-scale '((f lydian-b7)) '((m7)(7)(7/b5))))</code></pre><p></p><p><img class="ipsImage ipsRichText__align--block" data-fileid="4245" src="https://opusmodus.com/forums/uploads/monthly_2025_11/Bildschirmfoto2025-11-17um11_12_07.png.0bf7bf11456f2ae04e4a8a1cc40a5266.png" alt="Bildschirmfoto 2025-11-17 um 11.12.07.png" title="Bildschirmfoto 2025-11-17 um 11.12.07.png" width="2728" height="228" loading="lazy"></p><p></p><p><audio data-controller="core.global.core.embeddedaudio" src="https://opusmodus.com/forums/applications/core/interface/file/attachment.php?id=4247&amp;key=a06da20169fda675b9a58d9393847ae2" type="audio/mpeg" controls="" preload="metadata"><a class="ipsAttachLink" href="https://opusmodus.com/forums/applications/core/interface/file/attachment.php?id=4247&amp;key=a06da20169fda675b9a58d9393847ae2" data-fileid="4247" data-fileext="mp3" rel="">LCC3.mp3</a></audio></p>]]></description><guid isPermaLink="false">3998</guid><pubDate>Mon, 17 Nov 2025 10:35:55 +0000</pubDate></item><item><title>Take #1 - Lydian Chromatic Scale Concept of Tonal Organization - George Russell</title><link>https://opusmodus.com/forums/topic/3994-take-1-lydian-chromatic-scale-concept-of-tonal-organization-george-russell/</link><description><![CDATA[<p>Followup on post: <a rel="" href="https://opusmodus.com/forums/topic/3989-om-lydian-chromatic-concept-of-tonal-organization-george-russell/">https://opusmodus.com/forums/topic/3989-om-lydian-chromatic-concept-of-tonal-organization-george-russell/</a></p><p></p><p>Here's a first attempt (I am a LISP beginner) for a function which finds the parent scale for a list of chords.</p><p></p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>;;; ---------------------------------------------------------------------------
;;;
;;; Find a Lydian Parent Scale for a Melody over a given chord list
;;;
;;; (Lydian Chromatic Scale Concept, George Russell) 
;;;
;;;   The returned list fulfills the condition that all chord pitches
;;;   are included in the scales.
;;;
;;;   By default only the 12 lydian scales are queried.
;;;   One can supply additional scales according to Russells concept. 
;;;   In case of ambiguities the scale which lowest tonal gravity is chosen.
;;;   
;;;
;;; Version 1, 2025-11-14
;;; Author: Cliff Scherer
;;;
;;; ---------------------------------------------------------------------------

(defun find-lydian-scale (chords &amp;key (scales '(lydian)))
  
  "Find lydian parent scale for a list of chords"

  ;; Main function
  (defun find-lydian-scale-one-chord (chord scales)
    "Find lydian parent scale for one chord"

    ;; Define chord to play over
    (setf my-chord (flatten (get-pcs chord)))

    ;; Define all possibe parent scale candidates for testing
    (setf all-lydian-scales (cartesian (list '(c db d eb e f fs g gs a b bb)
                                             scales)))

    ;; Create PCS for those scales
    (setf all-lydian-pcs (get-pcs all-lydian-scales))

    ;; Create tuples for next step
    (setf test-pairs (mclist all-lydian-pcs 
                             (gen-repeat (length all-lydian-pcs) 
                                         (list my-chord))))

    ;; Query Intersection of these pairs, return PC which are common
    (setf test-intersect-pc (mapcar (lambda (x) 
                                      (intersection (first x) 
                                                    (second x)))
                                    test-pairs))


    ;; Query length of intersection; returns length
    ;; The scale with maximum overlap are good candidates
    ;; But one may further narrow down by checking which PC generates overlap
    (setf test-intersect-length (mclength test-intersect-pc))

    ;; Query which lydian principle scale has full intersetion
    ;; will be used as mask later
    (setf test-intersect-pc-complete (mapcar (lambda (x)
                                               (equal x (length my-chord)))
                                             test-intersect-length))

    ;; Create tuples for next step
    (setf test-pairs (mclist test-intersect-pc all-lydian-pcs))

    ;; Query the positions of common notes in the lydian scales
    ;; low values like 1 indicate close to total gravity
    (setf test-intersect-pos (loop for (a b) in test-pairs
                                   collect
                                     (loop for x in b
                                           for pos from 1
                                           when (member x a :test #'equal)
                                             collect pos)))

    ;; Sum the positions
    ;; low values should be preferred, provided...
    (setf test-intersect-pos-sum (mapcar (lambda (x)
                                           (sum x))
                                         test-intersect-pos))

    ;; Return the sums but only for scales which have complete intersection
    (setf test-intersect-pos-sum-masked
          (loop for m in test-intersect-pc-complete
                for n in test-intersect-pos-sum
                collect (if m n nil)))

    ;; Position of best scale
    (setf test-intersect-pos-sum-masked-pos
          (let* ((clean (remove nil test-intersect-pos-sum-masked))
                 (minval (when clean (apply #'min clean))))
            (loop for x in test-intersect-pos-sum-masked
                  for i from 0
                  when (equal x minval)
                    collect i)))

    ;; Finally prepare return value the symbolic name of the parent scale
    (setf result (mapcar (lambda (x)
                        (nth x all-lydian-scales))
                      test-intersect-pos-sum-masked-pos))

    (if (= 0 (length (remove nil test-intersect-pos-sum-masked)))
        (setf result '(nil)))

    result
       
    )

    (mapcar (lambda (x) (find-lydian-scale-one-chord x scales)) chords)
)
</code></pre><p>In the following a couple of tests:</p><p></p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>;;; ----- Tests ------

;;; Ingoing ------
;;;


(setf chord '(c3e3g3))
(find-lydian-scale chord)
;; (((c lydian)))

(setf chord '((c maj)))
(find-lydian-scale chord)
;; (((c lydian)))

(setf chord '((c maj7)))
(find-lydian-scale chord)
;; (((c lydian)))

(setf chord '((d m7)))
(find-lydian-scale chord)
;; (((f lydian)))

(setf chord '((g 7)))
(find-lydian-scale chord)
;;(((f lydian)))

(setf chords '((c maj7)(d m7)(g 7)))
(find-lydian-scale chords)
(((c lydian)) ((f lydian)) ((f lydian)))

(setf chords '((d m7/b5)))
(find-lydian-scale chords)
;; (((gs lydian)))

(setf chord '((c 6)))
(find-lydian-scale chord)
;; (((c lydian)))

(setf chord '((d dim7)))
(find-lydian-scale chord)
;; ((nil))

(setf chord '((c aug)))
(find-lydian-scale chord)
;; ((nil))


;;; Allow more scales outgoing ------
;;;

;; According to George Russell 
(setf extended-lydian-principal-scales '(lydian 
                                         lydian-augmented
                                         lydian-diminished
                                         lydian-b7))

(setf chord '((d m7)))
(find-lydian-scale chord :scales extended-lydian-principal-scales)
;; (((f lydian) (f lydian-b7)))

(setf chord '((d dim7)))
(find-lydian-scale chord :scales extended-lydian-principal-scales)
;; (((d lydian-diminished) (f lydian-diminished) (gs lydian-diminished) (b lydian-diminished)))

(setf chord '((c aug)))
(find-lydian-scale chord :scales extended-lydian-principal-scales)
;; (((c lydian-augmented) (e lydian-augmented) (gs lydian-augmented)))



;;; Allow all including outgoing ------
;;;

;; According to George Russell 
(setf all-lydian-principal-scales '(lydian 
                                    lydian-augmented
                                    lydian-diminished
                                    lydian-b7
                                    whole-tone
                                    whole-half-tone-scale
                                    half-whole-tone-scale))

(setf chord '(c3e3g3))
(find-lydian-scale chord :scales all-lydian-principal-scales)
;; (((c lydian) (c lydian-b7)))

(setf chord '((d m7)))
(find-lydian-scale chord :scales all-lydian-principal-scales)
;; (((c whole-half-tone-scale) (a whole-half-tone-scale)))

(setf chords '((d m7/b5)))
(find-lydian-scale chords :scales all-lydian-principal-scales)
;; (((c whole-half-tone-scale)))

(setf chords '((d dim7)))
(find-lydian-scale chords :scales all-lydian-principal-scales)
;; (((d lydian-diminished) (f lydian-diminished) (gs lydian-diminished) (b lydian-diminished)))

</code></pre><h2>Musical examples:</h2><p></p><h3>LCC1-A:</h3><p><img class="ipsImage ipsRichText__align--block" data-fileid="4229" src="https://opusmodus.com/forums/uploads/monthly_2025_11/LCC1-A.png.9a15612993a607c512be938af015de9d.png" alt="LCC1-A.png" title="LCC1-A.png" width="2858" height="536" loading="lazy"></p><p></p><h3>LCC1-B:</h3><h3><img class="ipsImage ipsRichText__align--block" data-fileid="4230" src="https://opusmodus.com/forums/uploads/monthly_2025_11/LCC1-B.png.190481ec8f89dfb3d2381e059bc7a13c.png" alt="LCC1-B.png" title="LCC1-B.png" width="2820" height="528" loading="lazy"></h3><h3>LCC1-C:<img class="ipsImage ipsRichText__align--block" data-fileid="4232" src="https://opusmodus.com/forums/uploads/monthly_2025_11/LCC1-C.png.f23a0d612c1d8b6f6b74ed16720e7042.png" alt="LCC1-C.png" title="LCC1-C.png" width="2790" height="526" loading="lazy"></h3><h3>LCC1-D:</h3><p><img class="ipsImage ipsRichText__align--block" data-fileid="4233" src="https://opusmodus.com/forums/uploads/monthly_2025_11/LCC1-D.png.526f2673c828b89de6e54fc518b862e7.png" alt="LCC1-D.png" title="LCC1-D.png" width="2346" height="526" loading="lazy"></p><p><a class="ipsAttachLink" data-fileid="4235" data-fileext="aif" data-extension="aif" href="https://opusmodus.com/forums/applications/core/interface/file/attachment.php?id=4235&amp;key=a5ab5053a7621ff66575dea858acb56f" rel="">LCC1-A.aif</a><a class="ipsAttachLink" data-fileid="4236" data-fileext="aif" data-extension="aif" href="https://opusmodus.com/forums/applications/core/interface/file/attachment.php?id=4236&amp;key=e7c52ca02a7a6f2fa5add2f7b504c5b2" rel="">LCC1-B.aif</a><a class="ipsAttachLink" data-fileid="4237" data-fileext="aif" data-extension="aif" href="https://opusmodus.com/forums/applications/core/interface/file/attachment.php?id=4237&amp;key=77b4cede28e6b645915aab96f26c2af9" rel="">LCC1-C.aif</a><a class="ipsAttachLink" data-fileid="4238" data-fileext="aif" data-extension="aif" href="https://opusmodus.com/forums/applications/core/interface/file/attachment.php?id=4238&amp;key=aeffce6bad4156ec52a912aa60496f8b" rel="">LCC1-D.aif</a></p><p></p><h3>Details:</h3><p></p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>;;;
;;; LCC1-A
;;;
;;; Basic only Lydian as parent scale candidate
;;;

;; Prepare some melody
(setf melody-pitch-mat (vector-to-pitch
                        '(c5 e6)
                        (vector-smooth 0.5 (gen-noise 64 :seed 41))))

(setf melody-omn (make-omn
                  :pitch melody-pitch-mat
                  :length (rhythm-series 4 9 4/4 :length '(q e) :seed 22807)
                  :velocity (gen-loop 4 (rnd-sample 4 '(mp mf p f)) :seed 41
                                      )))

;; ii-V-I Chordprogression
;;
(setf chords-omn '(w (a m7) mf
                   w (d m7)
                   w (g 7)
                   w (c maj7)))
(setf chords (omn :pitch chords-omn))
(setf chords-omn-mod (density 0.1 chords-omn :seed 40540))
(setf bass (density 0.18 (pitch-transpose -24 
                            (dechord chords-omn))
                    :seed 41))

;; Find Parent scales
(setf lydian-principal-scales (find-lydian-scale chords))
;; (((c lydian)) ((f lydian)) ((f lydian)) ((c lydian)))

;; Commit to one scale per chord in case on multiple options
(setf lydian-principal-scales-picked (rnd-pick lydian-principal-scales 
                                               :type 'list))
;; ((c lydian) (f lydian) (f lydian) (c lydian))

;; Apply scales tonality to melody
(setf t-map (tonality-series lydian-principal-scales-picked
                             :map 'octave))
(setf melody-t-mapped (filter-tie (tonality-map t-map  melody-omn)))

;; Preview
(ps 'gm
    :tempo 90
    :p (list melody-t-mapped (closest-path chords-omn-mod))
    :bass (list bass))
</code></pre><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>
;;;
;;; LCC1-B
;;;
;;; Bit more Outgoing
;;;

;; Find Parent scales
(setf lydian-principal-scales (find-lydian-scale chords
                                                 :scales '(lydian
                                                           lydian-augmented
                                                           lydian-diminished
                                                           lydian-b7
                                                           whole-tone
                                                           )))
;; (((c lydian) (c lydian-b7)) 
;; ((f lydian) (f lydian-b7)) 
;; ((f lydian) (f lydian-augmented) (f lydian-diminished) (f lydian-b7)) 
;; ((c lydian)))


;; Commit to one scale per chord in case on multiple options
(setf lydian-principal-scales-picked (rnd-pick lydian-principal-scales 
                                               :type 'list :seed 229792))
;; ((c lydian-b7) (f lydian) (f lydian-b7) (c lydian))

;; Apply scales tonality to melody
(setf t-map (tonality-series lydian-principal-scales-picked
                             :map 'octave))
(setf melody-t-mapped (filter-tie (tonality-map t-map melody-omn )))

;; Preview
(ps 'gm
    :tempo 90
    :p (list melody-t-mapped (closest-path chords-omn-mod))
    :bass (list bass))
</code></pre><p></p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>;;;
;;; LCC1-C
;;;
;;; Even more Outgoing
;;;

;; Find Parent scales
(setf lydian-principal-scales (find-lydian-scale chords
                                                 :scales '(lydian-augmented
                                                           lydian-diminished
                                                           lydian-b7
                                                           )))
;; (((c lydian-b7)) 
;; ((f lydian-b7)) 
;; ((f lydian-augmented) (f lydian-diminished) (f lydian-b7)) 
;; ((f lydian-diminished)))



;; Commit to one scale per chord in case on multiple options
(setf lydian-principal-scales-picked (rnd-pick lydian-principal-scales 
                                               :type 'list :seed 1))
;; ((c lydian-b7) (f lydian-b7) (f lydian-diminished) (f lydian-diminished))

;; Apply scales tonality to melody
(setf t-map (tonality-series lydian-principal-scales-picked
                             :map 'octave))
(setf melody-t-mapped (filter-tie (tonality-map t-map melody-omn )))

;; Preview
(ps 'gm
    :tempo 90
    :p (list melody-t-mapped (closest-path chords-omn-mod))
    :bass (list bass))
</code></pre><p></p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>;;;
;;; LCC1-D
;;;
;;; Custom scales
;;;

;; Find Parent scales
(setf lydian-principal-scales (find-lydian-scale chords
                                                 :scales '(lydian
                                                           minor-hexatonic
                                                           mixolydian-hexatonic
                                                           )))
;; (((g mixolydian-hexatonic)) 
;; ((c mixolydian-hexatonic)) 
;; ((f lydian)) 
;; ((c lydian) (d mixolydian-hexatonic) (a minor-hexatonic)))


;; Commit to one scale per chord in case on multiple options
(setf lydian-principal-scales-picked (rnd-pick lydian-principal-scales 
                                               :type 'list :seed 229792))
;; ((g mixolydian-hexatonic) (c mixolydian-hexatonic) (f lydian) (d mixolydian-hexatonic))

;; Apply scales tonality to melody
(setf t-map (tonality-series lydian-principal-scales-picked
                             :map 'octave))
(setf melody-t-mapped (filter-tie (tonality-map t-map melody-omn )))

;; Preview
(ps 'gm
    :tempo 90
    :p (list melody-t-mapped (closest-path chords-omn-mod))
    :bass (list bass))

</code></pre><p></p><p></p>
<p><a href="https://opusmodus.com/forums/uploads/monthly_2025_11/LCC1-C.png.93d3a62ab573821bebbbf87af4d42344.png" class="ipsAttachLink ipsAttachLink_image" ><img data-fileid="4231" src="https://opusmodus.com/forums/uploads/monthly_2025_11/LCC1-C.png.93d3a62ab573821bebbbf87af4d42344.png" height="526" width="2790" class="ipsImage ipsImage_thumbnailed" alt="LCC1-C.png" loading='lazy'></a></p><p>
<a class="ipsAttachLink" href="https://opusmodus.com/forums/applications/core/interface/file/attachment.php?id=4234&amp;key=c57b1a678967b6ee92674a708c671389" data-fileExt='aif' data-fileid='4234' data-filekey='c57b1a678967b6ee92674a708c671389'>LCC1-A.aif</a></p>]]></description><guid isPermaLink="false">3994</guid><pubDate>Fri, 14 Nov 2025 22:13:38 +0000</pubDate></item><item><title>EXPAND-CHORD</title><link>https://opusmodus.com/forums/topic/3997-expand-chord/</link><description><![CDATA[<p>Hi,</p><p>Is there a complete list of chords already included in OM? I would like to write, for example, am7b5/maj7 (a c eb g#), but it doesn't work.</p><p></p><p>Thank you for your help.</p><p></p>]]></description><guid isPermaLink="false">3997</guid><pubDate>Mon, 17 Nov 2025 09:58:17 +0000</pubDate></item></channel></rss>
