Play_pattern_timed time (rtfm)

Hi,

What do you think of the strange behaviour ? Spi 3.3.1 on windows 10.

live_loop :issuePatternTimed do
  
  use_synth :piano
  
  
  # this works
  play_pattern_timed [:c, :g, :c5, :g5], [1, 2]
  sample :drum_cymbal_hard
  sleep 2
  
  # this doesn't
  # example4 in the doc claims it should plays as far as there are some durations right ?
  use_synth :sine
  play_pattern_timed [60, 65], [0.125, 0.125, 0.5, 0.5, 1, 1, 1.5, 1.5]
  sample :drum_cymbal_hard
  sleep 2
  
  # the idea was to use a variable
  use_synth :saw
  n = (scale :c4, :ritusen).tick
  puts n
  play_pattern_timed [n], [0.25, 2, 0.25, 0.75]
  sample :drum_cymbal_hard
  sleep 2
end

Cheers

The number of notes played is determined by the first argument of play_pattern_timed. Putting more times won’t play more notes. Use e.g.:

play_pattern_timed (knit 60, 4, 65, 4),  [0.125, 0.125, 0.5, 0.5, 1, 1, 1.5, 1.5]

or

play_pattern_timed [60, 65]*4,  [0.125, 0.125, 0.5, 0.5, 1, 1, 1.5, 1.5]

Oupss my bad,

image

i just don’t read :slight_smile:
So i delete this post in 5 minutes

Why delete? People want to learn from reading posts …

Ok so

how to play each note of a scale via play_pattern_timed ?

live_loop :melody do
  use_bpm 180
  use_synth_defaults sustain: [1, 0.5, 0.2].tick, amp: 8
  with_fx :echo, mix: [0.25, 0.5].tick('m'), phase: 1.25 do
    use_synth :kalimba
    play_pattern_timed (scale :c4, :ritusen), [0.25, 2, 0.25, 0.75]
  end
end

Let’s have a little sleep

1 Like