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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flow3r
flow3r firmware
Commits
f09b8817
Commit
f09b8817
authored
1 year ago
by
moon2
Browse files
Options
Downloads
Patches
Plain Diff
bl00mbox: fix sampler hang when recording and playing at the same time
parent
8e8c6215
No related branches found
No related tags found
1 merge request
!603
bl00mbox: fix sampler hang when recording and playing at the same time
Pipeline
#9378
passed
1 year ago
Stage: check
Stage: build
Stage: deploy
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/bl00mbox/radspa/standard_plugin_lib/sampler.c
+19
-5
19 additions, 5 deletions
components/bl00mbox/radspa/standard_plugin_lib/sampler.c
components/bl00mbox/radspa/standard_plugin_lib/sampler.h
+1
-0
1 addition, 0 deletions
components/bl00mbox/radspa/standard_plugin_lib/sampler.h
with
20 additions
and
5 deletions
components/bl00mbox/radspa/standard_plugin_lib/sampler.c
+
19
−
5
View file @
f09b8817
...
@@ -93,7 +93,7 @@ void sampler_run(radspa_t * sampler, uint16_t num_samples, uint32_t render_pass_
...
@@ -93,7 +93,7 @@ void sampler_run(radspa_t * sampler, uint16_t num_samples, uint32_t render_pass_
}
}
if
(
data
->
rec_active
){
if
(
data
->
rec_active
){
int16_t
rec_in
=
radspa_signal_get_value
(
rec_in_sig
,
i
,
render_pass_id
);
int16_t
rec_in
=
radspa_signal_get_value
(
rec_in_sig
,
i
,
render_pass_id
);
u
int32_t
write_head_pos
=
(
data
->
write_head_pos_long
*
699
)
>>
25
;
// equiv to x/48000 (acc 0.008%)
int32_t
write_head_pos
=
(
data
->
write_head_pos_long
*
699
)
>>
25
;
// equiv to x/48000 (acc 0.008%)
if
(
data
->
write_head_pos_prev
==
write_head_pos
){
if
(
data
->
write_head_pos_prev
==
write_head_pos
){
if
(
data
->
write_steps
){
if
(
data
->
write_steps
){
data
->
rec_acc
+=
rec_in
;
data
->
rec_acc
+=
rec_in
;
...
@@ -142,6 +142,7 @@ void sampler_run(radspa_t * sampler, uint16_t num_samples, uint32_t render_pass_
...
@@ -142,6 +142,7 @@ void sampler_run(radspa_t * sampler, uint16_t num_samples, uint32_t render_pass_
if
(
trigger
>
0
){
if
(
trigger
>
0
){
data
->
playback_active
=
true
;
data
->
playback_active
=
true
;
data
->
read_head_pos_long
=
0
;
data
->
read_head_pos_long
=
0
;
data
->
playback_sample_start
=
sample_start
;
data
->
volume
=
trigger
;
data
->
volume
=
trigger
;
if
(
output_mute
){
if
(
output_mute
){
radspa_signal_set_values
(
output_sig
,
0
,
i
,
0
);
radspa_signal_set_values
(
output_sig
,
0
,
i
,
0
);
...
@@ -161,8 +162,14 @@ void sampler_run(radspa_t * sampler, uint16_t num_samples, uint32_t render_pass_
...
@@ -161,8 +162,14 @@ void sampler_run(radspa_t * sampler, uint16_t num_samples, uint32_t render_pass_
if
(
read_head_pos
>=
sample_len
){
if
(
read_head_pos
>=
sample_len
){
if
(
buf
[
STATUS
]
&
(
1
<<
(
STATUS_PLAYBACK_LOOP
))){
if
(
buf
[
STATUS
]
&
(
1
<<
(
STATUS_PLAYBACK_LOOP
))){
while
(
read_head_pos
>
sample_len
){
while
(
read_head_pos
>
sample_len
){
if
(
sample_len
){
data
->
read_head_pos_long
-=
(
uint64_t
)
sample_len
*
48000
;
data
->
read_head_pos_long
-=
(
uint64_t
)
sample_len
*
48000
;
read_head_pos
-=
sample_len
;
read_head_pos
-=
sample_len
;
}
else
{
data
->
read_head_pos_long
=
0
;
read_head_pos
=
0
;
break
;
}
}
}
}
else
{
}
else
{
data
->
playback_active
=
false
;
data
->
playback_active
=
false
;
...
@@ -170,8 +177,15 @@ void sampler_run(radspa_t * sampler, uint16_t num_samples, uint32_t render_pass_
...
@@ -170,8 +177,15 @@ void sampler_run(radspa_t * sampler, uint16_t num_samples, uint32_t render_pass_
}
}
}
}
if
(
data
->
playback_active
){
if
(
data
->
playback_active
){
uint32_t
sample_offset_pos
=
read_head_pos
+
sample_start
;
uint32_t
sample_offset_pos
=
read_head_pos
+
data
->
playback_sample_start
;
while
(
sample_offset_pos
>=
sample_len
)
sample_offset_pos
-=
sample_len
;
while
(
sample_offset_pos
>=
sample_len
){
if
(
sample_len
){
sample_offset_pos
-=
sample_len
;
}
else
{
sample_offset_pos
=
0
;
break
;
}
}
ret
=
buf
[
sample_offset_pos
+
BUFFER_OFFSET
];
ret
=
buf
[
sample_offset_pos
+
BUFFER_OFFSET
];
if
(
read_head_pos_subsample
){
if
(
read_head_pos_subsample
){
ret
*=
(
64
-
read_head_pos_subsample
);
ret
*=
(
64
-
read_head_pos_subsample
);
...
...
This diff is collapsed.
Click to expand it.
components/bl00mbox/radspa/standard_plugin_lib/sampler.h
+
1
−
0
View file @
f09b8817
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
typedef
struct
{
typedef
struct
{
int64_t
write_head_pos_long
;
int64_t
write_head_pos_long
;
int64_t
read_head_pos_long
;
int64_t
read_head_pos_long
;
uint32_t
playback_sample_start
;
int16_t
pitch_shift_prev
;
int16_t
pitch_shift_prev
;
int16_t
trigger_prev
;
int16_t
trigger_prev
;
int16_t
rec_trigger_prev
;
int16_t
rec_trigger_prev
;
...
...
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