Jump to content

Featured Replies

Posted

Hi all,
I tried to answer the question in the title with Opusmodus GPT (see attached file).

(setf lenmap1 '(q q q q q q q q q q q q q q q q))

(setf vec (half-sine 50 1))

(setf vec-lenmap1 (vector-map lenmap1 vec))

Can anybody explain, why I get only 50 quarters instead of 16 respectively how vector-map really works mathematically?
Thanks and greetings, Achim

vector-halfsine.md

This dose not make any sence:

(setf lenmap1 '(q q q q q q q q q q q q q q q q))
(setf vec (half-sine 50 1))
(setf vec-lenmap1 (vector-map lenmap1 vec))

You could simply do:

(gen-repeat 50 '(q))

Please check the vector-map documentation.

  • Author
16 minutes ago, opmo said:
This dose not make any sence:

(setf lenmap1 '(q q q q q q q q q q q q q q q q))
(setf vec (half-sine 50 1))
(setf vec-lenmap1 (vector-map lenmap1 vec))

You could simply do:

(gen-repeat 50 '(q))

Please check the vector-map documentation.

Thank you very much for this exclusive hint :-) - but I want to know how vector-map works and Opusmodus GPT was not helpful.

In my understanding vector-map should shape the uniform list according to the half-sine?

Yes, but there is nothing to be shaped when the map contain only 1 (same) value.

The map list values will not change, they will follow the given data.

(setf map '(1 2 3 4 5 6))
(setf vec (half-sine 50 1))
(setf vec-lenmap1 (vector-map map vec))
=> (1 1 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5 5 4 4 4 4 3 3 3 3 2 2 2 1)

How vector-map works?

ChatGPT said:

The function VECTOR-MAP in Opusmodus is used to map a list of continuous floating-point numbers (e.g. generated noise) to a discrete set of items, such as pitches, rhythms, dynamics, or other symbolic values.

Function Signature

(VECTOR-MAP map data)

Arguments

  • map: A list of symbolic items (e.g., pitches, rhythm values, dynamics).

  • data: A list or vector of floating-point numbers, often generated by functions like GEN-NOISE.

Description

VECTOR-MAP translates each number in the data list to an index in the map list. Internally, the numbers are likely normalized and converted to indices into the map, allowing stochastic or algorithmically generated numerical sequences to be "translated" into musical materials.

Example Usages

(vector-map '(c4 d4 e4 g4 a4) (gen-noise 10)) ;; => (g4 e4 c4 c4 d4 e4 a4 d4 d4 a4) (vector-map '(mp mf mp mf) (gen-noise 10)) ;; => (mf mp mf mf mp mf mf mf mp mf) (vector-map '(1/16 1/16 -1/16 1/16) (gen-noise 10)) ;; => (1/16 1/16 -1/16 1/16 1/16 1/16 -1/16 1/16 1/16 1/16)

You can also map multiple noise streams simultaneously:

(vector-map '((1/16 1/16 -1/16 1/16)) (list (gen-noise 10 :seed 23) (gen-ar-time-series 10 '(-0.75) 0.5 :seed 23) (gen-gaussian-noise 9 :seed 23) (gen-noise 10 :type :double-exponential :seed 23)))

This makes VECTOR-MAP especially useful for algorithmic composition where musical materials are derived from statistical or chaotic data sources.

Create an account or sign in to comment


Copyright © 2014-2025 Opusmodus™ Ltd. All rights reserved.
Product features, specifications, system requirements and availability are subject to change without notice.
Opusmodus, the Opusmodus logo, and other Opusmodus trademarks are either registered trademarks or trademarks of Opusmodus Ltd.
All other trademarks contained herein are the property of their respective owners.

Powered by Invision Community

Important Information

Terms of Use Privacy Policy