# Auto-Format of (ring )

**URL:** <https://in-thread.sonic-pi.net/t/auto-format-of-ring/2315>\
**Category:** Support, Help & Resources\
**Created:** [April 25, 2019, 9:12am UTC](https://in-thread.sonic-pi.net/t/auto-format-of-ring/2315 "2019-04-25T09:12:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PiEaterAndPlayer](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@PiEaterAndPlayer](https://in-thread.sonic-pi.net/u/PiEaterAndPlayer)\
**Post date:** [April 25, 2019, 9:12am UTC](https://in-thread.sonic-pi.net/t/auto-format-of-ring/2315/1 "2019-04-25T09:12:24Z")

</div>

Why does it look like this? Is there anything I can do to make it look neater?

```ruby
chordprog = (ring chord( :c3, 'm7' ),
             chord( :g3, 'm7' ),
             chord( :f3, 'm7' ),
             chord( :ab3, 'major' ),
             chord( :c3, 'm7' ),
             chord( :g3, 'm7' ),
             chord( :eb3, 'major' ),
chord( :eb3, '6*9' ) ).repeat(3) +
  (ring chord( :c3, 'm7' ),
   chord( :g3, 'm7' ),
   chord( :f3, 'major' ),
   chord( :ab3, 'major' ),
   chord( :c3, 'm7' ),
   chord( :bb3, 'major' ),
   chord( :eb3, 'major' ),
   chord( :eb3, '6*9' ) )

```

---

<div class="post-metadata">

**Author:** ![emlyn](https://dub1.discourse-cdn.com/flex017/user_avatar/in-thread.sonic-pi.net/emlyn/32/1460_2.png) [@emlyn](https://in-thread.sonic-pi.net/u/emlyn)\
**Post date:** [April 26, 2019, 1:11pm UTC](https://in-thread.sonic-pi.net/t/auto-format-of-ring/2315/2 "2019-04-26T13:11:54Z")

</div>

I suppose this is a limitation of whatever library is doing the formatting, which is probably not programmed to handle Sonic Pi’s lisp-like syntax.  
You can work around it by using standard Ruby function-call syntax:

```ruby
chordprog = ring( chord( :c3, 'm7' ),
                  chord( :g3, 'm7' ),
                  chord( :f3, 'm7' ),
                  chord( :ab3, 'major' ),
                  chord( :c3, 'm7' ),
                  chord( :g3, 'm7' ),
                  chord( :eb3, 'major' ),
                  chord( :eb3, '6*9' )
).repeat(3) +
  ring( chord( :c3, 'm7' ),
        chord( :g3, 'm7' ),
        chord( :f3, 'major' ),
        chord( :ab3, 'major' ),
        chord( :c3, 'm7' ),
        chord( :bb3, 'major' ),
        chord( :eb3, 'major' ),
        chord( :eb3, '6*9' ) )

```

Or you could create an array and then use `.ring` on it, something like:

```ruby
chordprog =
  [chord( :c3, 'm7' ),
   chord( :g3, 'm7' ),
   chord( :f3, 'm7' ),
   chord( :ab3, 'major' ),
   chord( :c3, 'm7' ),
   chord( :g3, 'm7' ),
   chord( :eb3, 'major' ),
   chord( :eb3, '6*9' )
   ].ring.repeat(3) +
  [chord( :c3, 'm7' ),
   chord( :g3, 'm7' ),
   chord( :f3, 'major' ),
   chord( :ab3, 'major' ),
   chord( :c3, 'm7' ),
   chord( :bb3, 'major' ),
   chord( :eb3, 'major' ),
   chord( :eb3, '6*9' )].ring

```

---

<div class="post-metadata">

**Author:** ![PiEaterAndPlayer](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@PiEaterAndPlayer](https://in-thread.sonic-pi.net/u/PiEaterAndPlayer)\
**Post date:** [April 26, 2019, 7:02pm UTC](https://in-thread.sonic-pi.net/t/auto-format-of-ring/2315/3 "2019-04-26T19:02:59Z")

</div>

Thanks very much for this. I like things to look neat 🙂
