Here is an simple (if I am honest, because of a lack of musical ability) piece I have been play with. You can end up playing for hours trying out different sounds, synths, effects etc.
sample :ambi_choir, rate: 0.1, attack: 4, release: 4
2. times do
sample :bass_trance_c, amp: 0.75, release: 3
sample :bass_trance_c, rate: 0.5, amp: 0.5, release: 5
sample :bass_trance_c, rate: 0.3, amp: 0.25, release: 9
Here is the sneaky bit, even in the code above there a mixture of threads, loops, sequences as well designing of the 'shape' of the sounds.
There is also a community producing material/examples. For example at https://gist.github.com/rbnpi/7713ac59ed553d3f336e you can find code for the Star Wars theme. It is very hard to resist playing with the theme and adding drums, etc.
There are some great tutorials available on The MagPi magazine site https://www.raspberrypi.org/magpi/issues/
All views are those of the author and should not be seen as the views of any organisation the author is associated with.