From 8a52b9b9c6aab04076883a3a674cbf513b8b49cd Mon Sep 17 00:00:00 2001
From: Marlon Schumacher <schumacher@hfm-karlsruhe.de>
Date: Fri, 28 Mar 2025 03:28:28 +0100
Subject: [PATCH] feat: adding resources for OM library

---
 resources/pict/Logo OM-SRR.png |    0 
 resources/Max-OSC-test.maxpat  |    0 
 resources/icons/987.jpg        |    0 
 sources/SRR.lisp               |   32 ++++-----------
 OM-SRR.lisp                    |   64 ++++++++++++++++++++++++++++++++
 resources/icons/988.jpg        |    0 
 6 files changed, 73 insertions(+), 23 deletions(-)

diff --git a/OM-SRR.lisp b/OM-SRR.lisp
new file mode 100644
index 0000000..49ce925
--- /dev/null
+++ b/OM-SRR.lisp
@@ -0,0 +1,64 @@
+; ****************************************************************
+; | OM-SRR, 2023-2025 M.Schumacher                               |
+; |                                                              |
+; | Library for spectral rhythm modeling via integer time ratios |
+; | (partials) as phase-aligned amplitude modulations.           |
+; |                                                              |
+; | See https://steffenkrebber.de/research/sinusoidal-run-rhythm/|
+; ****************************************************************
+;
+;This program is free software; you can redistribute it and/or
+;modify it under the terms of the GNU General Public License
+;as published by the Free Software Foundation; either version 2
+;of the License, or (at your option) any later version.
+;
+;See file LICENSE for further informations on licensing terms.
+;
+;This program is distributed in the hope that it will be useful,
+;but WITHOUT ANY WARRANTY; without even the implied warranty of
+;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;GNU General Public License for more details.
+;
+;You should have received a copy of the GNU General Public License
+;along with this program; if not, write to the Free Software
+;Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,10 USA.
+;
+;Authors: M. Schumacher
+
+
+;--------------------------------------------------
+;Variable definiton with files to load 
+;--------------------------------------------------
+
+
+(defvar *initfile* *load-pathname*)
+
+(defun lib-src-file (name)
+  (make-pathname :directory (append (pathname-directory *initfile*) (list "sources")) 
+                 :name name))
+
+(defvar *OM-SRR_files* nil)
+(setf *OM-SRR_files* '("srr"))
+
+;--------------------------------------------------
+;Loading files 
+;--------------------------------------------------
+  
+
+(mapc #'(lambda (filename) 
+          (om::compile&load (namestring (lib-src-file filename))))
+      *OM-SRR_files*)
+
+;--------------------------------------------------
+; OM subpackages initialization
+; ("sub-pack-name" subpacke-lists class-list function-list class-alias-list)
+;--------------------------------------------------
+(defvar *subpackages-list* nil)
+(setf *subpackages-list* 
+      '((Nil Nil Nil (gen-partial gen-srr polar-plot farey-sequence) Nil)))
+
+
+;--------------------------------------------------
+;filling packages
+;--------------------------------------------------
+(om::fill-library *subpackages-list*)
\ No newline at end of file
diff --git a/Max-OSC-test.maxpat b/resources/Max-OSC-test.maxpat
similarity index 100%
rename from Max-OSC-test.maxpat
rename to resources/Max-OSC-test.maxpat
diff --git a/resources/icons/987.jpg b/resources/icons/987.jpg
new file mode 100644
index 0000000..458e3e3
--- /dev/null
+++ b/resources/icons/987.jpg
Binary files differ
diff --git a/resources/icons/988.jpg b/resources/icons/988.jpg
new file mode 100644
index 0000000..15ffb27
--- /dev/null
+++ b/resources/icons/988.jpg
Binary files differ
diff --git a/resources/pict/Logo OM-SRR.png b/resources/pict/Logo OM-SRR.png
new file mode 100644
index 0000000..8f21d4f
--- /dev/null
+++ b/resources/pict/Logo OM-SRR.png
Binary files differ
diff --git a/SRR.lisp b/sources/SRR.lisp
similarity index 86%
rename from SRR.lisp
rename to sources/SRR.lisp
index bf3d81d..f7c4242 100644
--- a/SRR.lisp
+++ b/sources/SRR.lisp
@@ -1,8 +1,9 @@
 ; ****************************************************************
-; | OM-SRR, 2023                                                 |
+; | OM-SRR, 2023-2025 M.Schumacher                               |
 ; |                                                              |
-; | Library for spectral rhythm model via integer time ratios    |
+; | Library for spectral rhythm modeling via integer time ratios |
 ; | (partials) as phase-alilgned amplitude modulations.          |
+; |                                                              |
 ; | See https://steffenkrebber.de/research/sinusoidal-run-rhythm/|
 ; ****************************************************************
 ;
@@ -26,22 +27,21 @@
 
 (in-package :om)
 
-; main function
 
-; gen-wave
+
+; GEN-PARTIAL
 
 (defmethod! gen-partial (subdivision &key (precision 0.01) (decimals 5))
 
-            ;:icon 141  
-            ;:initvals '(0 0.1 5)
-            ;:indoc '("subdivision" "precision" "decimals")
+            :icon 988   
+            :initvals '(2 0.01 5)
+            :indoc '("subdivision" "precision" "decimals")
             :numouts 2
 
   (let* ((sampled-function (multiple-value-list   
                             (om-sample #'cos (* subdivision precision) 0 (* subdivision (* 2 pi)) decimals)))
          (x-points (second sampled-function))
          (y-points (third sampled-function)))
-  
 
     (values (om/ x-points subdivision) y-points)
     )
@@ -119,7 +119,7 @@
   "Compute the Farey sequence of order n."
   (let ((fractions '()))
     (loop for denominator from 1 to n
-          do (loop for numerator from 0 to denominator
+          do (loop for numerator from 1 to denominator
                    when (and (>= numerator 0) (<= numerator denominator)
                              (= 1 (gcd numerator denominator)))
                    do (push (cons numerator denominator) fractions)))
@@ -127,23 +127,9 @@
                       (let ((num-a (car a)) (den-a (cdr a))
                             (num-b (car b)) (den-b (cdr b)))
                         (< (* num-a (float den-b)) (* num-b (float den-a))))))
-
-    (loop for (a . b) in fractions collect
-          (/ a b)
-          )
     ))
-
-(defparameter *farey-seq* '(0 1/5 1/4 1/3 2/5 1/2 3/5 2/3 3/4 4/5 1))
-
-(loop for item in *farey-seq* 
-        collect (unless (zerop item)
-                  (/ 1 item)))
 
 ;; Example usage
 (print (farey-sequence 5))
 (farey-sequence 5)
 
-(let ((conspair '(1 . 5)))
- (/ (car conspair)
-    (cdr conspair))
-)

--
Gitblit v1.9.1