Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flow3r
flow3r firmware
Commits
33b64843
Commit
33b64843
authored
1 year ago
by
moon2
Browse files
Options
Downloads
Patches
Plain Diff
harmonic demo: indicators light up as long as petal/note is held
parent
179440cb
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!240
harmonic demo: indicators light up as long as petal/note is held
Pipeline
#7418
passed
1 year ago
Stage: check
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python_payload/apps/harmonic_demo/__init__.py
+18
-26
18 additions, 26 deletions
python_payload/apps/harmonic_demo/__init__.py
with
18 additions
and
26 deletions
python_payload/apps/harmonic_demo/__init__.py
+
18
−
26
View file @
33b64843
...
...
@@ -27,7 +27,6 @@ class HarmonicApp(Application):
def
__init__
(
self
,
app_ctx
:
ApplicationContext
)
->
None
:
super
().
__init__
(
app_ctx
)
self
.
color_intensity
=
0.0
self
.
chord_index
=
0
self
.
chord
=
None
self
.
cp_prev
=
captouch
.
read
()
...
...
@@ -81,7 +80,7 @@ class HarmonicApp(Application):
ctx
.
move_to
(
start_pos
.
imag
,
start_pos
.
real
)
ctx
.
quad_to
(
mid_pos
.
imag
,
mid_pos
.
real
,
end_pos
.
imag
,
end_pos
.
real
)
ctx
.
stroke
()
ctx
.
move_to
(
pos
.
imag
,
pos
.
real
)
ctx
.
move_to
(
pos
.
imag
*
1.07
,
pos
.
real
*
1.07
)
ctx
.
rgb
(
1
,
0.5
,
0
)
ctx
.
text
(
note_name
)
...
...
@@ -108,33 +107,26 @@ class HarmonicApp(Application):
def
think
(
self
,
ins
:
InputState
,
delta_ms
:
int
)
->
None
:
super
().
think
(
ins
,
delta_ms
)
if
self
.
color_intensity
>
0
:
self
.
color_intensity
-=
self
.
color_intensity
/
20
cts
=
captouch
.
read
()
for
i
in
range
(
5
):
if
self
.
fade
[
i
]
>
0
:
self
.
fade
[
i
]
-=
self
.
fade
[
i
]
*
float
(
delta_ms
)
/
1000
if
self
.
fade
[
i
]
<
0.01
:
self
.
fade
[
i
]
=
0
cp
=
captouch
.
read
()
for
i
in
range
(
10
):
j
=
(
10
-
i
)
%
10
if
cts
.
petals
[
j
].
pressed
and
(
not
self
.
cp_prev
.
petals
[
j
].
pressed
):
if
cp
.
petals
[
j
].
pressed
:
if
not
self
.
cp_prev
.
petals
[
j
].
pressed
:
if
i
%
2
:
k
=
int
((
i
-
1
)
/
2
)
self
.
_set_chord
(
k
)
self
.
_set_chord
(
i
//
2
)
else
:
k
=
int
(
i
/
2
)
self
.
synths
[
k
].
signals
.
pitch
.
tone
=
self
.
chord
[
0
][
k
]
self
.
synths
[
k
].
signals
.
trigger
.
start
()
self
.
fade
[
k
]
=
1
self
.
color_intensity
=
1.0
elif
(
not
cts
.
petals
[
j
].
pressed
)
and
self
.
cp_prev
.
petals
[
j
].
pressed
:
if
(
1
+
i
)
%
2
:
k
=
int
(
i
/
2
)
self
.
synths
[
k
].
signals
.
trigger
.
stop
()
self
.
cp_prev
=
cts
self
.
synths
[
i
//
2
].
signals
.
pitch
.
tone
=
self
.
chord
[
0
][
i
//
2
]
self
.
synths
[
i
//
2
].
signals
.
trigger
.
start
()
self
.
fade
[
i
//
2
]
=
1
elif
not
i
%
2
:
if
self
.
fade
[
i
//
2
]
>
0
:
self
.
fade
[
i
//
2
]
-=
self
.
fade
[
i
//
2
]
*
float
(
delta_ms
)
/
1000
if
self
.
fade
[
i
//
2
]
<
0.05
:
self
.
fade
[
i
//
2
]
=
0
if
self
.
cp_prev
.
petals
[
j
].
pressed
:
self
.
synths
[
i
//
2
].
signals
.
trigger
.
stop
()
self
.
cp_prev
=
cp
def
on_enter
(
self
,
vm
:
Optional
[
ViewManager
])
->
None
:
# super().on_enter(vm) idk not using it in shoegaze, works fine?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment