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

Arpeggiator extended #2130

Merged
merged 1 commit into from Sep 10, 2016
Merged

Conversation

@zonkmachine
Copy link
Member

zonkmachine commented Jun 23, 2015

Se issue: #2080
Here are some of the new arpeggiator functions.


New functions:

  • Skip - Skips notes. Full on 1% of the notes are played.
  • Miss - Miss notes. Full on this is the same as having 'Random' setting in direction.
@zonkmachine
Copy link
Member Author

zonkmachine commented Jun 25, 2015

I couldn't make the original 'Skip' function work as I intended it and I'm not sure it's my coding that's the problem this time. It could be some other bug that's being exposed here.
Anyway. I let the Skip function mute notes last in the arpeggiator function instead and that's a bit wasteful compared to the earlier method of actually skipping over notes but now it works.

@tresf tresf force-pushed the LMMS:master branch 2 times, most recently from 8c45c1f to 4da73f3 Sep 15, 2015
@Wallacoloo Wallacoloo mentioned this pull request Sep 17, 2015
3 of 7 tasks complete
@zonkmachine zonkmachine force-pushed the zonkmachine:arpeggiator-extended-squashed branch from d158166 to fa77617 Sep 17, 2015
@zonkmachine
Copy link
Member Author

zonkmachine commented Sep 17, 2015

Toggle switch removed + Squashed.

@tresf
Copy link
Member

tresf commented Sep 17, 2015

👍

@tresf tresf added the enhancement label Sep 18, 2015
@tresf tresf added this to the 1.2.0 milestone Sep 18, 2015
@zonkmachine zonkmachine modified the milestones: 1.3.0, 1.2.0 Feb 16, 2016
@zonkmachine zonkmachine force-pushed the zonkmachine:arpeggiator-extended-squashed branch from 06deb0e to 85193bc Feb 24, 2016
@zonkmachine zonkmachine force-pushed the zonkmachine:arpeggiator-extended-squashed branch from 85193bc to 527e33d Feb 24, 2016
@zonkmachine
Copy link
Member Author

zonkmachine commented Feb 24, 2016

@Fastigium
With the fix in #2603 this hack got one step closer to merge.
I rebased it to the latest master and reverted/commented out, a workaround to counter for the base notes hanging which got especially annoying at higher randomness. With #2603 this is fixed but not for the single streamed instruments. The workaround unfortunately leaves lb302 totally untouched by the effect. There is a muted lb302 track in the BBTrack of the demo.
arpextendeddemo.mmp.zip

@Fastigium
Copy link
Contributor

Fastigium commented Feb 25, 2016

@zonkmachine Woah there, I'm not sure I get everything you're saying/asking. Let me see...
You're talking about your new Skip function, right? I'm actually not sure why #2603 fixed the base notes hanging for certain instruments. Normally, the NotePlayHandle that was originally sent to an instrument with stacking/arpeggio enabled gets muted because it gets child NotePlayHandles. You can see this here. NotePlayHandle::isMasterNote() returns true if the NotePlayHandle has subnotes or has had them in the past.
So that means that if you skip the first arpeggio note, the original note (base note?) does not get muted that way. Perhaps it gets muted some other way for non-single-streamed instruments now? Weird stuff.

As for the muted lb302 track in the BBTrack, I can't seem to find it. The B&B Editor only shows a kick and a snare, and the lb302 track under the BBTrack is not muted. That one does leave the original NotePlayHandle hanging though, probably for the reason I outlined above. To prevent it, you could add a method setMasterNote() to NotePlayHandle that sets m_hadChildren to true. That'd allow you to mute the base note without actually instantiating a child note.

@zonkmachine zonkmachine force-pushed the zonkmachine:arpeggiator-extended-squashed branch from 527e33d to 7737b2b Sep 7, 2016
@zonkmachine zonkmachine changed the title [WIP] Arpeggiator extended Arpeggiator extended Sep 7, 2016
@zonkmachine
Copy link
Member Author

zonkmachine commented Sep 7, 2016

@Fastigium Thank you so very much! I'm sorry for not replying earlier but I fell out of coding a bit. My post wasn't very clear and the demo project was ill labelled, but you managed to get what I was after.
Anyway, this was precisely what I needed to stomp out the hanging notes bug and by doing so finishing a coding project that's been following me for over two years.

To prevent it, you could add a method setMasterNote() to NotePlayHandle that sets m_hadChildren to true. That'd allow you to mute the base note without actually instantiating a child note.

Worked like a charm... together with setUsesBuffer( false );

@LMMS/developers The new arpeggiator functions for randomisation skip and miss are now ready for testing. Also, a new range limiting function is under development.

@zonkmachine zonkmachine force-pushed the zonkmachine:arpeggiator-extended-squashed branch 2 times, most recently from abbb028 to 175dd42 Sep 7, 2016
@zonkmachine zonkmachine removed the in progress label Sep 8, 2016
@zonkmachine zonkmachine modified the milestones: 1.2.0, 1.3.0 Sep 8, 2016
@zonkmachine
Copy link
Member Author

zonkmachine commented Sep 8, 2016

Since the 'hanging note bug' is fixed I'm now switching this back to 1.2

