Skip to content

Commit 75a71d2

Browse files
committed
Docs - fix use/with_real_time examples
Previously, the examples for the use_real_time and with_real_time functions were both misleading - they demonstrated incorrect usage and described incorrect behaviour. They have now been updated.
1 parent 05e5651 commit 75a71d2

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)