# FoxDot composition

**URL:** <https://in-thread.sonic-pi.net/t/foxdot-composition/5060>\
**Category:** Show your work\
**Created:** [January 28, 2021, 11:22pm UTC](https://in-thread.sonic-pi.net/t/foxdot-composition/5060 "2021-01-28T23:22:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![holz](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/holz/32/1664_2.png) [@holz](https://in-thread.sonic-pi.net/u/holz)\
**Post date:** [January 28, 2021, 11:22pm UTC](https://in-thread.sonic-pi.net/t/foxdot-composition/5060/1 "2021-01-28T23:22:13Z")

</div>

Well i dont know if we share only sonic pi related ideas, or generally coded music,  
anyway here is a track i made in FoxDot with pretty basic knowledge of the language.

[Crunchy von M. E. (soundcloud.com)](https://soundcloud.com/m-e-160701808/crunchy)

---

<div class="post-metadata">

**Author:** ![samaaron](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/samaaron/32/7_2.png) [@samaaron](https://in-thread.sonic-pi.net/u/samaaron)\
**Post date:** [April 14, 2021, 8:53am UTC](https://in-thread.sonic-pi.net/t/foxdot-composition/5060/2 "2021-04-14T08:53:36Z")

</div>

Hi @holz - these forums are mainly for Sonic Pi related things - although broader areas of interest are definitely encouraged especially if they cross-pollinate and provide inspiration/motivation for our community.

In this case, I’d be very much interested in what you did in FoxDot, how it might relate to Sonic Pi (for example, which bits were much easier/more expressive in FoxDot) which an eye to look at what we might add to Sonic Pi to make this kind of thing easier.

I’m definitely interested in making little pattern languages easier to work with and share, so that kind of feedback would be super useful 🙂

---

<div class="post-metadata">

**Author:** ![holz](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/holz/32/1664_2.png) [@holz](https://in-thread.sonic-pi.net/u/holz)\
**Post date:** [April 14, 2021, 10:12am UTC](https://in-thread.sonic-pi.net/t/foxdot-composition/5060/3 "2021-04-14T10:12:16Z")

</div>

Hi aaron, glad u liked it 🙂

i think a key component which makes composing in FoxDot very easy is the function Var

it looks something like that var([1,2,3],[1,2,3])  
this would mean 1,2,3 1,1,2,2,3,3 1,1,1, 2,2,2, 3,3,3  
this allows to generate very quickly quite complex structures, i am not aware of that function in SP maybe i am missing it.  
Otherwise i would say Sonic Pi and Foxdot are capable of the same stuff, but i am like an advanced newb xD

---

<div class="post-metadata">

**Author:** ![thatkidnamedrox](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@thatkidnamedrox](https://in-thread.sonic-pi.net/u/thatkidnamedrox)\
**Post date:** [October 26, 2021, 4:56am UTC](https://in-thread.sonic-pi.net/t/foxdot-composition/5060/4 "2021-10-26T04:56:58Z")

</div>

Hey, if you wanted that kind of result, you could take a look at the stretch function:

```ruby
define :var do |a, s|
  r = []
  s.each do |i|
    r = r + stretch(a, i)
  end
  return r
end

puts var([1,2,3],[1,2,3]) # => [1,2,3 1,1,2,2,3,3 1,1,1, 2,2,2, 3,3,3]

```
