My first Sonic PI song, well .... tryout after reading the tutorial

Excellent! I find it very rich, in terms of rhytm, harmonies and sound. You can run it for many minutes and still it produces new aspects.

In the code you are asking Dunno if there is a max/min function? Here it is:

[th, 130].min
[th, 20].max

Whatever the value of th is, the first line ensures that you won’t get more than 130, the second line always gives you at least 20.

2 Likes

Hi Eli, I know it is difficult for non-mathematically-minded people to follow the discussion. Therefore, a short explanation here: Think of a Markov chain just as a tool to randomly generate sequences of chords or notes. And what is the difference to the usual [...].choose or [...].pick? Well, the choice depends on the previous chord/note being played right now. This way, you can make an :D3 following a :C3 more likely than using just [:C3, :D3, ..., :B3].choose. That’s basically all you need to know. :wink:

Thank you :slight_smile:
To be honest, I am more into blues, but I like to experiment with computerized music, but mostly I listen to blues :slight_smile:

Thank you very much for your kind words and also for you taking the time to actually read the code and the comments! Thanks for the min/max tip, another thing learned :wink:

Thank you very much, I hope I can bring you and the others more stuff =)

1 Like

I very much like blues to play along with the guitar. Therefore I created some pieces with Sonic Pi that play the blues but without the voice (see for example here)

Really cool track! :+1: I particularly like the slow organ-like melody. I would tend to call it high-speed drum and bass (due to the amen break).

1 Like

Thank you :slight_smile:

That is cool!! Man, Sonic PI is really cool! I was not aware that it was this cool! Only thing I really miss is a better performance, so … I guess someone could really rewrite this in C++, or … better yet: Rust

I am still going through the tutorial, learning a lot and getting some ideas. The way the tutorial is written also clear illustrates that Sam is an awesome creative dude, focussing on having fun, i love it =)

What is your problem with Sonic Pi’s performance? So far (on a laptop), I did not scratch the limits. But I am also fairly new to it. Actually, most of Sonic Pi is written in C++.

Being a big fan of Rust too, its use would definitely lower the barrier to contribute for me. IIRC correctly, in a talk or interview Sam mentioned to indeed plan to rewrite a certain part in Rust. But not really sure here…

Well, I noticed with a BPM of 60 for instance, I can’t have a sleep below 0.1 driven correctly in a loop, so I wanted to create a fast drumroll for instance and that doesn’t work. I need to create a sample for that :frowning:
But then again, I am very impressed by the thread system, I love that!
I run it on a laptop, but maybe my laptop is just slow…

Try this:

use_debug false
live_loop :fast, auto_cue: false do
  density 10 do
    play :e4, release: 0.1
    sleep 1
  end
end

Disable the debug output and change the time scale using density

1 Like

Nechoj is right…

Density is a very very good way of writing ‘drops’… you simply
change the density on the beat, maybe change the amp, and it
powers up to the drop, then you flip amp to 0, pull in an ethereal sample,
then put density back to 1, and carry on the track…

Eli…

Like that?

use_debug false
live_loop :fast, auto_cue: false do
  
  tick_reset
  density 16 do
    sample :drum_snare_hard, amp: (range 0.1, 1.8, 0.1).tick
    sleep 2
  end
  
  sleep 0.25
  sample :drum_snare_hard, amp: 0.8
  sleep 0.125
  sample :drum_cymbal_open
  sample :guit_em9
  sleep 4
end

(I am not so good at ethereal things …)

Wow, that is an awesome trick! Thank you very much Jochen! :slight_smile:

Ah yes, I altered it a bit to about something I want:

use_debug false
live_loop :fast, auto_cue: false do
  
  tick_reset
    
  min_r=2.0
  max_r=40.0
  steps=8.0
  counts=(max_r-min_r)/steps
  min_a=0.1
  max_a=1.0
  steps_a=(max_a-min_a)/counts
  dampening_a=5.0
  
  counts.times do
    density (range min_r,max_r,steps).tick do
      sample :drum_snare_hard, amp: (range min_a, max_a, steps_a/dampening_a).look
      sleep 1
    end
  end
  sample :drum_cymbal_open
  sample :guit_em9
  sleep 4
end
1 Like

Hi Nechoj.

Thank you so much for classifying me as ‘non-mathematically-minded’.

In truth, despite being taught quadratic equations in school… I’ve never
actually used one in ‘real life’, in the 63 years I’ve been alive.

Markov chains are not a mystery to me… but my viewpoint is, that
this forum is a gateway for new users to Sonic Pi.

If their first encounter on this forum, is a technical dissertation on Markov,
or a 10 page document on Midi input and output codes, then I can see
them simply walking away from Sonic Pi.

And what a terrible loss that would be.

Regards.

Eli… (the non-mathemathically-minded).

1 Like

Hi again @Nechoj, if nobody has thanked you recently, I just wanted to say that I really appreciate your efforts as a teacher :blush: I think there’s definitely a place for everyone who’s tolerant and open to learning and sharing ideas in this forum. Sonic Pi users are the best! They’re kind and genuinely committed to their craft.

Anyone who takes a cursory glance at the diverse and interesting topics on this forum and loses interest right away… well, they’re always welcome back when they change their mind, because Sonic Pi is going to keep growing.

I think what’s important is that we welcome new arrivals and direct them to the resources appropriate to their knowledge. No one knows everything, and I’m grateful that we all have each other to learn from. Towards this end, I think your contributions are every bit as important and vital to the success of Sonic Pi as cool projects and, OMG, programmed drops! EDM forever :black_heart:

There’ll come a day when this forum will be bustling with too many new ideas for me to scroll through. Creative minds everywhere will be busy melding and evolving together. I’m happy to help the forum grow to that point :’) because I feel welcome here, and I want to pay it forward, all the things I have to be grateful for.

1 Like

Thanks a lot :blush:, very kind of you. I just try to give back a bit of what I have received previously. All I know about SPi I learned from the amazing contributions of you guys. The forum allows newbies to ramp up with warp speed.

1 Like

Hi Eli,
sorry, I didn’t mean to classify you. We are all on a journey and who knows, maybe next year you’ll be using Markov chains? :wink:

I started as a musician and then became a theoretical physicist. This changed my mind (literally) and perception of the world. Whenever I see beautiful things I also see the math in it. When looking at a nice flow a fresh and clean water I wonder how nature manages to solve all these partial differential equations in real-time. And when I came to SPi, this was like waking up an a new planet, unseen before. It’s like when a gardener discovers a previously hidden garden full of flowers, some known, some unknown, all beautiful. I see separate things coming together and joining in a seamless way: random processes, rings of numbers, harmonies and scales, number theory … Suddenly a voice in my head tells me: Apply Roger Penrose’s forbidden symmetries to rhythms!! And the best thing is you can convert it into sound and make it accessible to people without any math background. I can tell my wife: Listen, this is a Markov chain. Isn’t that fascinating?

So the journey goes on …