Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tap write mode #13

Merged
merged 9 commits into from
Mar 27, 2019
Merged

Conversation

rv0
Copy link
Contributor

@rv0 rv0 commented Jan 30, 2019

51107855_781592785528294_2323631453788700672_n

This is an implementation of "Tap Write" mode.

Usage:
In pattern edit mode, while the pattern is running, press the "shift" button to enter notes in real time for the currently selected instrument.

Bonus: new instrument clear functionality: In pattern edit mode, while the pattern is running, press the Tempo encoder + Shift, all step data for the current selected instrument is cleared.

Note:
To make this possible the controls to change the pattern length had to be changed, instead of using shift+"01-16" button or shift+"16-32", you now use those buttons without shift. Which imho works a lot better anyway... So to change the length of the pattern after this change, hold either "01-16" or "16-32" button and select one of the 16 steps.

Implementation
As I had no TR-808 at my disposable, I investigated the TAP mode on the the TR-606.
If a tap is "late", it is registered on the next step (= quantise, more or less). The definition of "late" depends on the current scale, the specifics are documented in the code itself.

// There most likely is a more elegant way.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Check if we can place the note on the current step:
if (ppqn_count%(pattern_scale[pattern_buffer]/4) < (int) (pattern_scale[pattern_buffer]/8)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if allowing later hits to be in the current step would help account for some of the mechanical lag inherent to using the shift button. This would be pretty dicey for the 1/32 scale, but it may help nonetheless.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my original implementation was more like 2/3 instead of 1/2 of a step..
didn't work intuitive, thats why i probed the 606 to find out how the "official" logic works

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So basically adjusting this to be more tolerant just doesn't work intuitively either, best bet if to remove the physical switch or get used to it (I already have :))

SR.Inst_Send(1<<selected_inst);
PORTB |= (1<<2);
delayMicroseconds(10);
PORTB &= ~(1<<2);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when the PPQN count interrupt triggers here? It seems unlikely to occur, but it might be worth considering. Quickly masking the interrupt seems like a bad idea, but I'm not sure what else to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been thinking about this one over the past couple days. It seems like the best behavior for this "corner case" would be to send the trigger pulse while the shift register only shows selected_inst, then rewrite the shift register with the pattern data and send the "normal" trigger pulse. To do this would require changing the interrupt priority and rewriting some of this code. This may also introduce a double-hit on selected_inst (or maybe not, depending on the time between pulses!). That seems like a lot of work though, especially if the code pretty much works to way it is. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a lot of work :)

@HomoElectromagneticus
Copy link
Owner

I really like the changes you made to the step length buttons behavior.

Regarding the actual tap entry, it does feel a little wonky. I've added some comments in the code where we can hopefully hash some of that out.

@rv0
Copy link
Contributor Author

rv0 commented Feb 27, 2019

I just added 2 more commits,

  • one to fix the merge conflict in manual with the upstream master branch.
  • one where i make sure the trigger always triggers (so no more missing notes, but the occasional double trigger) as the logic i was using there to stop double triggers seemed logical, but didn't work well in practice

Personally I like how it works now, so I won't really expand on it any further unless bugs are found.
Here's the .syx for this latest code change:
yocto.syx.txt

@HomoElectromagneticus HomoElectromagneticus merged commit 1db3e1a into HomoElectromagneticus:master Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants