# length-trim measures with rests

## Recommended Posts

I want to trim every full-duration measure so that it always first starts with a quarter note and fills the rest of the measure with corresponding rests.

For example, is it's possible to consider an omn sequence like the one below and trim the durations so that every (firtst) note in a measure is a quarter note followed by a quarter note rest (in 1/4) or a quarter note followed by an eight-note rest (in 3/8)?

Thank you!

((e. e3) (e. e3) (q g3) (e. d3) (q a3))

##### Share on other sites

You should generate the sequence correctly in the first place and not make correction to an existing sequence.

```(loop for i in '((q e3) (q e3) (q g3) (q d3) (q a3))
collect (fit-to-span 3/8 i))
=> ((q e3 -e) (q e3 -e) (q g3 -e) (q d3 -e) (q a3 -e))```

##### Share on other sites

Thanks, Janusz. This is very helpful!

The suggestion you made works. I just wonder if it could be applied to a sequence of alternating 3/8 and 1/4 measures? Something like:

```(loop for i in '((q e3) (q. e3) (q g3) (q d3) (q. a3))
collect (fit-to-span '(3/8 2/8) i))```

Thank you!!

##### Share on other sites

``` (loop
for (a b) on '((q e3) (q. e3) (q g3) (q d3) (q. a3))  by #'cddr
when a collect (fit-to-span 3/8 a)
when b collect (fit-to-span 2/8 b))
=> ((q e3 -e) (q e3) (q g3 -e) (q d3) (q. a3))```

##### Share on other sites

```(loop for seq in '((q e3) (q. e3) (q g3) (q d3) (q. a3))
for span in '(3/8 1/4 3/8 1/2)
collect (fit-to-span span seq))
=> ((q e3 -e) (q e3) (q g3 -e) (q d3 -))```

##### Share on other sites

Posted (edited)

Thanks, everyone, for your suggestions. I apologize for not being as knowledgeable in lisp programming to figure this out! Most importantly, I'm sorry for not asking my question with more clarity!

I want to retain the same measure lengths and shorten the duration of notes by 1/16 so that there's always a 16-note rests at the end of each measure:

'((q e3) (q. e3) (q g3) (q d3) (q. a3))
=>

'((e e3 -e) (e e3 -s) (e g3 -e) (e d3 -e) (e a3 -s))

I would take measure spans from an existing sequence that features a somewhat random pattern of 3/16 and 1/4 measures and then have eighth notes in each bar followed by 16-note or 8-note rests, depending on the measure length.

Do you think something like this might be possible!

Thank you for your help and patience!

Zvony

Edited by NagyMusic
question clarification
##### Share on other sites

Sorry, but I don't get what you are after

##### Share on other sites

```(setf omn-ls (length-staccato '((q e3) (q. e3) (q g3) (q d3) (q. a3)) :value 1/8))
=> ((e e3 -) (e e3 -q) (e g3 -) (e d3 -) (e a3 -q))```

```(loop for i in omn-ls
collect (fit-to-span 3/8 i))
=> ((e e3 -q) (e e3 -q) (e g3 -q) (e d3 -q) (e a3 -q))```

##### Share on other sites

Thank you so much! length-staccato was exactly what I was looking for! I appreciate you help and patience with my question.

##### Share on other sites

You need to search and study more the documents.

## 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.

×
×

• Lessons