Skip to content

Arpeggiator improvements - #1198

Merged
m-m-adams merged 42 commits into
SynthstromAudible:communityfrom
soymonitus:monitus/arpeggiator_improvements
Feb 19, 2024
Merged

Arpeggiator improvements#1198
m-m-adams merged 42 commits into
SynthstromAudible:communityfrom
soymonitus:monitus/arpeggiator_improvements

Conversation

@soymonitus

@soymonitus soymonitus commented Feb 9, 2024

Copy link
Copy Markdown
Collaborator

Added new features to the arpeggiator (Note: Ratchets are currently available only for Synth clips, but expected to be
extended to Midi clips and Kit rows in the future). The new features include:
1. Splitted the old Mode setting into separate settings Mode (Off or Arpeggiator) Octave Mode (Up, Down,
Up&Down, Alternate or Random) and Note Mode (Up, Down, Up&Down, AsPlayed or Random) settings, so you can setup
individually how octaves are walked and how notes are walked in the sequence.
2. The Mode pad shortcut is now an Arp preset shortcut, which will update the new 3 settings all at once:
- Off will disable arpeggiator.
- Up will setup Mode to Arpeggiator, Octave Mode to Up and Note Mode to Up.
- Down will setup Mode to Arpeggiator, Octave Mode to Down and Note Mode to Down.
- Both will setup Mode to Arpeggiator, Octave Mode to Alternate and Note Mode to Up.
- Random will setup Mode to Arpeggiator, Octave Mode to Random and Note Mode to Random.
- Custom will setup Mode to Arpeggiator, and enter a submenu to let you edit Octave Mode and Note Mode.
3. Mode (MODE):
- Off disables the arpeggiator.
- Arpeggiator (ARP) enables the arpeggiator.
4. Octave Modes (OMOD):
- Up (UP) will walk the octaves up.
- Down (DOWN) will walk the octaves down.
- Up & Down (UPDN) will walk the octaves up and down, repeating the highest and lowest octaves.
- Alternate (ALT) will walk the octaves up, and then down reversing the Notes pattern (without
repeating notes). Tip: Octave Mode set to Alternate and Note Mode set to Up is equivalent to
the old Both mode.
- Random (RAND) will choose a random octave every time the Notes pattern has played.
Tip: Set also Note Mode to Random to have the equivalent to the old Random mode.
5. Note Modes (NMOD):
- Up (UP) will walk the notes up.
- Down (DOWN) will walk the notes down. Tip: this mode also works in conjunction with Octave Mode
Alternate, which will walk all the notes and octaves all the way down, and then up reversing it.
- Up & Down (UPDN) will walk the notes up and down, repeating the highest and lowest notes.
- As played (PLAY) will walk the notes in the same order that they were played. Tip: this mode
also works in conjunction with Octave Mode Alternate, which will walk all the notes and octaves
all the way up (with notes as played), and then down reversing the order of played notes.
- Random (RAND) will choose a random note each time. If the Octave Mode is set to something
different than Random, then the pattern will play, in the same octave, the same number of random
notes as notes are in the held chord and then move to a different scale based on the Octave Mode.
Tip: Set also Octave Mode to Random to have the equivalent to the old Random mode.
6. Sequence Length (LENG) (unpatchet parameter, assignable to golden knobs):
- If set to zero, the arpeggiator pattern will play fully.
- If set to a value higher than zero, the pattern will play up to the set number of notes, and then
reset itself to start from the beginning.
7. Ratcheting: There are two new parameters (unpatched, assignable to golden knobs), to control how notes
are ratcheted. A ratchet is when a note repeats itself several time in the same time interval that the
original note has to play.
- Ratchet Amount (RATC): this will set the maximum number of ratchets that an arpeggiator step
could have (each step will randomize the number of ratchet notes between 1 and max value).
- From values 0 to 4, no ratchet notes
- From 5 to 19, up to 2 ratchet notes
- From 20 to 34, up to 4 ratchet notes
- From 35 to 50, up to 8 ratchet notes
- Ratchet Probability (RPRO): this sets how likely a step is to be ratcheted
- Being 0 (0%), no ratchets at all
- And 50 (100%), all notes will evaluate to be ratcheted.

