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
Hot on the heals of v4.0.1 here's another bugfix release addressing an issue with the translations.
36
+
37
+
During the last year there has been significant upheaval of the process used to build Sonic Pi. Somehow, during this upheaval, the translations never got added into the final release builds, despite being part of the dev builds. This has been true since v4.0 BETA 1 back in August 2021 - yet it somehow went unnoticed until now. Apologies! This release fixes this and re-introduces the translations which are so important for lowering the barrier to entry across the world.
38
+
39
+
As a bonus, a couple of nice improvements also managed to sneak in for good measure. Have fun!
40
+
41
+
### GUI
42
+
* All the translations are now available again - including the vast amount of new translation effort since v3.3.1 was released.
43
+
* Loading a file no longer erases the undo history. This means that you can now "undo" a file load in the current buffer and return it to the state prior to the load.
44
+
* The BPM-scrubbing behaviour (clicking your mouse and dragging to change the BPM) has been tweaked to make it easier to use.
45
+
* Improvements for the Portuguese translation.
46
+
47
+
28
48
<aname="v4.0.1"></a>
29
49
30
50
## Version 4.0.1 'Verknüpfen'
@@ -37,6 +57,7 @@ We also sadly say goodbye to Core Team member Hanno Zulla who did amazing work w
37
57
38
58
This release also includes Italian and Polish translation updates.
Copy file name to clipboardExpand all lines: app/server/ruby/lib/sonicpi/lang/core.rb
+23-10Lines changed: 23 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -2751,7 +2751,9 @@ def define(name, &block)
2751
2751
raiseArgumentError,"A function called #{name} is already part of Sonic Pi's core API. Please choose another name."
2752
2752
end
2753
2753
2754
-
raiseArgumentError,"Function names can't start with a capital letter."ifname.to_s =~ /^[A-Z]/
2754
+
ifblock.arity == 0 && name.to_s =~ /^[A-Z]/
2755
+
__delayed_warning"Functions with no required parameters shouldn't start with a capital letter."
2756
+
end
2755
2757
2756
2758
ifalready_defined
2757
2759
__info"Redefining fn #{name.inspect}"
@@ -2768,7 +2770,9 @@ def define(name, &block)
2768
2770
accepts_block: true,
2769
2771
requires_block: true,
2770
2772
intro_fn: true,
2771
-
doc: "Allows you to group a bunch of code and give it your own name for future re-use. Functions are very useful for structuring your code. They are also the gateway into live coding as you may redefine a function whilst a thread is calling it, and the next time the thread calls your function, it will use the latest definition.",
2773
+
doc: "Allows you to group a bunch of code and give it your own name for future re-use. Functions are very useful for structuring your code. They are also the gateway into live coding as you may redefine a function whilst a thread is calling it, and the next time the thread calls your function, it will use the latest definition.
2774
+
2775
+
Note, it is not recommended to start a function name with a capital letter if it takes no parameters.",
2772
2776
examples: ["
2773
2777
# Define a new function called foo
2774
2778
define :foo do
@@ -2783,7 +2787,16 @@ def define(name, &block)
2783
2787
# For example, in a block:
2784
2788
3.times do
2785
2789
foo
2786
-
end",]
2790
+
end",
2791
+
2792
+
"
2793
+
# Define a new function called play2, taking one parameter
2794
+
define :play2 do |x|
2795
+
play x, release: 2
2796
+
end
2797
+
2798
+
# Call play2, passing in a value for the parameter
2799
+
play2 42"]
2787
2800
2788
2801
2789
2802
@@ -4085,13 +4098,13 @@ def beat
4085
4098
opts: nil,
4086
4099
accepts_block: false,
4087
4100
examples: ["
4088
-
use_bpm 120 # The current BPM makes no difference
4089
-
puts beat #=> 0
4090
-
sleep 1
4091
-
puts beat #=> 1
4092
-
use_bpm 2000
4093
-
sleep 2
4094
-
puts beat #=> 3"]
4101
+
use_bpm 120 #=> The initial beat does not start at 0
4102
+
puts beat #=> 109252.703125
4103
+
sleep 1
4104
+
puts beat #=> 109253.703125
4105
+
use_bpm 2000 # Changing the BPM makes no difference
0 commit comments