if( m_arpSkipModel.value() )
{

if( 101 * ( (float) rand() / (float) RAND_MAX ) < m_arpSkipModel.value() )

This comment has been minimized.

@jasp00

jasp00 Sep 9, 2016 Member

Why 101 * r / RM < skip instead of 100 * r / (RM + 1) < skip? 100% skip rate should skip always.

This comment has been minimized.

@zonkmachine

zonkmachine Sep 9, 2016 Author Member

Yeah. I was trying to find a more interesting response from the knobs. I've reverted to the same algorithm for both functions. Keep it simple, etc...

100% skip rate should skip always.

You're right, and i promised full amnesia.

int miss = m_arpMissModel.value();
if( miss )
{
if( 100 * ( (float) rand() / (float) RAND_MAX ) < ( miss * miss ) / 100 )

This comment has been minimized.

@jasp00

jasp00 Sep 9, 2016 Member

It should be RAND_MAX + 1 here to get 100% miss rate. Why miss * miss? This is not a percentage.

m_arpSkipKnob->setHintText( tr( "Fail rate:" ) + " ", " " + tr( "%" ) );
m_arpSkipKnob->setWhatsThis(
tr( "The skip function will make the arpeggiator pause one step "
"randomly. From it's start in full counter clockwise "

This comment has been minimized.

@jasp00

jasp00 Sep 9, 2016 Member

From its.

tr( "The skip function will make the arpeggiator pause one step "
"randomly. From it's start in full counter clockwise "
"position and no effect it will gradually progress to "
"more or less full amnesia at maximum setting.") );

This comment has been minimized.

@jasp00

jasp00 Sep 9, 2016 Member

more or less should not be necessary.

@@ -137,6 +139,22 @@ InstrumentFunctionArpeggioView::InstrumentFunctionArpeggioView( InstrumentFuncti
"number of octaves." ) );


m_arpSkipKnob->setLabel( tr( "SKIP" ) );
m_arpSkipKnob->setHintText( tr( "Fail rate:" ) + " ", " " + tr( "%" ) );

This comment has been minimized.

@jasp00

jasp00 Sep 9, 2016 Member

Why not Skip rate:?



m_arpMissKnob->setLabel( tr( "MISS" ) );
m_arpMissKnob->setHintText( tr( "Fail rate:" ) + " ", " " + tr( "%" ) );

This comment has been minimized.

@jasp00

jasp00 Sep 9, 2016 Member

Miss rate:?

@zonkmachine zonkmachine force-pushed the zonkmachine:arpeggiator-extended-squashed branch 2 times, most recently from 6277410 to e7a2dd2 Sep 9, 2016
@zonkmachine
Copy link
Member Author

zonkmachine commented Sep 9, 2016

@jasp00 I've complied with all of your suggestions. 🐶

@@ -137,6 +139,22 @@ InstrumentFunctionArpeggioView::InstrumentFunctionArpeggioView( InstrumentFuncti
"number of octaves." ) );


m_arpSkipKnob->setLabel( tr( "SKIP" ) );
m_arpSkipKnob->setHintText( tr( "Skip rate:" ) + " ", " " + tr( "%" ) );

This comment has been minimized.

@jasp00

jasp00 Sep 10, 2016 Member

According to the general style, there is no space before %.

This comment has been minimized.

@jasp00

jasp00 Sep 10, 2016 Member

The description is trimmed, so there is no need for a space after tr( "Skip rate:" ).

This comment has been minimized.

@zonkmachine

zonkmachine Sep 10, 2016 Author Member

Fixed! I have not clue as to what precisely I was thinking when laying out the text. The Gate knob already has the layout I needed?

@zonkmachine zonkmachine force-pushed the zonkmachine:arpeggiator-extended-squashed branch from e7a2dd2 to b8b8a93 Sep 10, 2016
@jasp00 jasp00 merged commit a4f5834 into LMMS:master Sep 10, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zonkmachine
Copy link
Member Author

zonkmachine commented Sep 10, 2016

🎉

Thanks for meticulous scrutiny and merge!

@zonkmachine zonkmachine deleted the zonkmachine:arpeggiator-extended-squashed branch Sep 10, 2016
sambler pushed a commit to sambler/lmms that referenced this pull request Sep 19, 2016
* master: (213 commits)
  Update Pattern and AutomationPattern length (LMMS#3037)
  Refresh i18n strings
  Hint text update
  Drop notes with length zero (LMMS#3031)
  Background tweak
  Background
  Update Flanger
  Exclude .ts files from the Github linguist
  Redesign Multitap echo (LMMS#3008)
  Update i18n source strings
  Extended arpeggiator functions (LMMS#2130)
  Fix sample track playback in BB tracks (LMMS#3023)
  Sort plug-in embedded resources (LMMS#3014)
  Implement version major.minor.release-stage.build (LMMS#3011)
  Fix regressions on loading broken projects (LMMS#3013)
  Improved file input validation. (LMMS#2523)
  Fix sample track view in BB editor (LMMS#3002)
  Request change in model when dropping a track (LMMS#3000)
  Add LocklessAllocator and use it in LocklessList (LMMS#2998)
  Drop forceStep in AutomatableModel (LMMS#3010)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.