Follow-up ideas/improvements for later (out of scope for this PR):

  • Rhythm (rests patterns), like the ones in Novation Launchkey: 0, 0x0, 0xx0, Random
  • Add "Chord" to Note Mode (to play all notes at the same time)
  • Ratchets for kit rows and midi clips
  • Sequencer (16 configurable steps with +- deviation in semitones from held note)

@soymonitus
soymonitus marked this pull request as draft February 9, 2024 09:10
Comment thread src/deluge/processing/sound/sound.cpp Outdated
Comment thread src/deluge/processing/sound/sound.cpp Outdated
@m-m-adams

Copy link
Copy Markdown
Collaborator

The arpeggiator mode pad is a waste now - could you make it work like unison, where pressing once does note direction (starting from off) and pressing a second time does octave direction?

return ArpOctaveMode::UP;
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These can/should be replaced with EnumStringMap I think, should provide some code size savings (see src/deluge/model/mod_controllable/filters/filter_config.cpp for an example of how to use these). They can live in arpeggiator.cpp as static functions too, so functions.cpp doesn't expand forever.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I specify different names for OLED and 7SEG so probably not a good fit this EnumStringMap

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm working on converting params to use the enumStringMap as a bigger refactor, don't worry about it for now

#include "gui/menu_item/unpatched_param.h"
#include "gui/ui/sound_editor.h"

