# Ruby Symbols in SPi

**URL:** <https://in-thread.sonic-pi.net/t/ruby-symbols-in-spi/4607>\
**Category:** Support, Help & Resources\
**Created:** [November 13, 2020, 8:11am UTC](https://in-thread.sonic-pi.net/t/ruby-symbols-in-spi/4607 "2020-11-13T08:11:03Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [November 13, 2020, 10:32am UTC](https://in-thread.sonic-pi.net/t/ruby-symbols-in-spi/4607/4 "2020-11-13T10:32:59Z")

</div>

> [@soxsa](#):
>
> If I do
> 
> ```ruby
> puts :c4.to_s
> puts :c4.to_f
> 
> ```
> 
> the output is
> 
> ```ruby
> {run: 5, time: 0.0}
> ├─ "c4"
> └─ 60.0
> 
> ```

This is because Sonic Pi is _not_ Ruby. This is something I try to emphasise but often seems to get pushed to the wayside. Sonic Pi is built on top of Ruby (currently) and therefore shares a lot of behaviour, but it also changes behaviour (often in subtle places) towards its goal of being a musical instrument and not a Ruby library.

Having `:c4` know how to turn itself to the MIDI number `60` means that `:c4 + 1` works by returning the MIDI note for `:cs4`. This isn’t something a typical programming language will do 🙂

Also, calls like `to_s` and `to_f` are really not supported and you shouldn’t assume they’ll always be available and/or produce the same behaviour across versions.

I’d definitely look towards using hashes/maps such as `{:foo => 3, :bar => 4}` this is something I do hope to continue to support as the language evolves.

---

_[View the full topic](https://in-thread.sonic-pi.net/t/ruby-symbols-in-spi/4607)._
