# replace-map Question

## Recommended Posts

Dear All,

I´m doing some melodic permutations and I have a question about replace-map:

Here are four elements permutations, generated by:

`(permute '(1 2 3 4))`
```(setf permut4 '((1 2 3 4) (1 2 4 3) (1 3 2 4) (1 3 4 2) (1 4 2 3)
(1 4 3 2) (2 1 3 4) (2 1 4 3) (2 3 1 4) (2 3 4 1)
(2 4 1 3) (2 4 3 1) (3 1 2 4) (3 1 4 2) (3 2 1 4)
(3 2 4 1) (3 4 1 2) (3 4 2 1) (4 1 2 3) (4 1 3 2)
(4 2 1 3) (4 2 3 1) (4 3 1 2) (4 3 2 1)))```

Here are the pitch material to be permutated:

`(setf permutcontent '((1 cs4) (2 d4) (3 e4) (4 g4)))`

I used the REPLACE MAP FUNCTION, like this:

`(replace-map permutcontent permut4)`

THE RESULT:

```((c4 d4 e4 g4) (c4 d4 g4 e4) (c4 e4 d4 g4) (c4 e4 g4 d4) (c4 g4 d4 e4)
(c4 g4 e4 d4) (d4 c4 e4 g4) (d4 c4 g4 e4) (d4 e4 c4 g4) (d4 e4 g4 c4)
(d4 g4 c4 e4) (d4 g4 e4 c4) (e4 c4 d4 g4) (e4 c4 g4 d4) (e4 d4 c4 g4)
(e4 d4 g4 c4) (e4 g4 c4 d4) (e4 g4 d4 c4) (g4 c4 d4 e4) (g4 c4 e4 d4)
(g4 d4 c4 e4) (g4 d4 e4 c4) (g4 e4 c4 d4) (g4 e4 d4 c4))```

THE QUESTION:

What if I want to replace one item (like a pitch) for a list of melodic pitches ?

How to proceed ?

For example:

Instead of substitute a C4 for the number 1, I want to substitute a list of notes, like (cs4 ds4)

`(setf permutcontent '((1 cs4 ds4) (2 d4) (3 e4) (4 g4)))`

When I set this, a get only the cs4 permeated...

Best,

Julio

I got it !

All the material must have the same number of elements, like

`(setf permutcontent '((1 (c4 cs4)) (2 (b4 ds4)) (3 (c5 f4)) (4 (cs5 ds4))))`

Resulting in:

```((c4 cs4) (b4 ds4) (c5 f4) (cs5 ds4))
((c4 cs4) (b4 ds4) (cs5 ds4) (c5 f4))
((c4 cs4) (c5 f4) (b4 ds4) (cs5 ds4))
((c4 cs4) (c5 f4) (cs5 ds4) (b4 ds4))
((c4 cs4) (cs5 ds4) (b4 ds4) (c5 f4))
((c4 cs4) (cs5 ds4) (c5 f4) (b4 ds4))
((b4 ds4) (c4 cs4) (c5 f4) (cs5 ds4))
((b4 ds4) (c4 cs4) (cs5 ds4) (c5 f4))
((b4 ds4) (c5 f4) (c4 cs4) (cs5 ds4))
((b4 ds4) (c5 f4) (cs5 ds4) (c4 cs4))
((b4 ds4) (cs5 ds4) (c4 cs4) (c5 f4))
((b4 ds4) (cs5 ds4) (c5 f4) (c4 cs4))
((c5 f4) (c4 cs4) (b4 ds4) (cs5 ds4))
((c5 f4) (c4 cs4) (cs5 ds4) (b4 ds4))
((c5 f4) (b4 ds4) (c4 cs4) (cs5 ds4))
((c5 f4) (b4 ds4) (cs5 ds4) (c4 cs4))
((c5 f4) (cs5 ds4) (c4 cs4) (b4 ds4))
((c5 f4) (cs5 ds4) (b4 ds4) (c4 cs4))
((cs5 ds4) (c4 cs4) (b4 ds4) (c5 f4))
((cs5 ds4) (c4 cs4) (c5 f4) (b4 ds4))
((cs5 ds4) (b4 ds4) (c4 cs4) (c5 f4))
((cs5 ds4) (b4 ds4) (c5 f4) (c4 cs4))
((cs5 ds4) (c5 f4) (c4 cs4) (b4 ds4))
((cs5 ds4) (c5 f4) (b4 ds4) (c4 cs4)))```

But would be nice to MIX different number of elements...

##### Share on other sites

May be try substitute map ? or pattern-map ?

S.

##### Share on other sites

Thanks, Stephane !

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• ### Similar Topics

• By hujairi
Hello,

I am trying to find different ways of importing partials/frames data into Opusmodus. I am currently trying to use spectral analysis to analyzes certain music/audio phenomena I haven't really seen analyzed before to adapt into my own composition process. The sounds are generally archival or things I have synthesized on the computer through software myself (in .wav format), and are usually between 1 - 5 seconds in length. Is this a good length of time to analyze the spectral data of sounds?

