Skip to content

Commit

Permalink
Merge pull request #12 from apawate/main
Browse files Browse the repository at this point in the history
Improved octave lines.
  • Loading branch information
phuang1024 committed Sep 12, 2021
2 parents af5bcb9 + 8303448 commit 5bae8f5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/pvkernel/addons/blocks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ def execute(self, video: Video) -> None:
props = video.props.blocks
half = video.resolution[1] // 2

if props.octave_lines:
for note in range(3, 88, 12):
x, _ = video.data.core.key_pos[note]
video.render_img[:half, int(x), ...] = 55

if props.style == "SOLID":
draw_block_solid(video)
else:
Expand All @@ -129,6 +124,13 @@ def execute(self, video: Video) -> None:
v = np.interp(y, [0, 250], [0.65, 1])
video.render_img[y, ...] = video.render_img[y, ...] * v

if props.octave_lines:
for note in range(3, 88, 12):
x, _ = video.data.core.key_pos[note]
for y in range(half):
for ch in range(3):
video.render_img[y, int(x), ch] = max(video.render_img[y, int(x), ch], 55)


class BUILTIN_JT_Blocks(pv.Job):
idname = "blocks"
Expand Down

0 comments on commit 5bae8f5

Please sign in to comment.