# List all\_symbols

**URL:** <https://in-thread.sonic-pi.net/t/list-all-symbols/8136>\
**Category:** Support, Help & Resources\
**Created:** [September 11, 2023, 3:53pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136 "2023-09-11T15:53:32Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jonny](https://in-thread.sonic-pi.net/u/jonny)\
**Post date:** [September 11, 2023, 3:53pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/1 "2023-09-11T15:53:32Z")

</div>

I am playing with :bpm  
it appears it’s a known symbol (default 60)

is there a way of listing all known symbols?

(gpt lied… again!)

> Sonic Pi uses symbols to represent notes, chords, scales, modes, and other musical concepts. A symbol is a name that starts with a colon, such as :c4 or :major. To get a list of all the symbols that Sonic Pi recognizes, you can use the all\_symbols command, like this:

`puts all_symbols`

undefined local variable or method `all\_symbols’ for Runtime:SonicPiLang

---

<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:** [September 11, 2023, 9:29pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/2 "2023-09-11T21:29:42Z")

</div>

Haha, Chat GPT can generate some weird and erroneous stuff sometimes!

Sonic Pi’s language is based on Ruby and in Ruby _any_ set of characters prefixed with a colon is a symbol. The following are all examples of symbols: `:foo`, `:bar_baz`, `:quux1`, `:c3`, `:minor_pentatonic`. Just because something is a symbol in Sonic Pi doesn’t mean that it is meaningful as a musical concept 🙂

However, there are some useful functions to list some of the recognised musical symbols:

- `puts scale_names`
- `puts chord_names`
- `puts sample_groups`
- `puts all_sample_names`
- `puts synth_names`
- `puts fx_names`

---

<div class="post-metadata">

**Author:** ![jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jonny](https://in-thread.sonic-pi.net/u/jonny)\
**Post date:** [September 11, 2023, 10:17pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/3 "2023-09-11T22:17:20Z")

</div>

Thanks Sam! Will be playing with these!

Does that mean it’s not possible to get a list of all symbols like :bpm?  
(I wasn’t sure if these were defined in the code somewhere specific in the github repo, if it’s not possible to evaluate / return using some RubyWax™), or if this level of detail is concealed from the user.

---

<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:** [September 11, 2023, 10:21pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/4 "2023-09-11T22:21:54Z")

</div>

> [@jonny](#):
>
> Does that mean it’s not possible to get a list of all symbols like :bpm?

Perhaps it’s because it’s getting a little late at night for me but I’m unsure where `:bpm` is ever used as a symbol.

Do you mean the functions `use_bpm` or `current_bpm`?

---

<div class="post-metadata">

**Author:** ![onesinglecircle](https://avatars.discourse-cdn.com/v4/letter/o/e0b2c6/32.png) [@onesinglecircle](https://in-thread.sonic-pi.net/u/onesinglecircle)\
**Post date:** [September 11, 2023, 11:49pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/5 "2023-09-11T23:49:06Z")

</div>

These are fantastic! I just figured out the proper grammar to tick my way through all the different scales (and print them out as well). A proud moment for a newbie! I’m fascinated by the different global and historical divisions of the octave, so I’ll just put these few lines of code on a loop and listen for a few days … this is both fun and enlightening.

---

<div class="post-metadata">

**Author:** ![jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jonny](https://in-thread.sonic-pi.net/u/jonny)\
**Post date:** [September 12, 2023, 10:01am UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/6 "2023-09-12T10:01:28Z")

</div>

> Do you mean the functions use\_bpm or current\_bpm?

Perhaps!

I found an example where the bpm is adjustable at runtime, without stopping.

`use_bpm get(:bpm)`

outside the loop/block the :bpm is initialised

`set :bpm, 60`

- If this isn’t initialised, the default is still set  
`puts "bpm = #{get(:bpm)}" # 60`
- Also the intellisense picks this symbol up, but I now see that’s just because **I’ve used the symbol previously**  
 ![set_bpm](https://europe1.discourse-cdn.com/flex017/uploads/sonic_pi/original/2X/e/ed4439c19dda0f00770678c07b05ce2c8bca1b8a.png)

So yes I think I may be referring to current\_bpm (in a way - or a non-existent symbol!)

Thanks!

---

<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:** [September 12, 2023, 10:23am UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/7 "2023-09-12T10:23:39Z")

</div>

Hi @jonny,

could you point me to the example that uses `set :bpm` and `get :bpm`?

Note that neither of these will actually change the bpm. For that you need either `use_bpm` to set the current thread or `set_link_bpm!` to set the global link-based metronome.

Also, each thread/live\_loop can have its own independent bpm value and that the default bpm is set to match the global link-based metronome (which also has GUI controls in the bottom right of the app window).

---

<div class="post-metadata">

**Author:** ![jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jonny](https://in-thread.sonic-pi.net/u/jonny)\
**Post date:** [September 17, 2023, 6:28pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/8 "2023-09-17T18:28:58Z")

</div>

> [@onesinglecircle](#):
>
> proper grammar to tick my way through all the different scales (and print them out as well).

Hi, & well done! Have you wrapped this up in a method or class?  
Am playing with ticks and counters, and curious to see how you’ve implemented, and how you’re iterating… also check out these awesome examples - may need the OP or GPT to explain exactly what’s going on here… would love to know how they came up with this too!

Credit to @amiika  
[Sonic-Pi/psy/psy\_effect\_thx.rb at master · amiika/Sonic-Pi (github.com)](https://github.com/amiika/Sonic-Pi/blob/master/psy/psy_effect_thx.rb)

---

<div class="post-metadata">

**Author:** ![onesinglecircle](https://avatars.discourse-cdn.com/v4/letter/o/e0b2c6/32.png) [@onesinglecircle](https://in-thread.sonic-pi.net/u/onesinglecircle)\
**Post date:** [September 17, 2023, 9:02pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/9 "2023-09-17T21:02:16Z")

</div>

Hi @jonny,

it’s very basic (I don’t yet know what a method or class is). the goal for me was simply to listen to all the scales without having to run each scale manually (which is what I did while wrestling with my tick grammar.

i ran puts scale\_names and then copied it into a buffer and built around it, each time expecting an error till one time it played - i was giddy. the minute it worked, i detuned all the scales to C256 (philosophical tuning circa 1713) and then added random pan and release functions to make it sound like an unreliable and wonky old piano. Great fun!

```ruby
live_loop :scales do
  trial = (ring :acem_asiran, :acem_kurdi, :acemli_rast, :aeolian, :ahirbhairav, :augmented, :augmented2, :bartok, :bayati, :bayati_2, :bayati_araban, :bestenigar, :bhairav, :blues_major, :blues_minor, :buselik, :buselik_2, :cargah, :chinese, :chromatic, :diatonic, :diminished, :diminished2, :dorian, :dugah, :dugah_2, :egyptian, :enigmatic, :evcara, :evcara_2, :evcara_3, :evcara_4, :evic, :evic_2, :ferahfeza, :ferahfeza_2, :ferahnak, :gong, :gulizar, :harmonic_major, :harmonic_minor, :hex_aeolian, :hex_dorian, :hex_major6, :hex_major7, :hex_phrygian, :hex_sus, :hicaz, :hicaz_2, :hicaz_humayun, :hicaz_humayun_2, :hicazkar, :hicazkar_2, :hindu, :hirajoshi, :hungarian_minor, :huseyni, :huseyni_2, :huzzam, :huzzam_2, :indian, :ionian, :isfahan, :isfahan_2, :iwato, :jiao, :karcigar, :kumoi, :kurdi, :kurdili_hicazkar, :kurdili_hicazkar_2, :kurdili_hicazkar_3, :kurdili_hicazkar_4, :kurdili_hicazkar_5, :leading_whole, :locrian, :locrian_major, :lydian, :lydian_minor, :mahur, :major, :major_pentatonic, :marva, :melodic_major, :melodic_minor, :melodic_minor_asc, :melodic_minor_desc, :messiaen1, :messiaen2, :messiaen3, :messiaen4, :messiaen5, :messiaen6, :messiaen7, :minor, :minor_pentatonic, :mixolydian, :muhayyer, :neapolitan_major, :neapolitan_minor, :neva, :neva_2, :nihavend, :nihavend_2, :octatonic, :pelog, :phrygian, :prometheus, :purvi, :rast, :ritusen, :romanian_minor, :saba, :scriabin, :sedaraban, :sedaraban_2, :segah, :segah_2, :sehnaz, :sehnaz_2, :sehnaz_3, :sehnaz_4, :sevkefza, :sevkefza_2, :sevkefza_3, :shang, :spanish, :sultani_yegah, :sultani_yegah_2, :super_locrian, :suzidil, :suzidil_2, :suznak, :suznak_2, :tahir, :tahir_2, :todi, :ussak, :uzzal, :uzzal_2, :whole, :whole_tone, :yegah, :yegah_2, :yu, :zhi, :zirguleli_hicaz, :zirguleli_hicaz_2, :zirguleli_suznak, :zirguleli_suznak_2, :zirguleli_suznak_3).tick
  puts trial
  play_pattern (scale :C4, trial)
  sleep 3
end

```

And the @amiika code you linked to? I’ll be studying that for awhile. I try to stare at the code to understand what it’s doing before running it and I got halfway through that script before my brain exploded. Lots to learn 😉

---

<div class="post-metadata">

**Author:** ![jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jonny](https://in-thread.sonic-pi.net/u/jonny)\
**Post date:** [September 29, 2023, 2:13pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/10 "2023-09-29T14:13:53Z")

</div>

Hi! Thanks for sharing! Lots indeed!

- Everything is an object, or an instance of
- Classes are the blueprints from which all objects are made
- We are people, instances of a Person class!
- Methods are things that can be done with/by/to things (we can think)

> [@](#):
>
> detuned all the scales to C256

Is that the `:C4` option you pass to the scale (method used by the play\_pattern method)?

💡 If you’ve listed **all** the scale names in the trial ring variable, you can also do

```ruby
live_loop :scales do
  puts "loop #{tick}, #{scale_names.look}" #look looks at tick but doesn't update it
  play_pattern (scale :C4, scale_names[look]) #play pattern from scale#0,1,2
  sleep 3
end

```

Venturing into music theory territory, fascinating stuff (hopefully more on this soon!)

---

<div class="post-metadata">

**Author:** ![onesinglecircle](https://avatars.discourse-cdn.com/v4/letter/o/e0b2c6/32.png) [@onesinglecircle](https://in-thread.sonic-pi.net/u/onesinglecircle)\
**Post date:** [October 2, 2023, 7:21pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/11 "2023-10-02T19:21:34Z")

</div>

Hi @Jonny,

Apologies for the delay. And thanks for that poetic introduction to object-oriented programming 🤔

I’m still learning words in Ruby / Sonic Pi so I’m doing math in excel till my grammar improves. For that first run I detuned A440Hz by 37cents to flatten the C note from 261.63Hz to 256Hz.

In excel, I went further and created an equal temperament scale with C256Hz as the source and the 12th root of two to create the twelve notes leading to C512Hz.

With these I made a list to play a scale, panned all the notes hard left and then produced a set of ‘best match’ natural harmonics (also in excel) and panned those to the right so I could listen and compare.

As expected, the tonic, the fifth and the octave were the only notes that matched well. All the other notes more or less clashed with their counterparts, some different enough to make beats.

This is more about the physics of sound and teaching math & music to kids than it is about tuning standards. History is filled with attempts to create a proper scale and equal temperament has proven to be the most efficient but whole number ratios are still the strongest and most pleasing so we should never stop looking at alternatives.

For myself, I’ve got my eye (I mean ear) on Hydrogen.

---

<div class="post-metadata">

**Author:** ![jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jonny](https://in-thread.sonic-pi.net/u/jonny)\
**Post date:** [October 4, 2023, 11:50am UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/12 "2023-10-04T11:50:18Z")

</div>

Thanks!!! we’re on similar paths (although I suspect your knowledge and understanding far exceeds mine, re the math of music…

This is amazing (not SP, just re sound and temperament, and the rationale behind the ratios and their gratification)  
Hopefully others will enjoy 🙂

[![](https://img.youtube.com/vi/EdYzqLgMmgk/maxresdefault.jpg "How Pythagoras Broke Music (and how we kind of fixed it) [see comments for corrections]") ](https://www.youtube.com/watch?v=EdYzqLgMmgk)

❓ Can I ask, was there significance in the 37cent reduction?  
Eg why 37, how was that number/interval (or offset) found?

If you have any sheets (xlsx) or snippets (.rb) or links to projects (github etc) I’d be quite interested in seeing.

👌

---

<div class="post-metadata">

**Author:** ![jonny](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jonny](https://in-thread.sonic-pi.net/u/jonny)\
**Post date:** [October 4, 2023, 12:11pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/13 "2023-10-04T12:11:51Z")

</div>

Hi again, apologies for littering the forums with stuff but wanna quickly ask before I forget

(@robin.newman you may know this)  
With sp (or maybe only in sc, eg in synthdef)

~Is there a way~ how can you work with waveforms?

I’m thinking about things like masks, like XOR gates, if any of that nomenclature helps!

pseudo

```ruby
 #define waves
wave1 =sine 1 
wave2 = sine 1 

#call method on wave using mask wave2 as param

wave3 = wave1.mask wave2
play wave3 #silence, as identical wave masked

```

Eg simple def example(s) to do things like

- play note/pitch/ratio of a tone given a waveform type, length in time, number of cycles

This could demoed in a simple live that iterates over indexes or ticks, to make the sounds with the ratios, to play tones and hear the sound of the intervals eg (in loop or defined method called from within live\_loop)

```ruby
#i,j = 0
1.10 times do |I|
 1.10 times do |j|
  play ratio_to_pitch i/j , wave: wave3
 end; end

```

Tldr is there a good primer for sc?!  
Thanks!

---

<div class="post-metadata">

**Author:** ![onesinglecircle](https://avatars.discourse-cdn.com/v4/letter/o/e0b2c6/32.png) [@onesinglecircle](https://in-thread.sonic-pi.net/u/onesinglecircle)\
**Post date:** [October 4, 2023, 5:57pm UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/14 "2023-10-04T17:57:22Z")

</div>

Hi @jonny,

Quick answer:

Cents = 1200 x log2 (freq A / freq B)

In my case I wanted to find the difference between middle C (261.6356) and the number 1 (or its octave relation, 256).

More will follow as we’ve touched on a favourite topic of mine but we should start a new thread at some point ;}

---

<div class="post-metadata">

**Author:** ![nordicwing](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@nordicwing](https://in-thread.sonic-pi.net/u/nordicwing)\
**Post date:** [July 22, 2025, 8:58am UTC](https://in-thread.sonic-pi.net/t/list-all-symbols/8136/15 "2025-07-22T08:58:10Z")

</div>

may I ask why function names in ruby don’t need to be prefixed with a colon, but in sonic pi when defining a function, we need to use a colon in front of their names? (also function names like play, use\_synth don’t have prefixed colons)
