# Sleeping for total duration

**URL:** <https://in-thread.sonic-pi.net/t/sleeping-for-total-duration/7857>\
**Category:** Support, Help & Resources\
**Created:** [May 30, 2023, 2:40pm UTC](https://in-thread.sonic-pi.net/t/sleeping-for-total-duration/7857 "2023-05-30T14:40:59Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![mrbombmusic](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/mrbombmusic/32/2282_2.png) [@mrbombmusic](https://in-thread.sonic-pi.net/u/mrbombmusic)\
**Post date:** [July 9, 2023, 1:21am UTC](https://in-thread.sonic-pi.net/t/sleeping-for-total-duration/7857/5 "2023-07-09T01:21:54Z")

</div>

```ruby
all the samples in that row will only play for however long ‘2’ is normalized to.

```

I am not clear on what you mean by “normalized to”. What is happening when something is “normalized”? Can you give an example of what this would look like? What would ‘2’ be normalized to?

I see the “normalize” function you have defined in your code. it looks like you are “mapping” one range of values to another range of values. [This post](https://in-thread.sonic-pi.net/t/maths-and-mapping/206) shows a formula that looks similar to the one you have. Is this what you are trying to do? If so, how would this connect to the duration for each row of samples?

---

_[View the full topic](https://in-thread.sonic-pi.net/t/sleeping-for-total-duration/7857)._
