Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b205222
Initial Commit
IanCaio Feb 3, 2021
cfb533a
Update Pattern.cpp to account for the Note::Type
IanCaio Feb 3, 2021
a5cf05d
Update PatternView::paintEvent to draw step notes
IanCaio Feb 3, 2021
df88140
Implements StepNotes setting a NPH with 0 frames
IanCaio Feb 3, 2021
7a5ad82
Improves PatternView::paintEvent conditional
IanCaio Feb 3, 2021
725169a
Adds upgrade method for backwards compatibility
IanCaio Feb 3, 2021
faa5209
Addresses Veratil's review
IanCaio Feb 11, 2021
9decf11
Uses ternary expression on statement
IanCaio Feb 11, 2021
3576300
Merge branch 'master' into feature/BBNotes
IanCaio Mar 5, 2021
f5cc889
Merge branch 'master' into feature/BBNotes
IanCaio Apr 18, 2021
1df46a5
Merge branch 'master' into feature/BBNotes
IanCaio Jul 7, 2023
db0d0b7
Addresses PR review (sakertooth)
IanCaio Jul 9, 2023
6b3c75e
Finished changes from review (sakertooth)
IanCaio Jul 9, 2023
4b69615
Uses std::find_if to save codelines
IanCaio Jul 10, 2023
89a62f6
Addresses review from sakertooth
IanCaio Jul 17, 2023
b3511c2
Addresses DomClark's review
IanCaio Jul 23, 2023
dbefa9c
Updates MidiExport to use Note Types
IanCaio Aug 21, 2023
463050a
Merge branch 'master' into feature/BBNotes
IanCaio Aug 28, 2023
0054ece
Fixes ambiguity on enum usage
IanCaio Aug 28, 2023
fe42e97
Merge branch 'master' into feature/BBNotes
IanCaio Oct 17, 2023
38dd8ec
Addresses new code reviews
IanCaio Oct 17, 2023
31a2bd3
Fixes note drawing on Song Editor
IanCaio Oct 17, 2023
43018d7
Adds cassert header to TimePos.cpp
IanCaio Oct 18, 2023
389a245
Apply suggestions from code review
IanCaio Oct 26, 2023
dcb41af
Reverts some changes on MidiExport
IanCaio Nov 3, 2023
2ecadb0
Merge remote-tracking branch 'upstream/master' into feature/BBNotes
IanCaio Nov 18, 2023
67b0b24
Fix the order of included files
IanCaio Nov 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implements StepNotes setting a NPH with 0 frames
	Now, instead of TimePos returning 0 for negative lengths, we
create a NotePlayHandle with 0 frames when the note type is StepNote on
InstrumentTrack::play.
  • Loading branch information
IanCaio committed Feb 3, 2021
commit df88140cae5e03a43f3a40cf6fb9ab35eeac1e12
10 changes: 5 additions & 5 deletions src/core/TimePos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ tick_t TimePos::getTickWithinBeat( const TimeSig &sig ) const

f_cnt_t TimePos::frames( const float framesPerTick ) const
{
if( m_ticks >= 0 )
{
return static_cast<f_cnt_t>( m_ticks * framesPerTick );
}
return 0;
//TODO: Remove next line, it's just a warning to see
// if any leftover code is still creating notes with
// negative lengths
if (m_ticks < 0) { qWarning("TimePos with negative length"); }
return static_cast<f_cnt_t>(m_ticks * framesPerTick);
}

double TimePos::getTimeInMilliseconds( bpm_t beatsPerMinute ) const
Expand Down
7 changes: 5 additions & 2 deletions src/tracks/InstrumentTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,8 +723,11 @@ bool InstrumentTrack::play( const TimePos & _start, const fpp_t _frames,
while( nit != notes.end() &&
( cur_note = *nit )->pos() == cur_start )
{
const f_cnt_t note_frames =
cur_note->length().frames( frames_per_tick );
// If the note is a Step Note, frames will be 0 so the NotePlayHandle
// plays for the whole length of the sample
const f_cnt_t note_frames = cur_note->type() == Note::StepNote
? 0
: cur_note->length().frames(frames_per_tick);

NotePlayHandle* notePlayHandle = NotePlayHandleManager::acquire( this, _offset, note_frames, *cur_note );
notePlayHandle->setBBTrack( bb_track );
Expand Down