CPU issues on Mac

Hello All!
I’ve a question about the CPU consumed. I’ve run a popular code found on internet, but my MacBook Pro Retina Mid 2014 with 128gb SSD, i5, 8gb ram and OSX Sierra 10.12.6 have serious audio glitches. The code is about a dub/techno song. Is it a problem of my slow computer or maybe the code?

Thanks

1 Like

Hi Sten,

could you provide the code/a link to it so that others can try it out themselves?

I have a Lenovo with i7, 16 GB Ram but with enough creativity and live_loops it is not to hard to overload it and produce xruns. (I always try to embrace this limitation as a hint that I have to do it some other way. With more or less success.)

Martin

of course! the code is in the following link:

I can listen it but i can’t do anything else without generate audio glitches…even just scroll the code…

Thank you!

I’m having a similar issue with a macbook retina mid 2014. mine is an i-7 2.2ghz with 16g of ram. It seems to run fine on it’s own, but as soon as I try to open any other software (streaming software, I start getting the audio glitches. I had a lot of weird problems with the Atom text editor as well, and that was specific to this range of macbooks.

Starting to hate my macbook lol

Please check out section 6.2 of the built-in tutorial.

It’s likely that you’re triggering a lot of current FX that when added together consume all your CPU. The thing to be aware of is that every time with_fx is called, a new FX synth is triggered that has its own life span.

1 Like

I’m running a MacBook Pro Mid 2017, 13", 16 GB RAM, 3,1GHz i5 and Mac OS Sierra 10.12.6. I can easily run the above mentioned dub techno code without any problems.

I noticed one other thing though: When Sonic Pi GUI is drawn on the retina display of my laptop it is significantly slower (some noticeable latency when typing / sluggish scrolling) than using an external monitor. If I move the Sonic Pi GUI to my external monitor (just with basic 1080p resolution) it gets much smoother again. This is with audio running in the background.

I didn’t have this problem with my old non-retina MacBook Pro MID 2012 (also with Mac OS Sierra). So it seems the retina display and Intel graphics chips can slow things down a lot…

1 Like

Yep, I’ve noticed the extra latency with the latest MacBook Pro - I’m not entirely sure what’s causing it yet, but it’s definitely frustrating.

1 Like

Runs fine on my MBP i7 2.8GHz with 16Gb RAM. I do notice that the scope display freezes momentarily when I scroll the SP buffer screen, but plays fine. I think you are fairly near the limit with lots of nested fx, especially in live_loop :synth
I tried the external monitor, and didn’t detect much difference, but I think is was perhaps slightly more responsive.

I think this would have difficulties running on a Pi!

,

#RattleBladeBase

use_bpm 120

live_loop :SinkIt do
sleep dice
end

live_loop :BaseKick do
kick_cutoffs = range(80, 120, 4).mirror
zempel = [:bd_tek, :bd_fat, :drum_cymbal_pedal].choose
with_fx [:ixi_techno, :reverb].choose, reps: 4 do
sample zempel,
amp: rrand(0.4,0.8),
release: 0.125,
cutoff: kick_cutoffs.look
#sleep [0.25, 0.5].choose
sleep 1
end
end

sleep dice

live_loop :SleepKick do
sync :SinkIt
kick_cutoffs = range(60, 110, 8).mirror
zempel = [:drum_bass_hard, :drum_bass_soft].choose
zompel = [:drum_cymbal_open, :drum_cymbal_pedal].choose
with_fx [:ixi_techno, :reverb].choose, reps: 4 do
sample [zempel, zompel].choose,
amp: rrand(0.6,1.1),
release: dice,
cutoff: kick_cutoffs.look
#sleep [0.25, 0.125, 0.5, 0.125, 0.125, 0.5, 0.25,2].choose
sample [zempel, zompel].choose,
amp: rrand(0.8,1.4),
release: [0.25, 0.125, 0.5, 0.125, 0.125, 0.5, 0.25,2].choose,
cutoff: kick_cutoffs.look
sleep dice
end
end

sleep dice

live_loop :HollowWaveAmbience do
sync :BaseKick
if (spread 3, 8).tick then
# (spread 3, 8) produces this pattern: * _ _ * _ _ * _
with_fx [:ixi_techno, :reverb].choose, reps: 4, cutoff: 125, res: 0.8 do
with_synth [:hollow, :dark_ambience].choose do
play :d3, amp: rrand(0.4,0.8),
attack: 0.15, decay: 0.28, release: dice
end
end
end
sleep dice
end

dchord = chord(:d2, :minor, num_octaves: 3)
synth_cutoffs = range(70, 110, 2.5).mirror
synth_rhythm = (ring 1.5, 2.5, 1)
synth_transpositions = (stretch 0, 36) + (stretch -12, 6) + (stretch 12, 6)
synth_phases = (stretch 0.75, 15) + [0.25]
synth_pans = (ring -0.5, 0.5)
live_loop :Sintje do
sync :SinkIt
ch = invert_chord(dchord, rand_i(3))
sleep synth_rhythm.tick
with_fx :echo, amp: rrand(0.2,0.8), mix: 0.3,
decay: 8, phase: synth_phases.look do
with_fx :pan, pan: synth_pans.look do
with_fx :reverb, room: 0.7, amp: rrand(0.2,1.2) do
with_synth_defaults attack: 0.05, release: 0.3 do
with_transpose synth_transpositions.look do
with_synth :fm do
play_chord ch
end
cutoff = synth_cutoffs.look
with_fx :ixi_techno, cutoff_min: cutoff,
cutoff_max: cutoff - 30, phase: 1, res: 0.3 do
with_synth :blade do
play_chord ch, attack: 0.1
end
end
end
end
end
end
end
end

sleep dice

live_loop :NoiseHats do
sync :BaseKick

Create hi-hats by slicing continuous noise

with_fx :slicer, mix: 1, phase: 0.25, pulse_width: 0.1, reps: 8 do
with_fx :hpf, cutoff: 130, reps: 8 do
with_synth :gnoise do
play 28, decay: 1, amp: 1
end
end
end
sleep dice+dice
end

sleep 4

live_loop :OpenHatCut do
sync :BaseKick
ohc = range(108, 128, 2).mirror
with_fx :echo, amp: 1,
mix: 0.4, decay: 4, phase: 0.75 do
with_fx :hpf, cutoff: ohc.tick, reps: 4 do
with_fx :reverb, mix: 0.4, room: 0.8, reps: 4 do
sleep 0.5
sample :drum_heavy_kick, start: 0.12, finish: 0.38, amp: rrand(1.2,2.2)
sleep 0.5
end
end
end
sleep dice
end

sleep dice

beep_notes = (ring :d2, :d3, :f2, :e2, :d3, :g2)
live_loop :BiepsA do
sync :SinkIt
sleep 0.5
with_fx :reverb do
with_synth :blade do
play beep_notes.tick, amp: rrand(0.01,0.6),
decay: 0.2, release: rrand(0.01,0.35)
end
end
sleep 0.5
end

beep_notes = (ring :d3, :d2, :f3, :e3, :d2, :g3)
live_loop :BiepsB do
sync :SinkIt
sleep dice
with_fx :reverb do
with_synth :fm do
play beep_notes.tick, amp: rrand(0.01,0.6),
decay: rrand(0.2,0.4), release: rrand(0.01,0.45)
end
end
sleep dice
end

beep_notes = (ring :d2, :d3, :f2, :e2, :d3, :g2)
live_loop :BiepsC do
sync :SinkIt
sleep dice
with_fx :distortion do
with_synth :beep do
play beep_notes.tick, amp: rrand(0.1,0.8),
decay: rrand(0.1,0.3), release: rrand(0.01,0.35)
end
end
sleep dice
end

,