Skip to content

Commit 98571f3

Browse files
authored
Merge pull request #2707 from ethancrawford/fix_real_time_examples
2 parents 05e5651 + 75a71d2 commit 98571f3

File tree

1 file changed

+6
-2
lines changed
  • app/server/ruby/lib/sonicpi/lang

1 file changed

+6
-2
lines changed

app/server/ruby/lib/sonicpi/lang/core.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4072,7 +4072,7 @@ def use_real_time
40724072
opts: nil,
40734073
modifies_env: true,
40744074
accepts_block: false,
4075-
examples: ["use_real_time 1 # Code will now run approximately 1 second ahead of audio."]
4075+
examples: ["use_real_time # Code will now produce sound without a scheduling delay."]
40764076

40774077

40784078
def with_real_time(&blk)
@@ -4101,8 +4101,12 @@ def with_real_time(&blk)
41014101
opts: nil,
41024102
modifies_env: true,
41034103
accepts_block: false,
4104-
examples: ["use_real_time 1 # Code will now run approximately 1 second ahead of audio."]
4104+
examples: ["
4105+
with_real_time do
4106+
play 70 # Sound will happen without a scheduling delay.
4107+
end
41054108
4109+
play 70 # Sound will happen with the default latency (0.5s)."]
41064110

41074111
def with_sched_ahead_time t, &blk
41084112
raise ArgumentError, "with_sched_ahead_time must be called with a do/end block. Perhaps you meant use_sched_ahead_time" unless blk

0 commit comments

Comments
 (0)