namespace deluge::gui::menu_item::arpeggiator {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of 3 separate classes, this, RatchetProbability, and SequenceLength could be a single class deluge:gui::menu_item::unpatched_param::Arpeggiator (in deluge/gui/menu_item/unpatched_param).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

but they are different parameters, how are they supposed to be the same class?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The specific parameter to edit is a constructor parameter.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I see other params inheriting from public UnpatchedParam and they are in different folders and classes. I think I don't understand what you mean

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All three of these classes are identical (you're just over riding isRelevant) and the param id is passed in the constructor

Comment thread src/deluge/gui/menu_item/arpeggiator/ratchet_amount.h
Comment on lines 37 to +42
uint32_t gateThreshold = activeInstrumentClip->arpeggiatorGate + 2147483648;
uint32_t ratchetProbability = activeInstrumentClip->arpeggiatorRatchetProbability + 2147483648;
uint32_t ratchetAmount = activeInstrumentClip->arpeggiatorRatchetAmount + 2147483648;
uint32_t sequenceLength =
(((int64_t)activeInstrumentClip->arpeggiatorSequenceLength + 2147483648) * kMaxMenuValue + 2147483648)
>> 32;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
uint32_t gateThreshold = activeInstrumentClip->arpeggiatorGate + 2147483648;
uint32_t ratchetProbability = activeInstrumentClip->arpeggiatorRatchetProbability + 2147483648;
uint32_t ratchetAmount = activeInstrumentClip->arpeggiatorRatchetAmount + 2147483648;
uint32_t sequenceLength =
(((int64_t)activeInstrumentClip->arpeggiatorSequenceLength + 2147483648) * kMaxMenuValue + 2147483648)
>> 32;
uint32_t gateThreshold = activeInstrumentClip->arpeggiatorGate + 2147483648U;
uint32_t ratchetProbability = activeInstrumentClip->arpeggiatorRatchetProbability + 2147483648U;
uint32_t ratchetAmount = activeInstrumentClip->arpeggiatorRatchetAmount + 2147483648U;
uint32_t sequenceLength =
(((int64_t)activeInstrumentClip->arpeggiatorSequenceLength + 2147483648) * kMaxMenuValue + 2147483648U)
>> 32;

I think these calculations can overflow otherwise? It's unclear how gateThreshold was working before.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The gateThreshold line has been like that from the beginnings so I just did the same with my new parameters. I haven't experienced any buggy behavior even setting parameter values from minimum to maximum values

Comment thread src/deluge/modulation/arpeggiator.cpp Outdated
Comment thread src/deluge/modulation/arpeggiator.cpp Outdated
Comment thread src/deluge/modulation/arpeggiator.cpp Outdated
Comment thread src/deluge/modulation/arpeggiator.h
@soymonitus

Copy link
Copy Markdown
Collaborator Author

@sapphire-arches I pushed some changes for some comments of your feedback

@soymonitus
soymonitus marked this pull request as ready for review February 19, 2024 12:41
@soymonitus soymonitus changed the title [Draft] Arpeggiator improvements Arpeggiator improvements Feb 19, 2024
- Have the ratcheted step include the possibility to have no ratchets, so even at 100% probability we still get steps with no ratchets
- Crash on new song when accessing Preset modes (pad shortcut)
- Make ratchet notes not increment sequence index
@m-m-adams m-m-adams added the cherry-pick Commit to cherry pick to release branch label Feb 19, 2024
@m-m-adams

Copy link
Copy Markdown
Collaborator

@sapphire-arches I'm merging and opening an issue with the minor tweaks needed - I want user feedback on this

@m-m-adams
m-m-adams added this pull request to the merge queue Feb 19, 2024
Merged via the queue into SynthstromAudible:community with commit 019f9fd Feb 19, 2024
github-actions Bot pushed a commit that referenced this pull request Feb 19, 2024
* Initial commit

* Work in progress

* Fixed bug

* Changed labels

* Refactor ratchet chance to ratchet probability

* Disable arp ratchets for drums

* Change param name

* Fix param reading

* Format

* wip

* Added octave mode direction parameter do add more options to create interesting patterns

* New params (wip)

* lots of improvements

* Disable ratchets for midi clips for now..

* Fix compile

* Removed unused menu option

* Hack to disable midi clips ratcheting till i fix the gate issue

* format

* Add flag so when settings change, force a restart of the arpeggiator sequence

* Added PresetMode and now CUSTOM takes you to octavemode and octavemode to notemode

* format

* Format

* Refactor

* Updated docs

* updated doc

* Feedback from sapphire-arches

* Misc bugfixing

- Have the ratcheted step include the possibility to have no ratchets, so even at 100% probability we still get steps with no ratchets
- Crash on new song when accessing Preset modes (pad shortcut)
- Make ratchet notes not increment sequence index

* Missing param

* Fixed bug: new ratchet params not able to be learned to golden knobs

* Enable “Sequence Length” for kit rows and update docs

* Fixed Sequence Length for arpeggios of 1 note

* Better arp menu order

* Updated Docs
@soymonitus
soymonitus deleted the monitus/arpeggiator_improvements branch February 20, 2024 15:58
tastycode pushed a commit to tastycode/DelugeFirmware that referenced this pull request Jul 3, 2024
* Initial commit

* Work in progress

* Fixed bug

* Changed labels

* Refactor ratchet chance to ratchet probability

* Disable arp ratchets for drums

* Change param name

* Fix param reading

* Format

* wip

* Added octave mode direction parameter do add more options to create interesting patterns

* New params (wip)

* lots of improvements

* Disable ratchets for midi clips for now..

* Fix compile

* Removed unused menu option

* Hack to disable midi clips ratcheting till i fix the gate issue

* format

* Add flag so when settings change, force a restart of the arpeggiator sequence

* Added PresetMode and now CUSTOM takes you to octavemode and octavemode to notemode

* format

* Format

* Refactor

* Updated docs

* updated doc

* Feedback from sapphire-arches

* Misc bugfixing

- Have the ratcheted step include the possibility to have no ratchets, so even at 100% probability we still get steps with no ratchets
- Crash on new song when accessing Preset modes (pad shortcut)
- Make ratchet notes not increment sequence index

* Missing param

* Fixed bug: new ratchet params not able to be learned to golden knobs

* Enable “Sequence Length” for kit rows and update docs

* Fixed Sequence Length for arpeggios of 1 note

* Better arp menu order

* Updated Docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick Commit to cherry pick to release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants