Add Skippy transform

This commit is contained in:
Chris Danford
2003-03-13 09:20:21 +00:00
parent af6e1f764c
commit b4b8815cb7
4 changed files with 41 additions and 15 deletions
+14 -6
View File
@@ -1046,26 +1046,34 @@ void NoteDataUtil::Wide( NoteData &in )
void NoteDataUtil::Big( NoteData &in )
{
InsertIntelligentTaps(in,1.0f); // add 8ths
InsertIntelligentTaps(in,1.0f,0.5f); // add 8ths between 4ths
}
void NoteDataUtil::Quick( NoteData &in )
{
InsertIntelligentTaps(in,0.5f); // add 16ths
InsertIntelligentTaps(in,0.5f,0.25f); // add 16ths between 8ths
}
void NoteDataUtil::InsertIntelligentTaps( NoteData &in, float fBeatInterval )
void NoteDataUtil::Skippy( NoteData &in )
{
InsertIntelligentTaps(in,1.0f,0.75f); // add 16ths between 4ths
}
void NoteDataUtil::InsertIntelligentTaps( NoteData &in, float fBeatInterval, float fInsertBeatOffset )
{
ASSERT( fInsertBeatOffset <= fBeatInterval );
in.ConvertHoldNotesTo4s();
// insert 16th between all 4th-8ths
// insert a beat in the middle of every fBeatInterval
int max_row = in.GetLastRow();
int rows_per_interval = BeatToNoteRow( fBeatInterval );
int insert_row_offset = BeatToNoteRow( fInsertBeatOffset );
for( int i=0; i<=max_row; i+=rows_per_interval )
{
int iRowEarlier = i;
int iRowLater = i + rows_per_interval;
int iRowMiddle = i + rows_per_interval/2;
int iRowToAdd = i + insert_row_offset;
if( in.GetNumTapNonEmptyTracks(iRowEarlier)!=1 || in.GetNumTracksWithTap(iRowEarlier)!=1 )
continue;
if( in.GetNumTapNonEmptyTracks(iRowLater)!=1 || in.GetNumTracksWithTap(iRowLater)!=1 )
@@ -1098,7 +1106,7 @@ void NoteDataUtil::InsertIntelligentTaps( NoteData &in, float fBeatInterval )
break;
}
in.SetTapNote(iTrackOfNoteMiddle, iRowMiddle, TAP_TAP);
in.SetTapNote(iTrackOfNoteMiddle, iRowToAdd, TAP_TAP);
}
in.Convert4sToHoldNotes();
+2 -1
View File
@@ -162,7 +162,8 @@ namespace NoteDataUtil
void Wide( NoteData &in );
void Big( NoteData &in );
void Quick( NoteData &in );
void InsertIntelligentTaps( NoteData &in, float fBeatInterval );
void Skippy( NoteData &in );
void InsertIntelligentTaps( NoteData &in, float fBeatInterval, float fInsertBeatOffset );
void SuperShuffleTaps( NoteData &in );
void Backwards( NoteData &in );
void SwapSides( NoteData &in );
+22 -7
View File
@@ -148,7 +148,8 @@ MiniMenuDefinition g_AreaMenu =
{ "Paste at begin marker", true, 1, 0, {""} },
{ "Clear", true, 1, 0, {""} },
{ "Quantize", true, NUM_NOTE_TYPES, 0, {"4TH","8TH","12TH","16TH","24TH","32ND"} },
{ "Transform", true, ScreenEdit::NUM_TRANSFORM_TYPES, 0, {"Little","Wide","Big","Quick","Left","Right","Mirror","Shuffle","Super Shuffle","Backwards","Swap Sides"} },
{ "Turn", true, ScreenEdit::NUM_TURN_TYPES, 0, {"Left","Right","Mirror","Shuffle","Super Shuffle","Backwards","Swap Sides"} },
{ "Transform", true, ScreenEdit::NUM_TRANSFORM_TYPES, 0, {"Little","Wide","Big","Quick","Skippy"} },
{ "Play selection", true, 1, 0, {""} },
{ "Record in selection", true, 1, 0, {""} },
{ "Insert blank beat and shift down", true, 1, 0, {""} },
@@ -1283,17 +1284,13 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
NoteDataUtil::SnapToNearestNoteType( m_NoteFieldEdit, nt, nt, m_NoteFieldEdit.m_fBeginMarker, m_NoteFieldEdit.m_fEndMarker );
}
break;
case transform:
case turn:
{
HandleAreaMenuChoice( cut, NULL );
TransformType tt = (TransformType)iAnswers[c];
TurnType tt = (TurnType)iAnswers[c];
switch( tt )
{
case little: NoteDataUtil::Little( m_Clipboard ); break;
case wide: NoteDataUtil::Wide( m_Clipboard ); break;
case big: NoteDataUtil::Big( m_Clipboard ); break;
case quick: NoteDataUtil::Quick( m_Clipboard ); break;
case left: NoteDataUtil::Turn( m_Clipboard, NoteDataUtil::left ); break;
case right: NoteDataUtil::Turn( m_Clipboard, NoteDataUtil::right ); break;
case mirror: NoteDataUtil::Turn( m_Clipboard, NoteDataUtil::mirror ); break;
@@ -1307,6 +1304,24 @@ void ScreenEdit::HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers )
HandleAreaMenuChoice( paste_at_begin_marker, NULL );
}
break;
case transform:
{
HandleAreaMenuChoice( cut, NULL );
TransformType tt = (TransformType)iAnswers[c];
switch( tt )
{
case little: NoteDataUtil::Little( m_Clipboard ); break;
case wide: NoteDataUtil::Wide( m_Clipboard ); break;
case big: NoteDataUtil::Big( m_Clipboard ); break;
case quick: NoteDataUtil::Quick( m_Clipboard ); break;
case skippy: NoteDataUtil::Skippy( m_Clipboard ); break;
default: ASSERT(0);
}
HandleAreaMenuChoice( paste_at_begin_marker, NULL );
}
break;
case play:
{
ASSERT( m_NoteFieldEdit.m_fBeginMarker!=-1 && m_NoteFieldEdit.m_fEndMarker!=-1 );
+3 -1
View File
@@ -125,6 +125,7 @@ public:
paste_at_begin_marker,
clear,
quantize,
turn,
transform,
play,
record,
@@ -133,7 +134,8 @@ public:
NUM_AREA_MENU_CHOICES
};
void HandleAreaMenuChoice( AreaMenuChoice c, int* iAnswers );
enum TransformType { little, wide, big, quick, left, right, mirror, shuffle, super_shuffle, backwards, swap_sides, NUM_TRANSFORM_TYPES };
enum TurnType { left, right, mirror, shuffle, super_shuffle, backwards, swap_sides, NUM_TURN_TYPES };
enum TransformType { little, wide, big, quick, skippy, NUM_TRANSFORM_TYPES };
enum EditNotesStatisticsChoice {
difficulty,