I just wanted to understand the following information about spectral tools within Opusmodus. I really would appreciate it if anyone could help me out.

1. Is it only Spear that we can use for spectral analysis? Is something like Audiosculpt also useable?

2. Looking at Spear, when we explore the data, which of the following export formats do we use: 1. Text - Resampled Frames, 2. Text - Partials, 3. SDIF 1 TRC - Resampled Frames, 4. SDIF 1 TRC - Exact Interpolated, or 5. SDIF RBEP?

3. Once I have the data in the correct format, I think I want to create a library of the datasets I important so that I can reinterpret them in the future. If I want to use the "get-tuning" function, for example, and then mapping it across certain instruments within my planned orchestration. What would be an effective way of doing this?

One of my main challenges is finding a way to keep all my data organized every time I want to use Opusmodus for a new project. I still find myself using Opusmodus in little blocks as I compose, and I hope to eventually get to the point in which I can compose entire pieces using only Opusmodus.

• Dear All,

Stephane did this amazing and clear example (code below) of how to spread an harmonic progression over a predefined texture.
This can be altered to any harmonic idiom. I did some test, using a chorale texture originated from a 12-tone row and also
a more jazz-oriented chorale.

THE QUESTION IS (For Stephane Boussuge)

1) How the harmonic rhythm is controlled here? In the example, the chord changes every half note.
2) How can I make the harmony changes at every quarter note ?
3) Can I use different rates of harmonic rhythms ?

Best,
Julio

;;; Classical Accompaniment Exemple ;;;--------------------------------------------------------- ;;; Parameters ;;;--------------------------------------------------------- ;;; Motif definition (setf mtf1 '((s c5 leg g5 leg e6 leg g5 c5 leg g5 leg e6 leg g5))) (setf mtf2 (pitch-transpose 4 mtf1)) (setf mtf3 '((-q e5))) (setf mtf4 '((-q g4c5))) (setf mtf5 '((q c2 -))) ;;; Chords definition (setf chords (library 'harmoprog1 'minor-4vx 'prog1)) ;;; Ostinati (setf ost1 (gen-repeat (length chords) mtf1)) (setf ost2 (gen-repeat (length chords) mtf2)) (setf ost3 (gen-repeat (length chords) mtf3)) (setf ost4 (gen-repeat (length chords) mtf4)) (setf ost5 (gen-repeat (length chords) mtf5)) ;;; Tonality-map series (setf tm-path (tonality-series chords)) ;;; Here we apply the map 'tm-path' into arpegio sequence. (setf ost1.map (tonality-map tm-path ost1)) (setf ost2.map (tonality-map tm-path ost2)) ;;; Here we apply our library chords into chord sequence. ;;; The harmonic-path preserves the voice leading. (setf ost3.map (harmonic-path chords ost3)) (setf ost4.map (harmonic-path chords ost4)) (setf ost5.map (harmonic-path chords ost5)) (setf violin1 (ambitus '(g3 c7) ost2.map)) (setf violin2 (ambitus '(g3 c6) ost1.map)) (setf viola (ambitus '(c3 e4) ost3.map)) (setf violoncello (ambitus-chord 12 (pitch-transpose -12 ost4.map))) (setf bass ost5.map) ;;;--------------------------------------------------------- ;;; Score and Layout ;;;--------------------------------------------------------- (def-score Classical-accomp (:title "Classical accompaniment example" :composer "S.Boussuge" :copyright "Copyright © 2018 s.boussuge" :key-signature 'chromatic :time-signature '((1 1 1 1) 4) :tempo 80 :layout (bracket-group (violin-layout 'violin1 :name "Violin-1") (violin-layout 'violin2 :name "Violin-2") (viola-layout 'viola) (violoncello-layout 'violoncello) (contrabass-layout 'bass) ) ) (violin1 :omn violin1 :channel 1 :sound 'gm :program 'String-Ensemble-1 :volume 100 :pan 48 :controllers (91 '(68)) ) (violin2 :omn violin2 :channel 2 :sound 'gm :program 'String-Ensemble-1 :volume 100 :pan 48 :controllers (91 '(68)) ) (viola :omn viola :channel 3 :sound 'gm :program 'String-Ensemble-1 :volume 90 :pan 64 :controllers (91 '(68)) ) (violoncello :omn violoncello :channel 4 :sound 'gm :program 'String-Ensemble-1 :volume 90 :pan 80 :controllers (91 '(68)) ) (bass :omn bass :channel 5 :sound 'gm :program 'String-Ensemble-1 :volume 90 :pan 80 :controllers (91 '(68)) ) )
• By AM
short question to GEN-SORT....

the original/start-sequence is not shown with GEN-SORT? i think it should... you see it when using 'min-max...
so, i think the AXIOM must be shown

greetings
andré

×

• Lessons