Skip to content

Commit

Permalink
Make crow clock out always rise on the given division. (#1497)
Browse files Browse the repository at this point in the history
* Make crow clock out always rise on the given division.

Previously, it would either rise on the division and fall halfway
between the divisions or vice versa, and which one would be based on
the vagueries of timing.

* Actually only do it if crow out is enabled
  • Loading branch information
sixolet authored Jan 12, 2022
1 parent 5e9b780 commit 789e300
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/core/clock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,13 @@ function clock.add_params()

-- executes crow sync
clock.run(function()
local v = 0
while true do
clock.sync(1/(2*params:get("clock_crow_out_div")))
clock.sync(1/params:get("clock_crow_out_div"))
local crow_out = params:get("clock_crow_out")-1
if crow_out > 0 then
crow.output[crow_out].volts=v
v = (v==0) and 10 or 0
crow.output[crow_out].volts = 10
clock.sleep(60/(2*clock.get_tempo()*params:get("clock_crow_out_div")))
crow.output[crow_out].volts = 0
end
end
end)
Expand Down

0 comments on commit 789e300

Please sign in to comment.