Jump to content

# Search the Community

Showing results for tags 'prime'.

• ### Search By Tags

Type tags separated by commas.

### Forums

• Welcome to Opusmodus
• Announcements
• Pre Sales Questions
• Support Forum
• Support & Troubleshooting
• OMN Lingo
• Function Examples
• Score and Notation
• Live Coding Instrument
• Library Setup
• MIDI Setup
• SuperCollider
• Question & Answer
• Suggestions & Ideas
• Zoom into Opusmodus
• Sharing
• Made In Opusmodus
• User Extensions Source Code
• Opusmodus Workshops & Schools
• Composer Workshop

### Calendars

• Community Calendar

• Opusmodus

### Categories

• Tutorials
• How-to in 100 sec
• Made in Opusmodus
• How-To
• Zoom into Opusmodus
• SuperCollider
• Workflow
• Live Coding
• Presentation
• Analysis
• Composer Workshop

• 0 Comments

• 0 Replies

• 0 Reviews

• 0 Views

Found 1 result

1. ## primes*

a little prime-function-extension (defun primes* (n &key (offset 0) (every-x 1) (reverse nil)) (let ((n (* n every-x)) (seq)) (progn (setf seq (find-everyother every-x (subseq (primes (+ n offset)) offset (+ n offset)))) (if (equal reverse nil) seq (reverse seq))))) (primes* 4 :offset 0) => (2 3 5 7) (primes* 4 :offset 1) => (3 5 7 11) (primes* 6 :offset 8) => (23 29 31 37 41 43) (primes* 5 :offset 5 :every-x 2) => (13 19 29 37 43) (primes* 5 :offset 3 :every-x 4) => (7 19 37 53 71) (primes* 5 :offset 5 :every-x 3 :reverse t) => (61 47 37 23 13) ;;;; in combination with "reading-list-by-steps" (defun reading-list-by-steps (&key steps values (start (car values))) (let ((pos (car (position-item start values)))) (append (list (nth pos values)) (loop for i in steps do (setf pos (+ pos i)) when (> pos (length values)) do (setf pos (+ 0 i)) collect (nth pos values))))) (list-plot (reading-list-by-steps :steps '(1 2 -1 3 4 -1) :values (primes* 10 :offset 4 :reverse t)) :join-points t)
×
• #### Browser

• Video Gallery

• Lessons

• #### Buy

• Clubs
×
• Create New...