You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/server/ruby/lib/sonicpi/lang/core.rb
+32-3Lines changed: 32 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -3898,22 +3898,51 @@ def current_random_source
3898
3898
puts rand # => 0.10821533203125
3899
3899
puts rand # => 0.54010009765625
3900
3900
"]
3901
+
defcurrent_bpm_mode
3902
+
__get_spider_bpm_mode
3903
+
end
3904
+
docname: :current_bpm_mode,
3905
+
introduced: Version.new(4,0,0),
3906
+
summary: "Get current tempo mode",
3907
+
doc: "Returns the current tempo mode - either a bpm value or :link.
3901
3908
3909
+
To know the current BPM value when this thread is in :link mode see `current_bpm`.
3902
3910
3903
-
defcurrent_bpm
3911
+
This can be set via the fns `use_bpm`, `with_bpm`, `use_sample_bpm` and `with_sample_bpm`.",
3912
+
args: [],
3913
+
opts: nil,
3914
+
accepts_block: false,
3915
+
examples: ["
3916
+
use_bpm 60
3917
+
puts current_bpm_mode # => 60
3918
+
use_bpm 70
3919
+
puts current_bpm_mode # => 70
3920
+
use_bpm :link
3921
+
puts current_bpm_mode # => :link"]
3922
+
3923
+
3924
+
3925
+
defcurrent_bpm
3904
3926
__get_spider_bpm
3905
3927
end
3906
3928
docname: :current_bpm,
3907
3929
introduced: Version.new(2,0,0),
3908
3930
summary: "Get current tempo",
3909
-
doc: "Returns the current tempo as a bpm value.
3931
+
doc: "Returns the current tempo as a bpm value. If the thread is in :link bpm mode, this will return the latest bpm value of the shared Link network metronome (note that this value may change after reading if the Link bpm isn't static).
3932
+
3933
+
To know if this thread is in :link or standard bpm mode see `current_bpm_mode`.
3910
3934
3911
3935
This can be set via the fns `use_bpm`, `with_bpm`, `use_sample_bpm` and `with_sample_bpm`.",
3912
3936
args: [],
3913
3937
opts: nil,
3914
3938
accepts_block: false,
3915
3939
examples: ["
3916
-
puts current_bpm # Print out the current bpm"]
3940
+
use_bpm 60
3941
+
puts current_bpm_mode # => 60
3942
+
use_bpm 70
3943
+
puts current_bpm_mode # => 70
3944
+
use_bpm :link
3945
+
puts current_bpm_mode # => 120 (or whatever the current Link BPM value is)"]
0 commit comments