private async void button___PLAY_MIDI_STREAMS_Click(object sender, EventArgs e)
{
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
RECALCULATE_THE_MIDI_DATA_MICROSECONDS_NOTES_ETC();
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
///
string ___dummyfilesnamesformids =
ExcelFormulaParser_GT_PARSERSample.Program.public_static_string_GT_folder
+ "PLAY_MIDI_STREAMS_300_loops_" + System.DateTime.Now.ToString("ddmmyyyyhhmmss") + ".mid";
int MidiFileType = 1;// 0;//////saan changes this to 1
int BeatsPerMinute =
(int)this.PUBLIC_DOUBLE_BPM_VALUE_FROM___textBoxFOR_BEATS_PER_MINUTE;
//60;
int TicksPerQuarterNote =
(int)this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480;
System.Windows.Forms.MessageBox.Show("TPQN_MDTKSPERBTS= " + this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480);
//120;////// too important /// multiple of 480
int TrackNumber = 0;
int ChannelNumber = 1;
//////public PatchParser()
int Patch_number = 26;
long abstimesinmillis = 0;
long absoluteTime___start___midstksunits = 0;
long absoluteTime___final___midstksunits = 0;
//////long absoluteTime___start___millis_units = 0;
//////long absoluteTime___final___millis_units = 0;
///
double absoluteTime___start___millis_units = 0;
double absoluteTime___final___millis_units = 0;
int ___necessary_pitch_bend_to_put_at_start_side_of_note = 0;
// var collection
SAANAUDS.Midi.MidiEventCollection SAANSMIDSEVENTScollection
= new
SAANAUDS.Midi.MidiEventCollection
(MidiFileType, TicksPerQuarterNote);
//////SAANSMIDSEVENTScollection
////// .AddEvent
////// (
////// new SAANAUDS.Midi.TextEvent
////// (
////// "Note Stream LYRICS",
////// SAANAUDS.Midi.MetaEventType.TextEvent
////// ,
////// // absoluteTime
////// (long)((absoluteTime___start___midstksunits + absoluteTime___final___midstksunits) / 6)
////// ),
////// //TrackNumber
////// TrackNumber
////// );
/////////////////////////////// interesting styles ////////////////////
///
SAANSMIDSEVENTScollection
.AddEvent
(
new SAANAUDS.Midi.TextEvent
(
"SanjoyNathGeometrifyingTrigonometry(C)"
,
SAANAUDS.Midi.MetaEventType.Copyright
,
// absoluteTime
(long)(absoluteTime___start___midstksunits)
),
//TrackNumber
// 0
TrackNumber
);
////////////////////////////////////////////////////////////////////////////////
////// will do after some times
// ++absoluteTime;
SAANSMIDSEVENTScollection.AddEvent
(
new SAANAUDS.Midi.TempoEvent
(
Local_CalculateMicrosecondsPerQuaterNote
(
BeatsPerMinute
),
/// absoluteTime
absoluteTime___start___midstksunits
),
// TrackNumber
TrackNumber
);
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
//////reads the data from the GTDXFMIDI TABS FIRST RECALCULATES THINGS FIRST
//////reads the data from the GTDXFMIDI TABS FIRST RECALCULATES THINGS FIRST
//////reads the data from the GTDXFMIDI TABS FIRST RECALCULATES THINGS FIRST
//i dont think it heres RECALCULATE_THE_MIDI_DATA_MICROSECONDS_NOTES_ETC();
//////reads the data from the GTDXFMIDI TABS FIRST RECALCULATES THINGS FIRST
//////reads the data from the GTDXFMIDI TABS FIRST RECALCULATES THINGS FIRST
//////reads the data from the GTDXFMIDI TABS FIRST RECALCULATES THINGS FIRST
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
///////////////////////////////// TOOOOO IMPORTANT CALL FOR MIDI SYSTEMS /////////////////
////// SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
//////.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
//////.PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
//////.Clear();
/////instead we need the proper constructions of the lists and the clearing the data
// this prepares the list clears the data structures first before loading the selected notes data everytime before prelistening
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.public_static_void_prepare_notes_sequences_for_prelistening_populate_to_rows();
string string_to_check_the_data_loading = "";
/// now we ill load the data for the selected rows to the notes
///
// Iterate through selected rows and add their data to the list
int ___temp_note_counter = 0;
long ___current_start_ticks_to_assign_for_current_note = 0;
double ___TEMP___DOUBLE_TOTAL_MILLISECONDS_FOR_SINGLE_PRELISTENS_CYCLES = 0;
try
{
if(this.dataGridView___COMPOSER.SelectedRows.Count==0)
{
System.Windows.Forms.MessageBox.Show("Fill the note numbers and other data and select the rows first");
}//if(this.dataGridView___COMPOSER.SelectedRows.Count==0)
foreach (DataGridViewRow row in this.dataGridView___COMPOSER.SelectedRows)
{
//////if (row.Cells["Id"].Value != null && row.Cells["Name"].Value != null && row.Cells["Genre"].Value != null)
//////{
////// selectedRowsData.Add(new ComposerData
////// {
////// Id = Convert.ToInt32(row.Cells["Id"].Value),
////// Name = row.Cells["Name"].Value.ToString(),
////// Genre = row.Cells["Genre"].Value.ToString()
////// });
//////}// if (row.Cells["Id"].Value != null && row.Cells["Name"].Value != null && row.Cells["Genre"].Value != null)
//////SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
//////.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
//////.PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
/// this.dataGridViewFOR_GT_PRESETS_DATA.Rows[6].Cells[1].Value.ToString()
//////if (row.Cells["Id"].Value != null && row.Cells["Name"].Value != null && row.Cells["Genre"].Value != null)
//////{
//////}
///
////// if (row.Cells["Column_NOTES_NUMBER_TO_TRYS"].Value != null &&
//////row.Cells["Column_NOTES_DURATIONS_MILLIS"].Value != null &&
//////row.Cells["Column_NOTES_VELOCITY"].Value != null &&
//////row.Cells["Column_CURRENT_NOTES_PATCH"].Value != null &&
//////row.Cells["ColumnINTERMEDIATE_PITCHBEND_DURATION_SLABS_PERCENTAGES_WITHIN_CURRENT_NOTES"].Value != null &&
//////row.Cells["Column_WITHIN_NOTES_PITCH_BENDS_VALUES"].Value != null)
if (row.Cells["Column_NOTES_NUMBER_TO_TRYS"].Value != null)
{
___temp_note_counter++;
if (SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
.Count>0
)
{
___current_start_ticks_to_assign_for_current_note
=
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
.Last()
.LONG_START_ABSOLUTE_TIME_FOR_CURRENT_NOTE
+
(long)
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
.Last()
.LONG_TICKS_DURATIONS_FOR_CURRENT_NOTE;
}
//////if (SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
////// .PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
////// .PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
////// .Count > 0
////// )
////// SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
//////.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
//////.PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
___temp_new_note_to_populate
=
new
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
();
string_to_check_the_data_loading = string_to_check_the_data_loading + "\r\n";
string_to_check_the_data_loading = string_to_check_the_data_loading +" " + row.Cells["Column_NOTES_NUMBER_TO_TRYS"].Value.ToString();
/////////////////////////////////////////////////////////////////////////////////
___temp_new_note_to_populate
.INT_SERIAL_NUMBER_OF_NOTE = ___temp_note_counter;
/////////////////////////////////////////////////////////////////////////////////
___temp_new_note_to_populate
.INT_NOTE_NUMBER_TO_PLAY_0_TO_127
= Convert.ToInt16(row.Cells["Column_NOTES_NUMBER_TO_TRYS"].Value.ToString().TrimEnd().TrimStart().Trim());
/////////////////////////////////////////////////////////////////////////////////
if (row.Cells["Column_NOTES_DURATIONS_MILLIS"].Value!=null)
{
string_to_check_the_data_loading = string_to_check_the_data_loading +" " + row.Cells["Column_NOTES_DURATIONS_MILLIS"].Value.ToString();
}
else
{
row.Cells["Column_NOTES_DURATIONS_MILLIS"].Value = "1000";
string_to_check_the_data_loading = string_to_check_the_data_loading + " " + row.Cells["Column_NOTES_DURATIONS_MILLIS"].Value.ToString();
}//end of else of if(row.Cells["Column_NOTES_DURATIONS_MILLIS"].Value!=null)
/////////////////////////////////////////////////////////// after crossing the checking and the validations //////
___temp_new_note_to_populate
.DOUBLE_MILLISECOND_DURATION_FOR_THE_NOTE_TO_PLAY
=
Convert.ToDouble(row.Cells["Column_NOTES_DURATIONS_MILLIS"].Value.ToString().TrimEnd().TrimStart().Trim());
/////////////////////////////////////////////////////////// after crossing the checking and the validations //////
////////////////////////////////////////////////////////////////////////////////
/////// WE WILL ADD THIS WITH CYCLES COUNTERS
___TEMP___DOUBLE_TOTAL_MILLISECONDS_FOR_SINGLE_PRELISTENS_CYCLES
=
___TEMP___DOUBLE_TOTAL_MILLISECONDS_FOR_SINGLE_PRELISTENS_CYCLES
+
___temp_new_note_to_populate
.DOUBLE_MILLISECOND_DURATION_FOR_THE_NOTE_TO_PLAY;
/////// WE WILL ADD THIS WITH CYCLES COUNTERS
////////////////////////////////////////////////////////////////////////////////
if (row.Cells["Column_NOTES_VELOCITY"].Value != null)
{
string_to_check_the_data_loading = string_to_check_the_data_loading + " " + row.Cells["Column_NOTES_VELOCITY"].Value.ToString();
}
else
{
row.Cells["Column_NOTES_VELOCITY"].Value = "127";
string_to_check_the_data_loading = string_to_check_the_data_loading + " " + row.Cells["Column_NOTES_VELOCITY"].Value.ToString();
}//end of else of if (row.Cells["Column_NOTES_VELOCITY"].Value != null)
/////////////////////////////////////////////////////////// after crossing the checking and the validations //////
___temp_new_note_to_populate
.INT_CURRENT_NOTES_VELOCITY_0_TO_127
=
Convert.ToInt16(row.Cells["Column_NOTES_VELOCITY"].Value.ToString().TrimEnd().TrimStart().Trim());
/////////////////////////////////////////////////////////// after crossing the checking and the validations //////
if (row.Cells["Column_CURRENT_NOTES_PATCH"].Value != null)
{
string_to_check_the_data_loading = string_to_check_the_data_loading + " " + row.Cells["Column_CURRENT_NOTES_PATCH"].Value.ToString();
}
else
{
row.Cells["Column_CURRENT_NOTES_PATCH"].Value = "127";
string_to_check_the_data_loading = string_to_check_the_data_loading + " " + row.Cells["Column_CURRENT_NOTES_PATCH"].Value.ToString();
}//end of else of if (row.Cells["Column_CURRENT_NOTES_PATCH"].Value != null)
/////////////////////////////////////////////////////////// after crossing the checking and the validations //////
___temp_new_note_to_populate
.INT_CURRENT_NOTES_PATCH_0_TO_127
=
Convert.ToInt16(row.Cells["Column_CURRENT_NOTES_PATCH"].Value.ToString().TrimEnd().TrimStart().Trim());
/////////////////////////////////////////////////////////// after crossing the checking and the validations //////
if (row.Cells["ColumnINTERMEDIATE_PITCHBEND_DURATION_SLABS_PERCENTAGES_WITHIN_CURRENT_NOTES"].Value != null)
{
string_to_check_the_data_loading = string_to_check_the_data_loading + " " + row.Cells["ColumnINTERMEDIATE_PITCHBEND_DURATION_SLABS_PERCENTAGES_WITHIN_CURRENT_NOTES"].Value.ToString();
}
else
{
row.Cells["ColumnINTERMEDIATE_PITCHBEND_DURATION_SLABS_PERCENTAGES_WITHIN_CURRENT_NOTES"].Value = "0,100";
string_to_check_the_data_loading = string_to_check_the_data_loading + " " + row.Cells["ColumnINTERMEDIATE_PITCHBEND_DURATION_SLABS_PERCENTAGES_WITHIN_CURRENT_NOTES"].Value.ToString();
}//end of else of if (row.Cells["ColumnINTERMEDIATE_PITCHBEND_DURATION_SLABS_PERCENTAGES_WITHIN_CURRENT_NOTES"].Value != null)
/////////////////////////////////////////////////////////// after crossing the checking and the validations //////
___temp_new_note_to_populate
.STRING_COMMA_SEPERATED_WITHIN_NOTES_PITCH_BENDS_PERCENTAGES_DURATIONS
= row.Cells["ColumnINTERMEDIATE_PITCHBEND_DURATION_SLABS_PERCENTAGES_WITHIN_CURRENT_NOTES"].Value.ToString().TrimEnd().TrimStart().Trim();
/////////////////////////////////////////////////////////// after crossing the checking and the validations //////
if (row.Cells["Column_WITHIN_NOTES_PITCH_BENDS_VALUES"].Value != null)
{
string_to_check_the_data_loading = string_to_check_the_data_loading + " " + row.Cells["Column_WITHIN_NOTES_PITCH_BENDS_VALUES"].Value.ToString();
}
else
{
row.Cells["Column_WITHIN_NOTES_PITCH_BENDS_VALUES"].Value = "8192,16368";
string_to_check_the_data_loading = string_to_check_the_data_loading + " " + row.Cells["Column_WITHIN_NOTES_PITCH_BENDS_VALUES"].Value.ToString();
}//end of else of if (row.Cells["Column_WITHIN_NOTES_PITCH_BENDS_VALUES"].Value != null)
/////////////////////////////////////////////////////////// after crossing the checking and the validations //////
___temp_new_note_to_populate
.STRING_COMMA_SEPERATED_WITHIN_NOTES_PITCH_BENDS_VALUES
= row.Cells["Column_WITHIN_NOTES_PITCH_BENDS_VALUES"].Value.ToString().TrimEnd().TrimStart().Trim();
/////////////////////////////////////////////////////////// after crossing the checking and the validations //////
////////////////////////////////////////////////// populate the list //////////////////////////
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
.Add
(
___temp_new_note_to_populate
);
////////////////////////////////////////////////// populate the list //////////////////////////
}//if (row.Cells["Column_NOTES_NUMBER_TO_TRYS"].Value != null)
}//foreach (DataGridViewRow row in this.dataGridView___COMPOSER.SelectedRows)
}
catch (Exception _excptoloaddata)
{
System.Windows.Forms.MessageBox.Show("_excptoloaddata = " + _excptoloaddata.Message + " " + _excptoloaddata.StackTrace.ToString());
}//catch(Exception _excptoloaddata)
System.Windows.Forms.MessageBox.Show(string_to_check_the_data_loading);
//////private MidiOut SAANS_TEMP_midiOut;
//////private Timer SAANS_TEMP_playTimer;
//////private int SAANS_TEMP_currentNoteIndex = 0;
//////private int[] SAAN_TEMPS_midiNotes = { 60, 62, 64, 65, 68, 69, 71, 72 }; // MIDI notes for C major scale
//////private int SAANS_TEMP_duration = 500; // Duration for each note in milliseconds
///
//load the list of the composer data first
////////private int[] SAAN_TEMPS_midiNotes = { 60, 62, 64, 65, 68, 69, 71, 72 }; // MIDI notes for C major scale // i will populate these from the data grids
////////private double[] SAAN_TEMPS_midiNotes_durations = { 600, 620, 640, 650, 680, 690, 710, 720 };
Array.Clear(SAAN_TEMPS_midiNotes, 0, SAAN_TEMPS_midiNotes.Length);
Array.Clear(SAAN_TEMPS_midiNotes_durations, 0,SAAN_TEMPS_midiNotes_durations.Length);
//i have seen taht the data loading is getting reversed
//so we are trying to get it re ordered again
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
.Reverse();
////////////////////////////////////////////////////////////////////////
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS[]
___temp_array_of___PRELISTENERNOTES
=
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
.ToArray();
//////////////////////////////////////////////////////////////////
Array.Clear(temp_notesarray, 0, temp_notesarray.Length);
Array.Clear(temp_durationsarray, 0, temp_durationsarray.Length);
Array.Clear(temp_velocity_array, 0, temp_velocity_array.Length);
Array.Clear(temp_patch_array, 0, temp_patch_array.Length);
temp_notesarray = new int[___temp_array_of___PRELISTENERNOTES.Length];
temp_durationsarray = new double[___temp_array_of___PRELISTENERNOTES.Length];
temp_velocity_array = new int[___temp_array_of___PRELISTENERNOTES.Length];
temp_patch_array = new int[___temp_array_of___PRELISTENERNOTES.Length];
string ___string_to_check_array_is_loaded_properly = "";
for (int i=0; i< ___temp_array_of___PRELISTENERNOTES.Length; i++)
{
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES.PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
notes_element
=
___temp_array_of___PRELISTENERNOTES[i];
temp_notesarray[i] = notes_element.INT_NOTE_NUMBER_TO_PLAY_0_TO_127;
temp_durationsarray[i] = notes_element.DOUBLE_MILLISECOND_DURATION_FOR_THE_NOTE_TO_PLAY;
temp_velocity_array[i] = notes_element.INT_CURRENT_NOTES_VELOCITY_0_TO_127;
temp_patch_array[i] = notes_element.INT_CURRENT_NOTES_PATCH_0_TO_127;
___string_to_check_array_is_loaded_properly = ___string_to_check_array_is_loaded_properly + "\r\n";
___string_to_check_array_is_loaded_properly = ___string_to_check_array_is_loaded_properly +i+" "+ temp_notesarray[i] + " ";
___string_to_check_array_is_loaded_properly = ___string_to_check_array_is_loaded_properly + temp_durationsarray[i] + " ";
___string_to_check_array_is_loaded_properly = ___string_to_check_array_is_loaded_properly + temp_velocity_array[i] + " ";
___string_to_check_array_is_loaded_properly = ___string_to_check_array_is_loaded_properly + temp_patch_array[i];
}// for(int i=0; i< ___temp_array_of___PRELISTENERNOTES.Length; i++)
SAAN_TEMPS_midiNotes = temp_notesarray;
System.Windows.Forms.MessageBox.Show("___string_to_check_array_is_loaded_properly\r\n" + ___string_to_check_array_is_loaded_properly);
////////////////////////////////////////////////////////////////////////////////////////////////
//SAANSAUDSAPI_Midi_MidiOut
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS = "";
/////////////////////////////////////////////////////////////////////////////////////////
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS = " SAANS_TEMP_SAANAUDS_Midi_MidiOut = new SAANAUDS.Midi.MidiOut(0); ";
SAANS_TEMP_SAANAUDS_Midi_MidiOut = new SAANAUDS.Midi.MidiOut(0); // Initialize MIDI output on the first available device
// SAANS_TEMP_SAANAUDS_Midi_MidiOut = new MidiOut(0); // Initialize MIDI output on the first available device
for (int i = 0; i < temp_notesarray.Length; i++)
{
try
{
SAANS_TEMP_SAANAUDS_Midi_MidiOut.Send(SAANAUDS.Midi.MidiMessage.ChangePatch(temp_patch_array[i], 1).RawData);
// Play the current note
SAANS_TEMP_SAANAUDS_Midi_MidiOut.Send(SAANAUDS.Midi.MidiMessage.StartNote(temp_notesarray[i], temp_velocity_array[i], 1).RawData);
// Wait for the duration of the note
await Task.Delay((int)temp_durationsarray[i]);
// Stop the current note
SAANS_TEMP_SAANAUDS_Midi_MidiOut.Send(SAANAUDS.Midi.MidiMessage.StopNote(temp_notesarray[i], temp_velocity_array[i], 1).RawData);
}
catch (Exception excptoPlayNote)
{
MessageBox.Show("excptoPlayNote = " + excptoPlayNote.Message + " " + excptoPlayNote.StackTrace.ToString() + " Note Index = " + i + " temp_notesarray length = " + temp_notesarray.Length + " temp_velocity_array length = " + temp_velocity_array.Length);
break;
}
}// for (int i = 0; i < temp_notesarray.Length; i++)
// Clean up resources
SAANS_TEMP_SAANAUDS_Midi_MidiOut.Dispose();
long abstimeslongstart = 0;
/// long absoluteTime___start___midstksunits = 0;
///
int patchNumber=22;
int notenumberfromthearray = 6;
int NoteVelocity = 122;
int durationtoassigns = 300;//
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
//////////////////////////////////////////////////////////////////////////////////////////////////////
///
int ticksPerQuarterNote = (int)this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480;
double millisecondsPerTick = 60000.0 / (ticksPerQuarterNote * (int)this.PUBLIC_DOUBLE_BPM_VALUE_FROM___textBoxFOR_BEATS_PER_MINUTE);
System.Windows.Forms.MessageBox.Show("Confirming this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS = " + this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS);
long LONG_OVERALL_CUMULATIVE_START_TIMES_ABSOLUTE_TIMER_CALCULATIONS = 0;
//THIS IS ALREADY DEFINED ___temp_array_of___PRELISTENERNOTES
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS[]
new_array_of___only_notes___of___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
=
___temp_array_of___PRELISTENERNOTES;
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
Object_of_PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS = null;
for (int loopcyclescounter=0; loopcyclescounter<300; loopcyclescounter++)
{
abstimeslongstart =
(long)(___TEMP___DOUBLE_TOTAL_MILLISECONDS_FOR_SINGLE_PRELISTENS_CYCLES * loopcyclescounter);
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
+=
"\r\nloopcyclescounter = " + loopcyclescounter;
;
for (int r = 0; r < temp_notesarray.Length; r++)
{
////////////////////////// adding this to handle details for the pitch bends like things also for current ordered note in predefined sequences//////
Object_of_PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
=
new_array_of___only_notes___of___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS[r];
////////////////////////// adding this to handle details for the pitch bends like things also for current ordered note in predefined sequences//////
durationtoassigns = (int)temp_durationsarray[r];
//////LONG_OVERALL_CUMULATIVE_START_TIMES_ABSOLUTE_TIMER_CALCULATIONS
////// =
////// LONG_OVERALL_CUMULATIVE_START_TIMES_ABSOLUTE_TIMER_CALCULATIONS
////// +
////// (long)
////// (
////// (
////// (long)(temp_durationsarray[r]))
////// * ( (long)(this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS))
////// );
abstimesinmillis
=
abstimesinmillis
+
abstimeslongstart
+
(long)(temp_durationsarray[r]);
/////////////////////////////////////////////////////////////////////////////////
/////saan has logged the data for these calculations and has found that there are issues for the start times calculations so saan has changed the start point calculations
///with the cumulative timers calculations
absoluteTime___start___midstksunits
=
abstimesinmillis
*
(long)this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS;
int prevs_durationtoassigns_inmiditiks = 0;
//saan has found that after the cycles completes there are the gaps in sounds and also the start points durations calculations are not proper
if (r > 0)
{
// this is for the intermediate notes in the cycles
prevs_durationtoassigns_inmiditiks = (int)(temp_durationsarray[r - 1] * this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS);
}
else
{
//this is for the first note in the cycles
prevs_durationtoassigns_inmiditiks = 0;// (int)(temp_durationsarray[r] * this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS);
}//end of else of if (r > 0)
// this is for the current note playing which is ok
int durationtoassigns_inmiditiks = (int)(temp_durationsarray[r] * this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS);
LONG_OVERALL_CUMULATIVE_START_TIMES_ABSOLUTE_TIMER_CALCULATIONS
=
LONG_OVERALL_CUMULATIVE_START_TIMES_ABSOLUTE_TIMER_CALCULATIONS
+
(long)prevs_durationtoassigns_inmiditiks;
// (long)durationtoassigns_inmiditiks;
//prevs_durationtoassigns_inmiditiks is necessary
//////(long)
//////(
//////(
//////(long)(temp_durationsarray[r]))
////// * ((long)(this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS))
////// );
// int durationtoassigns_inmiditiks = (int)(temp_durationsarray[r]);// / this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS);
// int durationtoassigns_inmiditiks = (int)(temp_durationsarray[r]);//
//////int durationtoassigns___another = (int)temp_durationsarray[r];
//////abstimesinmillis = abstimeslongstart + (long)(temp_durationsarray[r]);
//////absoluteTime___start___midstksunits = (long)(abstimesinmillis * millisecondsPerTick);
//////int durationtoassigns_inmiditiks___another = (int)(temp_durationsarray[r] * millisecondsPerTick);
patchNumber = temp_patch_array[r];
notenumberfromthearray = temp_notesarray[r];
ChannelNumber = Math.Max(1,r % 11);
TrackNumber = ChannelNumber;
NoteVelocity = temp_velocity_array[r];
SAANSMIDSEVENTScollection
.AddEvent(
new
SAANAUDS.Midi.PatchChangeEvent
(
///saan puts this here
// absoluteTime___start___midstksunits
LONG_OVERALL_CUMULATIVE_START_TIMES_ABSOLUTE_TIMER_CALCULATIONS
,
ChannelNumber
,
patchNumber
)
, TrackNumber
);
///////////////////////////////////////////////////////////////
SAANSMIDSEVENTScollection.AddEvent
(
new SAANAUDS.Midi.NoteOnEvent
(
////// absoluteTime
// absoluteTime___start___midstksunits
LONG_OVERALL_CUMULATIVE_START_TIMES_ABSOLUTE_TIMER_CALCULATIONS
,
ChannelNumber
,
// note.MidiValue
notenumberfromthearray
,
NoteVelocity
,
////// (int)Math.Min(NoteDuration___with__midtks_units, 1)
// (int)Math.Max(NoteDuration___with__midtks_units, 1)
//durationtoassigns
durationtoassigns_inmiditiks
// durationtoassigns_inmiditiks___another
)
,
TrackNumber
);
/////////////////////////////////// NOTE ON EVENT COMPLETES HERE AND WE WILL PUT THE PITCH BENDS AND OTHER CONTROLLERS HERE //////
/////////////////////////////////// NOTE ON EVENT COMPLETES HERE AND WE WILL PUT THE PITCH BENDS AND OTHER CONTROLLERS HERE //////
/////////////////////////////////// NOTE ON EVENT COMPLETES HERE AND WE WILL PUT THE PITCH BENDS AND OTHER CONTROLLERS HERE //////
/////////////////////////////////// NOTE ON EVENT COMPLETES HERE AND WE WILL PUT THE PITCH BENDS AND OTHER CONTROLLERS HERE //////
/////////////////////////////////// NOTE ON EVENT COMPLETES HERE AND WE WILL PUT THE PITCH BENDS AND OTHER CONTROLLERS HERE //////
/////////////////////////////////// NOTE ON EVENT COMPLETES HERE AND WE WILL PUT THE PITCH BENDS AND OTHER CONTROLLERS HERE //////
////////////////////////////// THE NOTE OFF EVENT IS IMPORTANT FOR THE SAAN AUDS SYSTEMS TO GET THE CONTROLLING OF THE REAL DURATIONS OF THE NOTES
////////////////////////////// THE NOTE OFF EVENT IS IMPORTANT FOR THE SAAN AUDS SYSTEMS TO GET THE CONTROLLING OF THE REAL DURATIONS OF THE NOTES
////////////////////////////// THE NOTE OFF EVENT IS IMPORTANT FOR THE SAAN AUDS SYSTEMS TO GET THE CONTROLLING OF THE REAL DURATIONS OF THE NOTES
////////////////////////////// THE NOTE OFF EVENT IS IMPORTANT FOR THE SAAN AUDS SYSTEMS TO GET THE CONTROLLING OF THE REAL DURATIONS OF THE NOTES
////////////////////////////// THE NOTE OFF EVENT IS IMPORTANT FOR THE SAAN AUDS SYSTEMS TO GET THE CONTROLLING OF THE REAL DURATIONS OF THE NOTES
////////////////////////////// THE NOTE OFF EVENT IS IMPORTANT FOR THE SAAN AUDS SYSTEMS TO GET THE CONTROLLING OF THE REAL DURATIONS OF THE NOTES
/////////////////////////////////////////////////////////////////////////////////////////
// the note on event with the zero velocity is important for saanauds systems
SAANSMIDSEVENTScollection.AddEvent
(
new SAANAUDS.Midi.NoteOnEvent
(
////// absoluteTime
// absoluteTime___start___midstksunits
(long)
(
(long)(LONG_OVERALL_CUMULATIVE_START_TIMES_ABSOLUTE_TIMER_CALCULATIONS)
+((long)durationtoassigns_inmiditiks)
)
,
ChannelNumber
,
// note.MidiValue
notenumberfromthearray
,
0
//this is to note off events
,
//saan could not find any difference with the sharp stopping times durations and the delayed stopping of the notes
////// (int)Math.Min(NoteDuration___with__midtks_units, 1)
// (int)Math.Max(NoteDuration___with__midtks_units, 1)
//durationtoassigns
//durationtoassigns_inmiditiks
// 0
// to do the experiments
//(int)(durationtoassigns_inmiditiks / 3)
// durationtoassigns_inmiditiks___another
0
)
,
TrackNumber
);
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
+=
"\r\ninter cycle Raga notes counter r = " + r + "\r\n";
;
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
+=
" TrackNumber = " + TrackNumber;
;
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
+=
" ChannelNumber = " + ChannelNumber;
;
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
+=
" patchNumber = " + patchNumber;
;
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
+=
" notenumberfromthearray = " + notenumberfromthearray;
;
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
+=
" NoteVelocity = " + NoteVelocity;
;
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
+=
" absoluteTime___start___midstksunits = " + absoluteTime___start___midstksunits;
;
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
+=
" LONG_OVERALL_CUMULATIVE_START_TIMES_ABSOLUTE_TIMER_CALCULATIONS = " + LONG_OVERALL_CUMULATIVE_START_TIMES_ABSOLUTE_TIMER_CALCULATIONS;
;
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
+=
" durationtoassigns_inmiditiks = " + durationtoassigns_inmiditiks;
;
}//for (int r = 0; r < temp_notesarray.Length; r++)
}//for(int loopcyclescounter=0; loopcyclescounter<300; loopcyclescounter++)
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////if (temp_durationsarray.Length>0)
//////{
////// SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
////// .PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
////// .PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS +=
////// "\r\nSAANS_TEMP_currentNoteIndex =" + SAANS_TEMP_currentNoteIndex;
////// ////////////////////////////////////////////////////////////////////////////////////////////////////
////// if (temp_durationsarray[SAANS_TEMP_currentNoteIndex] > 0)
////// {
////// SAANS_TEMP_playTimer = new Timer
////// {
////// // Interval = SAANS_TEMP_duration // Set the timer interval to the duration of each note /// I NEED TO collect the durations from the index of the durations array
////// // Interval = Math.Max(SAANS_TEMP_duration,(int)temp_durationsarray[SAANS_TEMP_currentNoteIndex] ) //SAANS_TEMP_duration // Set the timer interval to the duration of each note /// I NEED TO collect the durations from the index of the durations array
////// Interval = (int)temp_durationsarray[SAANS_TEMP_currentNoteIndex]
////// };
////// }
////// else
////// {
////// SAANS_TEMP_playTimer = new Timer
////// {
////// Interval = SAANS_TEMP_duration // Set the timer interval to the duration of each note /// I NEED TO collect the durations from the index of the durations array
////// // Interval = (int)temp_durationsarray[SAANS_TEMP_currentNoteIndex] //SAANS_TEMP_duration // Set the timer interval to the duration of each note /// I NEED TO collect the durations from the index of the durations array
////// };
////// }//end of else of if(temp_durationsarray[SAANS_TEMP_currentNoteIndex]>0)
////// ////////////////////////////////////////////////////////////////////////////////////////////////////
//////}
//////else
//////{
////// SAANS_TEMP_playTimer = new Timer
////// {
////// Interval = SAANS_TEMP_duration // Set the timer interval to the duration of each note /// I NEED TO collect the durations from the index of the durations array
////// // Interval = (int)temp_durationsarray[SAANS_TEMP_currentNoteIndex] //SAANS_TEMP_duration // Set the timer interval to the duration of each note /// I NEED TO collect the durations from the index of the durations array
////// };
//////}//end of else of if(temp_durationsarray.Length>0)
//////SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
//////.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
//////.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS +=
//////"\r\nSAANS_TEMP_playTimer.Interval =" + SAANS_TEMP_playTimer.Interval;
//////SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
//////.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
//////.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS +=
//////"\r\nSAANS_TEMP_currentNoteIndex = " + SAANS_TEMP_currentNoteIndex;
// Start playing the MIDI sequence
//dont call this SAANS_TEMP_currentNoteIndex = 0;
//TO DO WITH THIS
// SAANS_TEMP_SAANAUDS_Midi_MidiOut.Volume
//////SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
//////.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
//////.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS +=
//////"\r\nSAANS_TEMP_playTimer.Tick += PlayNextNote; ";
// SAANS_TEMP_playTimer.Start();
// SAANS_TEMP_playTimer.Tick += PlayNextNote;
////// SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
//////.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
//////.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS +=
//////" SAANS_TEMP_playTimer.Start();";
if (SAANS_TEMP_currentNoteIndex >=SAAN_TEMPS_midiNotes.Length)
{
// SAANS_TEMP_midiOut.Send(MidiMessage.StopNote(midiNotes[currentNoteIndex - 1], 127).RawData);
/// SAANS_TEMP_midiOut.Send(SAANAUDS.Midi.MidiMessage.StopNote(SAAN_TEMPS_midiNotes[SAANS_TEMP_currentNoteIndex - 1], 127, 1).RawData);
///
SAANS_TEMP_currentNoteIndex = 0;
// Clean up resources
try
{
SAANS_TEMP_SAANAUDS_Midi_MidiOut.Dispose();
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS +=
" after SAANS_TEMP_SAANAUDS_Midi_MidiOut.Dispose();";
}
catch (Exception ___excp)
{
}//catch(Exception ___excp)
}//if (SAANS_TEMP_currentNoteIndex > 0 && SAANS_TEMP_currentNoteIndex < SAAN_TEMPS_midiNotes.Length)
System.Windows.Forms.MessageBox.Show
(
"playslogs\r\n" +
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
);
System.IO.File.WriteAllText
(
___dummyfilesnamesformids+"_flows_logs.txt"
,
SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
.PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
.PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS
);
SAANSMIDSEVENTScollection.PrepareForExport();
SAANAUDS.Midi.MidiFile.Export(___dummyfilesnamesformids, SAANSMIDSEVENTScollection);
System.Windows.Forms.MessageBox.Show("midi files saved at " + ___dummyfilesnamesformids);
}//private void button___PLAY_MIDI_STREAMS_Click(object sender, EventArgs e)
public void RECALCULATE_THE_MIDI_DATA_MICROSECONDS_NOTES_ETC()
{
try
{
////// textBox_PITCH_BENDS_SLABS_MILLIS
///public double PUBLIC_DOUBLE_PITCH_BENDS_MINIMUM_TIMES_DURATIONS_MILLISECS = 1100;
//textBox_PITCH_BENDS_SLABS_MILLIS
this.PUBLIC_DOUBLE_PITCH_BENDS_MINIMUM_TIMES_DURATIONS_MILLISECS = 338;
try
{
this.PUBLIC_DOUBLE_PITCH_BENDS_MINIMUM_TIMES_DURATIONS_MILLISECS
=
Convert.ToDouble(textBox_PITCH_BENDS_SLABS_MILLIS.Text.ToString().TrimEnd().TrimStart().Trim().Replace(" ", ""));
}
catch (Exception ___excptoreadptchbendstimesmillis)
{
this.PUBLIC_DOUBLE_PITCH_BENDS_MINIMUM_TIMES_DURATIONS_MILLISECS = 338;
}//catch(Exception ___excptoreadptchbendstimesmillis)
this.public_long_total_microsecond_of_song___from___textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS
= (long)Convert.ToInt64(textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS.Text.TrimEnd().Trim().Trim().Replace(" ", ""));
/////////////////////////////////////////////////////////// this is important for the calculations of the drawings on dxf systems //////
////// first we convert the micro seconds to milliseconds and then we divide the milliseconds with 360*100 (centi degrees to get the data
///these centi degrees are the important calculations for the systems and which suggests the lengths of the notes along the circumferences of frequency circles
///to get the durations for the notes for proper understanding of the constructions of notes assignments properly and no gaps are there in the denseness
///for the musics preperations (EAR GRAMMARS) are to handle with the compactness of the sounds sequences
///to tell the story about the geometry compactness symmetries kind of things and also to understand the nature of visual symmetries and the effects on the audible symmetries
///the visual aesthetics and the audio aesthetics dont talk the same things which is to take care for the geometry and the grammars of spatial alignments to sounds arrangements
this.public_double_milliseconds_per_centi_degrees
=
(((double)this.public_long_total_microsecond_of_song___from___textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS) / 1000)
/
36000;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///
this.public_double_milliseconds_per_UNIT_SINGLE_degrees
=
(((double)this.public_long_total_microsecond_of_song___from___textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS) / 1000)
/
360;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
PUBLIC_INT_LENGTH_OF___SAANS_FACVORITE_STRINGS_SHORT_DURATIONS_PATCHES_PUBLIC_ARRAY_INT = 0;
PUBLIC_INT_LENGTH_OF___SAANS_FACVORITE_AIR_LONG_DURATIONS_PATCHES_PUBLIC_ARRAY_INT = 0;
PUBLIC_INT_LENGTH_OF___SAANS_FACVORITE_STRINGS_SHORT_DURATIONS_PATCHES_PUBLIC_ARRAY_INT
= SAANS_FACVORITE_STRINGS_SHORT_DURATIONS_PATCHES_PUBLIC_ARRAY_INT.Length;
PUBLIC_INT_LENGTH_OF___SAANS_FACVORITE_AIR_LONG_DURATIONS_PATCHES_PUBLIC_ARRAY_INT
= SAANS_FACVORITE_AIR_LONG_DURATIONS_PATCHES_PUBLIC_ARRAY_INT.Length;
////// cant we take TicksPerQuarterNote as multiple of 60 ? instead of multiple of 480
//////ChatGPT
//////In MIDI, TicksPerQuarterNote is often used as a multiple of 60 because it provides a convenient resolution for expressing tempo changes.However, it's not a strict requirement, and you can technically set TicksPerQuarterNote to any integer value based on your specific needs.
//////Using a multiple of 60, like 480(60 multiplied by 8), is common because it allows for easy tempo calculations in beats per minute(BPM) and makes it simple to represent note durations.It's a practical choice because it aligns well with common musical timing values.
//////That said, you can choose other values for TicksPerQuarterNote if your MIDI application requires different resolutions or if you have specific reasons to do so.Just be aware that using a value that's not a multiple of 60 may make it less intuitive when working with tempos in BPM and traditional musical notation.
///TS MEANS TIME SIGNATURE
/// ///TS MEANS TIME SIGNATURE
/// ///TS MEANS TIME SIGNATURE
////////public long public_long_total_microsecond_of_song___from___textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS = 0;
////////public long public_long_total_miditicks_of_song___FOR___label_TOT_MICROSECONDS_DURATION_NX480 = 0;
////////public long public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS = 0;
////////public double PUBLIC_DOUBLE_BPM_VALUE_FROM___textBoxFOR_BEATS_PER_MINUTE = 0;
////////public long public_long_FOR___label_CALCULATED_DATA_MICROTEMPO_THAT_IS_MICROSECONDS_PER_BEAT = 0;
////////public int public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT = 0;
////////public int public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2 = 0;
///TS MEANS TIME SIGNATURE
/// ///TS MEANS TIME SIGNATURE
/// ///TS MEANS TIME SIGNATURE
////////public double public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK = 0;
////////public long public_long___calculated_data_for___label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS = 0;
//////public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480
///
public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS
=
(
(int)(
public_long_total_microsecond_of_song___from___textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS
/ 480
)
+ 1
)
* 480;
/////////////////////////////////////////////////////////////////////////////////////////////
this.label_TOT_MICROSECONDS_DURATION_NX480_OR_N_X_TPQN
.Text
=
"REVISED_DURATIONS_MICROSECONDS=" +
this.public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS
.ToString();
/////////////////////////////////////////////////////////////////////////////////////////////
////////public int public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT = 0;
this.public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
= Convert.ToInt32
(
this.textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT.Text
.TrimEnd().TrimStart().Trim()
);
////////public int public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2 = 0;
this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
= Convert.ToInt32
(
this.textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2.Text
.TrimEnd().TrimStart().Trim()
);
//////////////////////////////////////////////////////////////////////////////////////////
//////////////////////// tooooo important data /////////////////////////////////////////////////////////
/////////////////////////// tooooo important data /////////////////////////////////////////////////////////
/////////////////////////// tooooo important data /////////////////////////////////////////////////////////
this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480
= Convert.ToDouble
(
this.textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480.Text
.TrimEnd().TrimStart().Trim()
);
//////////////////////// tooooo important data /////////////////////////////////////////////////////////
/////////////////////////// tooooo important data /////////////////////////////////////////////////////////
/////////////////////////// tooooo important data /////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
this.PUBLIC_DOUBLE_BPM_VALUE_FROM___textBoxFOR_BEATS_PER_MINUTE
= Convert.ToDouble
(
this.textBoxFOR_BEATS_PER_MINUTE.Text
.TrimEnd().TrimStart().Trim()
);
this.public_long_FOR___label_CALCULATED_DATA_MICROTEMPO_THAT_IS_MICROSECONDS_PER_BEAT
=
(long)
(
60000000
/
this.PUBLIC_DOUBLE_BPM_VALUE_FROM___textBoxFOR_BEATS_PER_MINUTE
);
//////////////////////////////////////////////////////////////////////////////////////////////////////
this.label_CALCULATED_DATA_MICROTEMPO_THAT_IS_MICROSECONDS_PER_BEAT.Text
= "(MICROTEMPO)microseconds/beat=MICROTEMPO_CALCULATED 60000000/BPM="
+ this.public_long_FOR___label_CALCULATED_DATA_MICROTEMPO_THAT_IS_MICROSECONDS_PER_BEAT.ToString();
//////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
=
(
this.public_long_FOR___label_CALCULATED_DATA_MICROTEMPO_THAT_IS_MICROSECONDS_PER_BEAT
/
this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK.Text
=
"MICROSEC/MIDITICK=" + this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
.ToString();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
this.public_long___calculated_data_for___label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS
=
(long)
(
(double)
this.public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS
/
this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
);
/////////////////////////////////////////////////////////////////////////////////////////////////////
this.public_long_total_miditicks_of_song___FOR___label_TOT_MICROSECONDS_DURATION_NX480
= this.public_long___calculated_data_for___label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS;
this.label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS.Text
= "TOT_MIDITICS= " +
this.public_long___calculated_data_for___label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS
.ToString();
/////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
///TS MEANS TIME SIGNATURE
this.public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
= 4;//default numerator for beats per measure
/////////////////////////////////////////////////////////////////////////////////////////////
try
{
///TS MEANS TIME SIGNATURE
this.public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
=
(int)Convert.ToInt16
(this.textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT.Text.TrimEnd().TrimStart().Trim());
/// no dont do it on text box
//////this.textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT.Text
////// = "beats_per_bar_size or per measure="
////// +
////// this.public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
////// .ToString();
}
catch (Exception _excp_for_numerator_beats_per_measure_representation)
{
///TS MEANS TIME SIGNATURE
this.public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
= 4;//default numerator for beats per measure
/////////////////////////////////////////////////////////////////////////////////////////////
}//catch(Exception _excp_for_numerator_beats_per_measure_representation)
///4;//default denominator for notes per beats
/////////////////////////////////////////////////////////////////////////////////////////////
try
{
///TS MEANS TIME SIGNATURE
this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
= 4; ////// default denominator notes per beat is 2^2 that is the 4 (we take it as 4)
///TS MEANS TIME SIGNATURE
this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
=
(int)
Math.Pow
(
2,
(int)Convert.ToInt16
(
this.textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2.Text.TrimEnd().TrimStart().Trim()
)
)
;
}
catch (Exception _excp_for_denominator__the_denominator_notes_per_beat_representation)
{
///TS MEANS TIME SIGNATURE
this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
= 2 ^ 4;//default denominator for beats per measure
/////////////////////////////////////////////////////////////////////////////////////////////
}//catch(Exception _excp_for_denominator__the_denominator_notes_per_beat_representation)
///4;//default numerator for beats per measure
/////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// these are very necessary to make the sounds look good //////////
this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_TICKS_OF_MIDI___INTEGER___MIDITKS_PER_NOTE = 0;
this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE = 0;
this.public_double___label_CALCULATED_DURATION_OF_MIDI_MEASURE_BAR_SIZE_IN_TICKS_OF_MIDI = 0;
this.public_double___label_CALCULATED_NOTES_PER_BEAT = 0;
///////////////////////////////////// these are very necessary to make the sounds look good //////////
this.public_double___label_TOTAL_NUMBER_OF_BEATS_FOUND_IN_TOTAL_DURATION_OF_TICKS_OF_MIDI
=
this.public_long___calculated_data_for___label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS
/
this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480
;
/////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
///
/////////////////////////////////////////////////////////////////////////////////////////////
label_TOTAL_NUMBER_OF_BEATS_FOUND_IN_TOTAL_DURATION_OF_TICKS_OF_MIDI.Text
=
this.public_double___label_TOTAL_NUMBER_OF_BEATS_FOUND_IN_TOTAL_DURATION_OF_TICKS_OF_MIDI
.ToString()
+ " BEATS_FOUND";
/////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// these are very necessary to make the sounds look good //////////
////// we do the back calculations from the total durations point of view since we want to distribute the
///whole durations into the best note durations to make it good and so wee are distributing the whole note systems
///back calculated with engineering point of views instead of the music theory point of views
this.public_double___label_CALCULATED_DURATION_OF_MIDI_MEASURE_BAR_SIZE_IN_TICKS_OF_MIDI
=
/// public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
///label_CALCULATED_DURATION_OF_MIDI_MEASURE_BAR_SIZE_IN_TICKS_OF_MIDI
this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480
*
/// this.public_double___label_TOTAL_NUMBER_OF_BEATS_FOUND_IN_TOTAL_DURATION_OF_TICKS_OF_MIDI)
/// *
this.public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.label_CALCULATED_DURATION_OF_MIDI_MEASURE_BAR_SIZE_IN_TICKS_OF_MIDI.Text
=
"MIDI_TICKS_PER_BAR_SIZE(MEASURE)=" +
this.public_double___label_CALCULATED_DURATION_OF_MIDI_MEASURE_BAR_SIZE_IN_TICKS_OF_MIDI
.ToString();
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.public_double___label_CALCULATED_NOTES_PER_BEAT
=
//////Math.Pow
//////(
////// 2
////// ,
this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
// )
/// already done
;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.label_CALCULATED_NOTES_PER_BEAT.Text
=
"CALCULATED_NOTES_PER_BEAT( 2^ TS_DENOMINATOR)="
+
this.public_double___label_CALCULATED_NOTES_PER_BEAT.ToString();
//////Math.Pow
//////(
////// 2,
//////this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
//////)
//////.ToString();
// +this.public_double___label_CALCULATED_NOTES_PER_BEAT.ToString();/// denominator of time signature
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// we will calculate the total minutes from the microsecond duration and then use bpm to find the beats count
/// and then we will calculate the notes count from the whole duration then we will calculate the notes duration in terms of midi ticks
///
this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_TICKS_OF_MIDI___INTEGER___MIDITKS_PER_NOTE
=
this.public_double___label_CALCULATED_DURATION_OF_MIDI_MEASURE_BAR_SIZE_IN_TICKS_OF_MIDI
*
this.public_double___label_CALCULATED_TOTAL_NUMBER_OF_MIDI_NOTES_IN_TOTAL_DURATION_OF_MIDI_TICKS
;
///to do kkk
///;
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
//////this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
this.public_double___label_CALCULATED_NOTES_PER_BEAT
= (double)this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
;
/////////////////////////////////////////////////////////////////
this.public_double___label_CALCULATED_THE_MIDITICKS_PER_NOTE
=
this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
/
this.public_double___label_CALCULATED_NOTES_PER_BEAT;
///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////// important calculation /////////////////
int revised_integer_miditicks_per_note
=
(int)(this.public_double___label_CALCULATED_THE_MIDITICKS_PER_NOTE)
+ 1;
///////////////////////////////////////////////////////////////////////////////////////////
this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_TICKS_OF_MIDI___INTEGER___MIDITKS_PER_NOTE
= revised_integer_miditicks_per_note;
///////////////////////////////////////////////////////////////////////////////////////////
this.label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_TICKS_OF_MIDI.Text
= this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_TICKS_OF_MIDI___INTEGER___MIDITKS_PER_NOTE.ToString()
+ " MIDITKS/NOTE";
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
//////this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE
////// =
////// this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_TICKS_OF_MIDI___INTEGER___MIDITKS_PER_NOTE
////// /
////// this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
////// ;
///
///I DID THE MISTAKE PREVIOUSLY WE HAD TO MULTIPLY INSTEAD OF DIVIDING
this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE
=
this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_TICKS_OF_MIDI___INTEGER___MIDITKS_PER_NOTE
*
this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
;
///////////////////////////////////////////////////////////////////////////////////////////
///
///
////////////////////////////// new variables added and calculated to check listenability of notes//////////////////
////////////////////////////// new variables added and calculated to check listenability of notes//////////////////
////////////////////////////// new variables added and calculated to check listenability of notes//////////////////
this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MILLISECONDS = 0;
this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MILLISECONDS
=
(this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE / 1000);
////// after calculating we see division is right
///
///I THINK I HAVE TO DO MULTIPLICATIONS INSTEAD OF DIVISIONS
// this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MILLISECONDS
// =
// (this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE * 1000);
if (this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MILLISECONDS < 50)
{
this.textBoxFOR_BEATS_PER_MINUTE.ForeColor = Color.Red;
}
else
{
this.textBoxFOR_BEATS_PER_MINUTE.ForeColor = Color.Black;
}//else if(this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MILLISECONDS<50)
////////////////////////////// new variables added and calculated to check listenability of notes//////////////////
////////////////////////////// new variables added and calculated to check listenability of notes//////////////////
////////////////////////////// new variables added and calculated to check listenability of notes//////////////////
////// this.label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE.Text
////// =
////// this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_TICKS_OF_MIDI___INTEGER___MIDITKS_PER_NOTE
////// + " MIDTICKS/NOTE ÷ "
////// + this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
////// .ToString("F6")
////// + " TICKS / BEATS (k times 480)= "
////// + this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE
////// + " MCRSEC / NOTES CALCS "
/////////+ (this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE/1000)
//////+ this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MILLISECONDS
////// /// .ToString("F30")
////// /// .ToString("F11")
////// .ToString("F6")
////// + " MILLISEC / NOTES"
////// ;
///
///DENOMINATOR OF TIME SIGNATURE AFFECTS THIS
///NUMERATOR OF TIME SIGNATURE DONT AFFECT THIS
///TOTAL DURATIONS OF THE WHOLE THING DONT AFFECT THIS
///TPQN THAT IS 480 , 960 , 1000 .... AFFECTS THIS
this.label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE.Text
=
this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_TICKS_OF_MIDI___INTEGER___MIDITKS_PER_NOTE
+ " MIDTICKS/NOTES X "
+ this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
.ToString("F6")
+ " MICROSEC / MIDITCK "
/// + " TICKS / BEATS (k times 480)= "
+ this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE
+ " MCRSEC / NOTES => "
///
///+ (this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE/1000)
+ this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MILLISECONDS
/// .ToString("F30")
/// .ToString("F11")
.ToString("F6")
+ " MILLISEC / NOTES"
;
///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////
int ___need_to_revise___miditicks_per_beat_to_integer
=
(int)
(
revised_integer_miditicks_per_note
*
this.public_double___label_CALCULATED_NOTES_PER_BEAT
);
if (this.public_double___label_CALCULATED_THE_MIDITICKS_PER_NOTE != (int)(this.public_double___label_CALCULATED_THE_MIDITICKS_PER_NOTE))
{
System.Windows.Forms.MessageBox.Show
(
"___need_to_revise___miditicks_per_beat_to_integer = "
+ ___need_to_revise___miditicks_per_beat_to_integer.ToString()
);
}// if (this.public_double___label_CALCULATED_THE_MIDITICKS_PER_NOTE != (int)(this.public_double___label_CALCULATED_THE_MIDITICKS_PER_NOTE))
////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
/// <summary>
/// FOR DIFFERENT CONTEXTS WE HAVE DIFFERENT COMPACTNESS DURATION FOR THE WHOLE THINGS AND SO WE DO THE REVERSE CALCULATIONS FOR THE SINGLE NOTES
/// AND TO PLAN FOR THAT WE NEED THE CLARITY OF DISTRIBUTIONS FOR EVERY KINDS OF INSTRUMENTS SUCH THAT WE CAN UNDERSTAND WHAT ARE THE NATURES OF OVERLAPPING
/// IN THE SYSTEMS OF THE NOTES PLACEMENTS THE CLARITY OF NOTES PLACEMENTS ARE IMPORTANT OTHERWISE SEVERAL OVERLAPS OF DIFFERENT NOTES CAN OCCUR WHICH LOOKS CLUMSY OR NOT RENDERED PROPERLY
/// </summary>
/// public double PUBLIC_DOUBLE___MIDITKS_TO_MILLISECOND_CONVERTER_FOR_THIS_CONTEXT___MILLISECONDS_PER_MIDITKS = 1;
/// public double PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS = 1;
///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.PUBLIC_DOUBLE___MIDITKS_TO_MILLISECOND_CONVERTER_FOR_THIS_CONTEXT___MILLISECONDS_PER_MIDITKS
=
(double)(
(double)
(
double)this.public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS
/
(double)1000
/
(double)this.public_long___calculated_data_for___label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS
)
;
/// i need to check the overlapping same miditks assigned to notes events and other events
/// this is necessary to plan the clarity for the sounds generated in the systems
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS
=
(1 / this.PUBLIC_DOUBLE___MIDITKS_TO_MILLISECOND_CONVERTER_FOR_THIS_CONTEXT___MILLISECONDS_PER_MIDITKS);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// IF WE TAKE 1000 INSTEAD OF 960 AND THE BPM IS 60 THEN THESE TWO ARE 1
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.label_CONVERTIONS_RATIOS_MIDTKS_TO_MILLIS.Text
=
"CONVERTIONS_RATIOS MIDITKS/MILLIS = "
+
this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS
.ToString("F3")
+
" MILLIS/MIDITKS = "
+
this.PUBLIC_DOUBLE___MIDITKS_TO_MILLISECOND_CONVERTER_FOR_THIS_CONTEXT___MILLISECONDS_PER_MIDITKS
.ToString("F3")
+
" (1 FOR BPM=60 AND 1000 INSTEAD OF 960 FOR TS DENOMINATOR 4(4 BEATS IS 1 NOTE)) "
;
///TPQN IS THE TICKS PER QUARTER NOTE WHICH IS TPQN
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///BEAT TO NOTE AND NOTE TO BEAT RELATIONSHIPS ARE DONE THROUGH THE DENOMINATOR OF TIME SIGNATURES
/////DENOMINATOR NUMBER OF BEATS MAKE ONE SINGLE NOTE FOR THE RHYTHMS CONTROLLERS METRONOMES CLAPPING ARE ADJUSTED WITH THE DENOMINATORS AND THE BEATS ADJUST THE NOTES IN THAT
///BUT THE TICKS TO BEATS AND THE MICROSOECONDS TO BEATS ARE NOT THE DIRECT RELATIONSHIP WITH THE TIME SIGNATURES DENOMINATORS
///BEATS (QUARTER NOTE STANDARD THAT IS 1 BEAT IS 1/4 OF THE WHOLE NOTE WHEN THE DENOMINATOR IS 4 )ARE THE GRIDDING SYSTEMS FOR SOUNDS FLOWS. THESE ARE THE UNITS FOR THE DISTRIBUTIONS OF THE WHOLE THINGS.
///BEATS PER MINUTES IS DIVIDED INTO SMALLER PARTS OF SYSTEMS CLOCKS SPEEDS AND THE MIDI INSTRUMENTS STANDERDIZES THE TIMES TO MIDITICKS
///THESE MIDITICKS
//WHEN THE DENOMINATOR IS NOT 4 THEN THE DIVISIONS ARE DIFFERENT AND THE BEATS DONT MEAN THE QUARTER NOTE FOR THAT CASES
///BEAT IS THE FUNDAMENTAL TIME SCALE FOR THE RHYTHMS AND DONT CONFUSE THE RELATIONS BETWEEN THE BEATS TO NOTES(WHICH IS THE DENOMINATOR OF TIME SIGNATURES)
///
////// Every MIDI file has a value called Ticks Per Quarter Note(TPQN) or Pulses Per Quarter(PPQ).
///Tick is the smallest unit of length.So for example if TPQN = 96, it means that a note of length 96 ticks represents a quarter note.
///But a note of length 96 for TPQN = 192 represents an eighth note.
/// This message is important if the MIDI time division is specified in "pulses per quarter note", as such MIDI time division defines the number of ticks per quarter note, but does not itself define the length of the quarter note.The length of the quarter note is then defined with the set tempo meta message described here.
///RECORDINGBLOG FOR REFERENCES
///Time division (of a MIDI file)
///https://www.recordingblogs.com/wiki/time-division-of-a-midi-file
////////////The time division of a MIDI file, also known as "resolution of a MIDI file", is an indication of how MIDI ticks should be translated into time, contained in the thirteenth and fourteenth bytes in the header chunk of the MIDI file.
////////////There are two possible translations of these two bytes(16 bits).
///If the top bit of the 16 bits is 0, then the time division is in "ticks per beat"(or “pulses per quarter note”).
///If the top bit is 1, then the time division is in "frames per second".
////////////Pulses per quarter note(PPQ)
////////////When the top bit of the time division bytes is 0, the time division is in ticks per beat.
///The remaining 15 bits are the number of MIDI ticks per beat(per quarter note).If, for example, these 15 bits compute to the number 60, then the time division is 60 ticks per beat and the length of one tick is
////////////1 tick = microseconds per beat / 60
////////////The variable "microseconds per beat" is specified by a set tempo meta message.If it is not specified then it is 500, 000 microseconds by default, which is equivalent to 120 beats per minute.In the example above, if the MIDI time division is 60 ticks per beat and if the microseconds per beat is 500,000, then 1 tick = 500,000 / 60 = 8333.33 microseconds.
////////////Frames per second
////////////When the top bit of the time division bytes is 1, the remaining 15 bits have to be broken in two pieces. The top remaining 7 bits(the rest of the top byte) represent the number of frames per second and could be 24, 25, 29.97(represented by 29), or 30.The low byte(the low 8 bits) describes the number of ticks per frame.Thus, if, for example, there are 24 frames per second and there are 100 ticks per frame, since there are 1, 000, 000 microseconds in a second, one tick is equal to
////////////1 tick = 1, 000, 000 / (24 * 100) = 416.66 microseconds
////////////Thus, when the time division top bit is 1, the length of a tick is strictly defined by the two time division bytes.The first byte is the frames per second and the second byte is the number of ticks per frame, which is enough to specify the tick length exactly.This is not so when the top bit of the time division bytes is 0 and the time division is in pulses per quarter note.The time division in this case defines the ticks per beat, but nothing in the time division specifies the number of beats per second.A MIDI message should be used to specify the number of beats per second(or the length of a beat), or it should be left up to the MIDI device to set the tempo(120 beats per minute by default, as mentioned above).
try
{
//////To reverse calculate the beats per minute(BPM) for a MIDI song given its total duration, time signature numerator, and denominator, you can follow these steps:
//////1.Convert microseconds to minutes:
//////Divide the total duration ttt in microseconds by the number of microseconds in a minute:
//////duration_minutes = ttt / (1000 * 1000 * 60)
//////2.Calculate beats based on time signature:
//////Multiply the time signature numerator n_known by the number of minutes:
//////beats = n_known * duration_minutes
//////3.Calculate BPM using denominator:
//////Divide the calculated beats by the time signature denominator d_known and multiply by 60 to convert to beats per minute:
//////bpm = (beats / d_known) * 60
//////Therefore, the formula for calculating BPM is:
//////bpm = ((n_known * ttt) / (d_known * 1000 * 1000 * 60)) * 60
//////Example:
//////Suppose a MIDI song has a total duration of 3, 000, 000 microseconds(3 seconds) and a time signature of 4 / 4.Using the formula:
//////bpm = ((4 * 3000000) / (4 * 1000 * 1000 * 60)) * 60
//////bpm = 120.0
//////Therefore, the calculated BPM for this example is 120.
this.public_double_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_DIRECT
= Math.Max(1, public_double_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_DIRECT)
;
//////this.public_double___reverse_calculated_data_for___MELODY_BPM_ESTIMATED
////// =
////// /// (60000000 / this.public_long_total_microsecond_of_song___from___textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS)
////// (60000000 / (double)this.public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS)
////// *
////// (
////// (double)this.public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
////// /
////// /// (double) this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
////// (double)this.public_double_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_DIRECT
////// );
///
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
this.public_double___reverse_calculated_data_for___MELODY_BPM_ESTIMATED
=
/// (60000000 / this.public_long_total_microsecond_of_song___from___textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS)
((double)this.public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS / 60000000)
*
(
(double)this.public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
/
/// (double) this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
(double)this.public_double_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_DIRECT
)
*
60
;
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
//yes i have tested that the calculations are perfect
System.Windows.Forms.MessageBox.Show("MELODY_BPM_CALCULATED= " + this.public_double___reverse_calculated_data_for___MELODY_BPM_ESTIMATED);
// this.label_MELODY_BPM_ESTIMATED.Text
this.label_MELODY_BPM_ESTIMATED.Text
=
"MELODY_BPM_ESTIMATED = "
+
////*this.public_double___reverse_calculated_data_for___MELODY_BPM_ESTIMATED.ToString("G27")
this.public_double___reverse_calculated_data_for___MELODY_BPM_ESTIMATED.ToString()
;
this.label_MELODY_BPM_ESTIMATED.Invalidate();
this.label_MELODY_BPM_ESTIMATED.Update();
}
catch (Exception ___excp_to_calculate_the_melodybpmcalculations)
{
System.Windows.Forms.MessageBox.Show("___excp_to_calculate_the_melodybpmcalculations = " + ___excp_to_calculate_the_melodybpmcalculations.Message + ___excp_to_calculate_the_melodybpmcalculations.StackTrace.ToString());
}//catch(Exception ___excp_to_calculate_the_melodybpmcalculations)
//////this.public_double___label_CALCULATED_THE_MIDITICKS_PER_NOTE
////// =
////// this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480
////// /
////// this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
////// ;
this.label_CALCULATED_THE_MIDITICKS_PER_NOTE.Text
=
"MIDITICKS / NOTE ="
+ this.public_double___label_CALCULATED_THE_MIDITICKS_PER_NOTE.ToString()
+ " ===> " + revised_integer_miditicks_per_note.ToString()
;
////////////////////////////////////////////////////////////////////////////////////////////
double _double_midi_ticks_per_minute
=
//////this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480
//////+" * "+
//////this.PUBLIC_DOUBLE_BPM_VALUE_FROM___textBoxFOR_BEATS_PER_MINUTE
//////+ "= " +
this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480
*
this.PUBLIC_DOUBLE_BPM_VALUE_FROM___textBoxFOR_BEATS_PER_MINUTE
;
//////double _double_ticks_per_note
////// =
////// this.micro
////// this.PUBLIC_DOUBLE_BPM_VALUE_FROM___textBoxFOR_BEATS_PER_MINUTE
///////////////////////////////////////////////////////////////////////////////////////////////
///
//////this.public_double___label_CALCULATED_TOTAL_NUMBER_OF_MIDI_NOTES_IN_TOTAL_DURATION_OF_MIDI_TICKS
////// =
////// Math.Floor
////// (
////// this.public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS
////// /
////// this.public_double___label_CALCULATED_DURATION_OF_MIDI_NOTES_IN_THE_MICROSECONDS___MICROSEC_PER_NOTE
////// )
////// ;
this.public_double___label_CALCULATED_TOTAL_NUMBER_OF_MIDI_NOTES_IN_TOTAL_DURATION_OF_MIDI_TICKS
=
Math.Floor
(
this.public_long___calculated_data_for___label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS
/
this.public_double___label_CALCULATED_THE_MIDITICKS_PER_NOTE
);
///////////////////////////////////////////////////////////////////////////////////////////////
this.label_CALCULATED_TOTAL_NUMBER_OF_MIDI_NOTES_IN_TOTAL_DURATION_OF_MIDI_TICKS.Text
=
this.public_double___label_CALCULATED_TOTAL_NUMBER_OF_MIDI_NOTES_IN_TOTAL_DURATION_OF_MIDI_TICKS
// .ToString()
.ToString("F11")
+ " LINEAR END TO END SEQUENCE OF NOTES FITS BEST";
///////////////////////////////////////////////////////////////////////////////////////////////
///this.CALCULATED_TOTAL_NUMBER_OF_MEASURES_FOUND_TOTAL_NUMBERS_OF_BARS_FOUND_IN_TOTAL_DURATION
this.public_double___label_CALCULATED_TOTAL_NUMBER_OF_MEASURES_FOUND_TOTAL_NUMBERS_OF_BARS_FOUND_IN_TOTAL_DURATION
=
Math.Ceiling
(
((double)this.public_long___calculated_data_for___label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS)
/
((double)this.public_double___label_CALCULATED_DURATION_OF_MIDI_MEASURE_BAR_SIZE_IN_TICKS_OF_MIDI)
);
///////////////////////////////////////////////////////////////////////////////////////////////
this.label_CALCULATED_TOTAL_NUMBER_OF_MEASURES_FOUND_TOTAL_NUMBERS_OF_BARS_FOUND_IN_TOTAL_DURATION.Text
=
this.public_double___label_CALCULATED_TOTAL_NUMBER_OF_MEASURES_FOUND_TOTAL_NUMBERS_OF_BARS_FOUND_IN_TOTAL_DURATION
.ToString()
+
" LINEAR END TO END FITS BEST BAR MEASURES ";
///////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////// CATCH STARTS HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH STARTS HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH STARTS HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH STARTS HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH STARTS HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH STARTS HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH STARTS HERE TO FILL DEFAULT VALUES ////////////////
}
catch (Exception excp_to_convert_to_microseconds)
{
this.public_long_total_microsecond_of_song___from___textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS
= 180000000;/// long type variable
public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS
=
(
(int)(
public_long_total_microsecond_of_song___from___textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS
/ 480
)
+ 1
)
* 480;
this.label_TOT_MICROSECONDS_DURATION_NX480_OR_N_X_TPQN
.Text
=
public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS
.ToString();
////////////////////////////////////////////////////////////////////////////////////////////
///TS MEANS TIME SIGNATURE
this.public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
= 4;//default numerator for beats per measure
/////////////////////////////////////////////////////////////////////////////////////////////
///TS MEANS TIME SIGNATURE
this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
= 4; ////// default denominator notes per beat is 2^2 that is the 4 (we take it as 4)
////////////////////////////////////////////////////////////////////////
///tooooooooo important data
///
this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480
= 480;/// default is 8 x 60
/////////////////////////////////////////////////////////////////////////////////
///
this.PUBLIC_DOUBLE_BPM_VALUE_FROM___textBoxFOR_BEATS_PER_MINUTE
= 120;///default
this.public_long_FOR___label_CALCULATED_DATA_MICROTEMPO_THAT_IS_MICROSECONDS_PER_BEAT
=
(long)
(
60000000
/
this.PUBLIC_DOUBLE_BPM_VALUE_FROM___textBoxFOR_BEATS_PER_MINUTE
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
=
(
this.public_long_FOR___label_CALCULATED_DATA_MICROTEMPO_THAT_IS_MICROSECONDS_PER_BEAT
/
this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480
);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK.Text
=
"MICROSEC/MIDITICK=" + this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
.ToString()
;
/////////////////////////////////////////////////////////////////////////
System.Windows.Forms.MessageBox.Show("reaching here MELODY_BPM_CALCULATED to calculate " );
try
{
this.public_double_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_DIRECT
= Math.Max(1, public_double_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_DIRECT)
;
this.public_double___reverse_calculated_data_for___MELODY_BPM_ESTIMATED
=
/// (60000000 / this.public_long_total_microsecond_of_song___from___textBox_FOR_MIDI_TOTAL_DURATIONS_MICROSECONDS)
(60000000 / (double)this.public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS)
*
(
(double)this.public_integer_time_signatures_numerator_value_taken_from_text_box_textBox_TS_NUMERATOR_IS_BEATS_PER_MEASURE_OR_BARSIZE_PER_TPQN_TO_REPRESENT
/
/// (double) this.public_integer_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_N_TH_POWER_OF_2
(double)this.public_double_time_signatures_denominators_value_taken_from_text_box_directly_for_textBox_TS_DENOMINATOR_IS_THE_NOTES_PER_BEAT_OF_TIME_SIGNATURE_NOTES_PER_BEAT_IT_IS_DIRECT
);
System.Windows.Forms.MessageBox.Show("MELODY_BPM_CALCULATED= " + this.public_double___reverse_calculated_data_for___MELODY_BPM_ESTIMATED);
// this.label_MELODY_BPM_ESTIMATED.Text
this.label_MELODY_BPM_ESTIMATED.Text
=
"MELODY_BPM_ESTIMATED = "
+
////*/*/*this.public_double___reverse_calculated_data_for___MELODY_BPM_ESTIMATED.ToString("G27")*/*/*/
this.public_double___reverse_calculated_data_for___MELODY_BPM_ESTIMATED.ToString()
;
this.label_MELODY_BPM_ESTIMATED.Invalidate();
this.label_MELODY_BPM_ESTIMATED.Update();
}
catch (Exception ___excp_to_calculate_the_melodybpmcalculations)
{
System.Windows.Forms.MessageBox.Show("___excp_to_calculate_the_melodybpmcalculations = " + ___excp_to_calculate_the_melodybpmcalculations.Message + ___excp_to_calculate_the_melodybpmcalculations.StackTrace.ToString());
}//catch(Exception ___excp_to_calculate_the_melodybpmcalculations)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
this.public_long___calculated_data_for___label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS
=
(long)
(
(double)
this.public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS
/
this.public_double_calculated_data_from_bpm_from_ticks_per_beat_k_times_480___for___label_CALCULATED_VALUE_MICROSECOND_PER_MIDI_TICK
);
/////////////////////////////////////////////////////////////////////////////////////////////////////
this.label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS.Text
= "TOT_MIDITICS= " +
this.public_long___calculated_data_for___label___for___CALCULATED_TOTAL_DURATION_WITH_MIDITICKS
.ToString();
}//catch(Exception excp_to_convert_to_microseconds)
////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
///
////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
try
{
//////public double PUBLIC_DOUBLE___TOTAL_WEIGHT_IS_SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES = 0.000000000000001;
//////public double PUBLIC_DOUBLE___TOTAL_WEIGHTFACTOR_IS_TOTAL_NOTES_IN_THE_SONG_DIVIDED_WITH___SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES = 0;
//////public double PUBLIC_DOUBLE___TOT_MILLISECONDS = 0;
//////public double PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions = 0;
//////public double PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions = 0;
//////public double PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied = 0;
//////public int PUBLIC_INT___TOTAL_NOTES_IN_THE_SONG = 0;
//////public int PUBLIC_INT___TPQN___TICKS_PER_QUARTERNOTES_480_K = 0;
///
//////////////////////////////FLUSHING THE DATA FIRST ///////////////////////
this.PUBLIC_DOUBLE___TOTAL_WEIGHT_IS_SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES = 0.000000000000001;
this.PUBLIC_DOUBLE___TOTAL_WEIGHTFACTOR_IS_TOTAL_NOTES_IN_THE_SONG_DIVIDED_WITH___SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES = 0;
this.PUBLIC_DOUBLE___TOT_MILLISECONDS = 0;
this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions = 0;
this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions = 0;
this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied = 0;
this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG = 0;
this.PUBLIC_INT___TPQN___TICKS_PER_QUARTERNOTES_480_K = 0;
this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG___TO___PLAN___FROM___TEXTBOX_DATA_TO_ACHIEVES = 0;
//////////////////////////////FLUSHING THE DATA FIRST ///////////////////////
/// textBox___TOTAL_NOTES_TO_PLAN_ITERATES
///
this.PUBLIC_DOUBLE___TO_REITERATE_TO_FIND___FOR_textBox___TOTAL_NOTES_TO_PLAN_ITERATES = 0;
this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG___TO___PLAN___FROM___TEXTBOX_DATA_TO_ACHIEVES = 0;
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Drums_NOTES_COUNTS = 0;
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Strings_NOTES_COUNTS = 0;
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Winds_NOTES_COUNTS = 0;
//////////////////////////////////////////////////////// REPOPULATING DATA HERE ///////////////////////
//////////////////////////////////////////////////////// REPOPULATING DATA HERE ///////////////////////
//////////////////////////////////////////////////////// REPOPULATING DATA HERE ///////////////////////
/// i have done it to micro seconds i think
// public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS
this.PUBLIC_DOUBLE___TOT_MILLISECONDS
=
this.public_long_total_RECALCULATED_WITH_MULTIPLE_OF_480_OR_TPQN__FROM_THE_TPQN_TEXT_BOX_FOR_MIDI_TOTAL_DURATIONS_MILLISECONDS
/ 1000;
goto_here_if___mismatch___this___PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG___TO___PLAN___FROM___TEXTBOX_DATA_TO_ACHIEVES:;
try
{
this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions = Convert.ToDouble(this.textBox_DRUMS_RECOGNITIONS_MILLISECONDS.Text.ToString().TrimEnd().TrimStart().Trim());
}
catch (Exception ___excptoreadtextboxtoconverttodata)
{
this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions = 50;
}//catch(Exception ___excptoreadtextboxtoconverttodata)
try
{
this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions = Convert.ToDouble(this.textBox__STRINGS_RECOGNITIONS_MILLISECONDS.Text.ToString().TrimEnd().TrimStart().Trim());
}
catch (Exception ___excptoreadtextboxtoconverttodata)
{
this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions = 110;
}//catch(Exception ___excptoreadtextboxtoconverttodata)
try
{
this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied = Convert.ToDouble(this.textBox__WINDS_RECOGNITIONS_MILLISECONDS.Text.ToString().TrimEnd().TrimStart().Trim());
}
catch (Exception ___excptoreadtextboxtoconverttodata)
{
this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied = 300;
}//catch(Exception ___excptoreadtextboxtoconverttodata)
try
{
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Drums_NOTES_COUNTS
= Convert.ToDouble(this.textBox_TOTAL_DRUMS_NOTES_COUNT.Text.ToString().TrimEnd().TrimStart().Trim());
}
catch (Exception ___excptoreadtextboxtoconverttodata)
{
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Drums_NOTES_COUNTS = 1100;
}//catch(Exception ___excptoreadtextboxtoconverttodata)
try
{
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Strings_NOTES_COUNTS
= Convert.ToDouble(this.textBox_TOTAL_STRING_NOTES_COUNT.Text.ToString().TrimEnd().TrimStart().Trim());
}
catch (Exception ___excptoreadtextboxtoconverttodata)
{
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Strings_NOTES_COUNTS = 3300;
}//catch(Exception ___excptoreadtextboxtoconverttodata)
try
{
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Winds_NOTES_COUNTS
= Convert.ToDouble(this.textBoxTOTAL_WIND_NOTES_COUNT.Text.ToString().TrimEnd().TrimStart().Trim());
}
catch (Exception ___excptoreadtextboxtoconverttodata)
{
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Winds_NOTES_COUNTS = 660;
}//catch(Exception ___excptoreadtextboxtoconverttodata)
////////////////////////////////////////////////////////////////////////////////////////
this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG
=
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Drums_NOTES_COUNTS
+
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Strings_NOTES_COUNTS
+
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Winds_NOTES_COUNTS
;
////////////////////////////////////////////////////////////////////////////////////////
this.label_TOTAL_NOTES_COUNT.Text
=
this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG.ToString() + " NOTES";
////////////////////////////////////////////////////////////////////////////////////////
try
{
this.PUBLIC_DOUBLE___TO_REITERATE_TO_FIND___FOR_textBox___TOTAL_NOTES_TO_PLAN_ITERATES
= Convert.ToDouble(this.textBox___TOTAL_NOTES_TO_PLAN_ITERATES.Text.ToString().TrimEnd().TrimStart().Trim());
this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG___TO___PLAN___FROM___TEXTBOX_DATA_TO_ACHIEVES
= Convert.ToDouble(this.textBox___TOTAL_NOTES_TO_PLAN_ITERATES.Text.ToString().TrimEnd().TrimStart().Trim());
}
catch (Exception ___excptoreadtextboxtoconverttodata)
{
this.PUBLIC_DOUBLE___TO_REITERATE_TO_FIND___FOR_textBox___TOTAL_NOTES_TO_PLAN_ITERATES
= this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG;
this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG___TO___PLAN___FROM___TEXTBOX_DATA_TO_ACHIEVES
=
0;
}//catch(Exception ___excptoreadtextboxtoconverttodata)
this.PUBLIC_INT___TPQN___TICKS_PER_QUARTERNOTES_480_K
=
(int)this.public_double___value_from_the___textBox_TS_MIDI_TICKS_PER_BEAT_OR_TPQN_NUMBER_MULTIPLE_OF_480;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.PUBLIC_DOUBLE___TOTAL_WEIGHT_IS_SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES
=
/// 0.000000000000001;
this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions
+
this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions
+
this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied
;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.label_WEIGHT_SENSITIVITY_FOUND___TOTAL_RECOGNIZER_MILLISECONDS_FOR_3_TYPES_OF_INSTRUMENTS.Text
=
this.PUBLIC_DOUBLE___TOTAL_WEIGHT_IS_SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES
.ToString() + " milliseconds 3 instruments SENSITIVITY";
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.PUBLIC_DOUBLE___TOTAL_WEIGHTFACTOR_IS_TOTAL_NOTES_IN_THE_SONG_DIVIDED_WITH___SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES
=
this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG
/
this.PUBLIC_DOUBLE___TOTAL_WEIGHT_IS_SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES
;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.label___WEIGHT_SENSITIVITY_FACTOR_FOR_3_TYPES_OF_INSTRUMENTS.Text
=
this.PUBLIC_DOUBLE___TOTAL_WEIGHTFACTOR_IS_TOTAL_NOTES_IN_THE_SONG_DIVIDED_WITH___SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES
.ToString("F11")
+ " weight factor(est notes count / weight sensitivity)"
;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// revising the estimated drums notes
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Drums_NOTES_COUNTS
=
/// this.PUBLIC_DOUBLE___TO_REITERATE_TO_FIND___FOR_textBox___TOTAL_NOTES_TO_PLAN_ITERATES
this.PUBLIC_DOUBLE___TOT_MILLISECONDS
/
(
(
this.PUBLIC_DOUBLE___TOTAL_WEIGHTFACTOR_IS_TOTAL_NOTES_IN_THE_SONG_DIVIDED_WITH___SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES
*
this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions
)
+
(
this.PUBLIC_DOUBLE___TOTAL_WEIGHTFACTOR_IS_TOTAL_NOTES_IN_THE_SONG_DIVIDED_WITH___SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES
*
this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions
)
+
(
this.PUBLIC_DOUBLE___TOTAL_WEIGHTFACTOR_IS_TOTAL_NOTES_IN_THE_SONG_DIVIDED_WITH___SUM_OF_MILLISECONDS_OF_MIN_NECESSARY_RECOGNIZER_FOR_DRUMS_PLUS_STRINGS_PLUS_WINDS_NOTES
*
this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied
)
);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.textBox_TOTAL_DRUMS_NOTES_COUNT.Text
=
( (int)(this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Drums_NOTES_COUNTS)).ToString();
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Strings_NOTES_COUNTS
=
(
// (int)
(
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Drums_NOTES_COUNTS
*
(
this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions
/
this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions
)
)
)
//.ToString()
;
////////////////////////////////////////////////////////////////////
this.textBox_TOTAL_STRING_NOTES_COUNT.Text
=
((int)this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Strings_NOTES_COUNTS).ToString();
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Winds_NOTES_COUNTS
=
(
// (int)
(
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Drums_NOTES_COUNTS
*
(
this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions
/
this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied
)
)
)
// .ToString();
;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.textBoxTOTAL_WIND_NOTES_COUNT.Text
=
((int)this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Winds_NOTES_COUNTS).ToString();
//////// Solve for D, S, W
//////double totalWeight = t_Drums_min_milliseconds + t_Strings_min_milliseconds + t_Winds_min_milliseconds;
//////double weightFactor = TOTAL_NOTES_IN_THE_SONG / totalWeight;
//////double D = TOT_MILLISECONDS / (weightFactor * t_Drums_min_milliseconds + t_Strings_min_milliseconds + t_Winds_min_milliseconds);
//////double S = D * (t_Drums_min_milliseconds / t_Strings_min_milliseconds);
//////double W = D * (t_Drums_min_milliseconds / t_Winds_min_milliseconds);
//////Console.WriteLine($"D (Percussive Notes): {D}");
//////Console.WriteLine($"S (String Notes): {S}");
//////Console.WriteLine($"W (Wind Notes): {W}");
//////// Calculate TOT_MINUTES
//////double TOT_MINUTES = TOT_MILLISECONDS / 60000.0;
//////// Calculate BPM
//////double BPM = TOTAL_NOTES_IN_THE_SONG / TOT_MINUTES;
//////Console.WriteLine($"BPM: {BPM}");
//////// MIDI Ticks Calculation
//////double Note_duration_ticks = (BPM * TOT_MILLISECONDS) / (60000.0 * TPQN___TICKS_PER_QUARTERNOTES_480_K);
//////Console.WriteLine($"Note duration in ticks: {Note_duration_ticks}");
////////////////////////////////////////////////////////////////////////////////////////
this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG
=
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Drums_NOTES_COUNTS
+
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Strings_NOTES_COUNTS
+
this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Winds_NOTES_COUNTS
;
////////////////////////////////////////////////////////////////////////////////////////
this.textBox___TOTAL_NOTES_TO_PLAN_ITERATES.Text
=
((int)this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG)
.ToString();
/////////////////////////////will do reiterations
try
{
this.public_double_centi_degrees_per_milliseconds___for_reverse_calculations_of_lengths_on_dxf = 0;
this.public_double_centi_degrees_per_milliseconds___for_reverse_calculations_of_lengths_on_dxf
=
( 1 / this.public_double_milliseconds_per_centi_degrees);
///radians calculations not done for this
}
catch (Exception ___excp_to_convert_given_radius)
{
}//catch(Exception ___excp_to_convert_given_radius)
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
try
{
this.public_double_degrees_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf = 0;
this.public_double_degrees_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf
=
( 1 /
this.public_double_milliseconds_per_UNIT_SINGLE_degrees
)
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.public_double_radians_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf = 0;
this.public_double_radians_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf
=
this.public_double_degrees_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf
* Math.PI / 180;
}
catch (Exception ___excp_to_convert_given_radius)
{
}//catch(Exception ___excp_to_convert_given_radius)
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
try
{
this.PUBLIC_DOUBLE_GIVEN_RADIUS_AS_FREQUENCY_TO_CHECK_SIZED_OF_DIFFERENT_NOTES_ON_TANGENT_OF_CIRCUMFERENCES_FOR_GIVEN_FREQUENCY___textBox_PRECALC_NOTES_LENGTHS_FITS_FOR_FREQ_AS_RADIUS
=
Convert.ToDouble
(
this.textBox_PRECALC_NOTES_LENGTHS_FITS_FOR_FREQ_AS_RADIUS
.Text
.TrimEnd().TrimStart().Trim().Replace(" ", "")
);
this.textBox_PRECALC_NOTES_LENGTHS_FITS_FOR_FREQ_AS_RADIUS.BackColor = Color.White;
}
catch (Exception ___excp_to_convert_given_radius)
{
this.textBox_PRECALC_NOTES_LENGTHS_FITS_FOR_FREQ_AS_RADIUS.BackColor = Color.PaleVioletRed;
this.PUBLIC_DOUBLE_GIVEN_RADIUS_AS_FREQUENCY_TO_CHECK_SIZED_OF_DIFFERENT_NOTES_ON_TANGENT_OF_CIRCUMFERENCES_FOR_GIVEN_FREQUENCY___textBox_PRECALC_NOTES_LENGTHS_FITS_FOR_FREQ_AS_RADIUS
=
100;
}//catch(Exception ___excp_to_convert_given_radius)
//////public double PUBLIC_DOUBLE___ESTIMATED_DRUMS_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE___ESTIMATED_STRING_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE___ESTIMATED_WIND_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE_GIVEN_RADIUS_AS_FREQUENCY_TO_CHECK_SIZED_OF_DIFFERENT_NOTES_ON_TANGENT_OF_CIRCUMFERENCES_FOR_GIVEN_FREQUENCY = 0;
//////public double PUBLIC_DOUBLE___ESTIMATED_DRUMS_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE___ESTIMATED_STRING_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE___ESTIMATED_WIND_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE___ESTIMATED_DRUMS_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE___ESTIMATED_STRING_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE___ESTIMATED_WIND_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions = 0;
//////public double PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions = 0;
//////public double PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied = 0;
///
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// for the drums beats the maximum milliseconds is given and the frequency circle data is given
/// so we need the estimates to draw the dxf files properly such that we can know how to generate the notes tangentially to construct the notes
/// such that we can prepare the geometry properly well calculated
this.PUBLIC_DOUBLE___ESTIMATED_DRUMS_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES
=
this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions
*
this.public_double_radians_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf
*
this.PUBLIC_DOUBLE_GIVEN_RADIUS_AS_FREQUENCY_TO_CHECK_SIZED_OF_DIFFERENT_NOTES_ON_TANGENT_OF_CIRCUMFERENCES_FOR_GIVEN_FREQUENCY___textBox_PRECALC_NOTES_LENGTHS_FITS_FOR_FREQ_AS_RADIUS
;
this.PUBLIC_DOUBLE___ESTIMATED_STRING_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES
=
this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions
*
this.public_double_radians_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf
*
this.PUBLIC_DOUBLE_GIVEN_RADIUS_AS_FREQUENCY_TO_CHECK_SIZED_OF_DIFFERENT_NOTES_ON_TANGENT_OF_CIRCUMFERENCES_FOR_GIVEN_FREQUENCY___textBox_PRECALC_NOTES_LENGTHS_FITS_FOR_FREQ_AS_RADIUS
;
this.PUBLIC_DOUBLE___ESTIMATED_WIND_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES
=
this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied
*
this.public_double_radians_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf
*
this.PUBLIC_DOUBLE_GIVEN_RADIUS_AS_FREQUENCY_TO_CHECK_SIZED_OF_DIFFERENT_NOTES_ON_TANGENT_OF_CIRCUMFERENCES_FOR_GIVEN_FREQUENCY___textBox_PRECALC_NOTES_LENGTHS_FITS_FOR_FREQ_AS_RADIUS
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////public double PUBLIC_DOUBLE___ESTIMATED_DRUMS_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE___ESTIMATED_STRING_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES = 0;
//////public double PUBLIC_DOUBLE___ESTIMATED_WIND_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES = 0;
this.PUBLIC_DOUBLE___ESTIMATED_DRUMS_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES
=
this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions
*
this.public_double_radians_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf
*
(440)
;
this.PUBLIC_DOUBLE___ESTIMATED_STRING_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES
=
this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions
*
this.public_double_radians_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf
*
(440)
;
this.PUBLIC_DOUBLE___ESTIMATED_WIND_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES
=
this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied
*
this.public_double_radians_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf
*
(440)
;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.label_ESTIMATED_LENGTHS_DRUMS_STRINGS_WINDS_AT_GIVEN_FREQUENCY.Text
=
"for_drums MAX length = "
+
this.PUBLIC_DOUBLE___ESTIMATED_DRUMS_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES
.ToString("F3")
+ " FOR STRINGS MAX LENGTH = "
+
this.PUBLIC_DOUBLE___ESTIMATED_STRING_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES
.ToString("F3")
+ " FOR WINDS MIN(ITS MIN) LENGTH = "
+ this.PUBLIC_DOUBLE___ESTIMATED_WIND_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_GIVEN_FREQUENCY_CIRCLE_CIRCUMFERENCES
.ToString("F3");
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
this.label_ESTIMATED_LENGTHS_DRUMS_STRINGS_WINDS_AT_440_FREQUENCY_REFERENCES.Text
=
"ref radius = freq = 440 drums_max_length = "
+
this.PUBLIC_DOUBLE___ESTIMATED_DRUMS_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES
.ToString("F3")
+ " strings_max_length= "
+
this.PUBLIC_DOUBLE___ESTIMATED_STRING_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES
.ToString("F3")
+ " WINDS MIN(ITS MIN) LENGTH = "
+ this.PUBLIC_DOUBLE___ESTIMATED_WIND_BEAT_NOTES_TANGENTIAL_CIRCUMFERENTIAL_MAXIMUM_LENGTH_ON_440_CIRCLE_CIRCUMFERENCES
.ToString("F3");
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
/// public double PUBLIC_DOUBLE___MIDITKS_TO_MILLISECOND_CONVERTER_FOR_THIS_CONTEXT = 1;
/// public double PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT = 1;
this.label_MILLISEC_PER_CENTIDEGREES.Text
=
"MILLISECONDS/CENTIDEGREES= " +
this.public_double_milliseconds_per_centi_degrees.ToString("F6")
+ " so millisec/ degrees = "
+
this.public_double_milliseconds_per_UNIT_SINGLE_degrees.ToString("F3")
+
" radians/millisecond= "
+
this.public_double_radians_per_UNIT_SINGLE_milliseconds___for_reverse_calculations_of_lengths_on_dxf.ToString("F6")
;
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
/// public double PUBLIC_DOUBLE___MIDITKS_TO_MILLISECOND_CONVERTER_FOR_THIS_CONTEXT___MILLISECONDS_PER_MIDITKS = 1;
/// public double PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS = 1;
///
////////////////public double PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions = 0;
////////////////public double PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions = 0;
////////////////public double PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied = 0;
this.PUBLIC_DOUBLE___t_Drums_max_MIDITKS_is_min_for_t_Strings_transitions = 0;
this.PUBLIC_DOUBLE___t_Strings_max_MIDITKS_is_t_winds_min_data_transitions = 0;
this.PUBLIC_DOUBLE___t_Winds_min_MIDITKS_is_same_as_t_Strings_max_data_supplied = 0;
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
this.PUBLIC_DOUBLE___t_Drums_max_MIDITKS_is_min_for_t_Strings_transitions
=
this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions
*
this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS;
this.PUBLIC_DOUBLE___t_Strings_max_MIDITKS_is_t_winds_min_data_transitions
=
this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions
*
this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS;
this.PUBLIC_DOUBLE___t_Winds_min_MIDITKS_is_same_as_t_Strings_max_data_supplied
=
this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied
*
this.PUBLIC_DOUBLE___MILLISECOND_TO_MIDITKS_CONVERTER_FOR_THIS_CONTEXT___MIDITKS_PER_MILLISECONDS;
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
this.label_THE_MIDITKS_DURATIONS_CONVERTED_FROM_MILLISECONDS_FROM_THE_DRUMS_MAX_STRINGS_MIN_TO_MAX_WINDS_MIN.Text
=
"for MAX_DRUMS(miditks) = "
+
this.PUBLIC_DOUBLE___t_Drums_max_MIDITKS_is_min_for_t_Strings_transitions
.ToString("F3")
+ " MIN_STRING(miditks) = "
+
this.PUBLIC_DOUBLE___t_Strings_max_MIDITKS_is_t_winds_min_data_transitions
.ToString("F3")
+ " STRINGS_MAX=WINDS MIN(ITS MIN)(miditks) = "
+ this.PUBLIC_DOUBLE___t_Winds_min_MIDITKS_is_same_as_t_Strings_max_data_supplied
.ToString("F3");
;
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
if (this.public_double_milliseconds_per_UNIT_SINGLE_degrees > this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions)
{
this.label_MILLISEC_PER_CENTIDEGREES.BackColor = Color.PaleVioletRed;
this.label_MILLISEC_PER_CENTIDEGREES.ForeColor = Color.White;
}
else if (
(this.public_double_milliseconds_per_UNIT_SINGLE_degrees > this.PUBLIC_DOUBLE___t_Drums_max_milliseconds_is_min_for_t_Strings_transitions)
&&
(this.public_double_milliseconds_per_UNIT_SINGLE_degrees < this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions)
)
{
this.label_MILLISEC_PER_CENTIDEGREES.BackColor = Color.MediumVioletRed;
this.label_MILLISEC_PER_CENTIDEGREES.ForeColor = Color.White;
}
else if (
(this.public_double_milliseconds_per_UNIT_SINGLE_degrees > this.PUBLIC_DOUBLE___t_Strings_max_milliseconds_is_t_winds_min_data_transitions)
&&
(this.public_double_milliseconds_per_UNIT_SINGLE_degrees < this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied)
)
{
this.label_MILLISEC_PER_CENTIDEGREES.BackColor = Color.IndianRed;
this.label_MILLISEC_PER_CENTIDEGREES.ForeColor = Color.White;
}
else if (
(this.public_double_milliseconds_per_UNIT_SINGLE_degrees > this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied)
&&
(this.public_double_milliseconds_per_UNIT_SINGLE_degrees < this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied*1.6)
)
{
this.label_MILLISEC_PER_CENTIDEGREES.BackColor = Color.OrangeRed;
this.label_MILLISEC_PER_CENTIDEGREES.ForeColor = Color.White;
}
else if (
(this.public_double_milliseconds_per_UNIT_SINGLE_degrees > this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied*1.6)
&&
(this.public_double_milliseconds_per_UNIT_SINGLE_degrees < this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied * 2.2)
)
{
this.label_MILLISEC_PER_CENTIDEGREES.BackColor = Color.Red;
this.label_MILLISEC_PER_CENTIDEGREES.ForeColor = Color.White;
}
else if (
(this.public_double_milliseconds_per_UNIT_SINGLE_degrees > this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied * 2.2)
&&
(this.public_double_milliseconds_per_UNIT_SINGLE_degrees < this.PUBLIC_DOUBLE___t_Winds_min_milliseconds_is_same_as_t_Strings_max_data_supplied * 6.1)
)
{
this.label_MILLISEC_PER_CENTIDEGREES.BackColor = Color.DarkRed;
this.label_MILLISEC_PER_CENTIDEGREES.ForeColor = Color.White;
}
else
{
this.label_MILLISEC_PER_CENTIDEGREES.BackColor = Color.LightBlue;
this.label_MILLISEC_PER_CENTIDEGREES.ForeColor = Color.Black;
}// if(this.public_double_milliseconds_per_UNIT_SINGLE_degrees>100)
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
///////////////////////////////////////////////////////// TOO IMPORTANT CALCULATIONS FOR SPACE PLANNING AROUND THE CIRCUMFERENCES OF DIFFERENT RADIUS ////////
if
(
this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG___TO___PLAN___FROM___TEXTBOX_DATA_TO_ACHIEVES
!=
PUBLIC_DOUBLE___TO_REITERATE_TO_FIND___FOR_textBox___TOTAL_NOTES_TO_PLAN_ITERATES
)
{
goto goto_here_if___mismatch___this___PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG___TO___PLAN___FROM___TEXTBOX_DATA_TO_ACHIEVES;
}
//////if
////// (
////// this.PUBLIC_DOUBLE___TOTAL_NOTES_IN_THE_SONG___TO___PLAN___FROM___TEXTBOX_DATA_TO_ACHIEVES
////// <
////// PUBLIC_DOUBLE___TO_REITERATE_TO_FIND___FOR_textBox___TOTAL_NOTES_TO_PLAN_ITERATES
////// )
//////this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Drums_NOTES_COUNTS = 0;
//////this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Strings_NOTES_COUNTS = 0;
//////this.PUBLIC_DOUBLE___COUNT_ESTIMATED_Winds_NOTES_COUNTS = 0;
}
catch (Exception excp___next_level_calculations)
{
}//catch(Exception excp___next_level_calculations)
////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
/// ////////////////////////////// CATCH COMPLETES HERE TO FILL DEFAULT VALUES ////////////////
return;
}// public void RECALCULATE_THE_MIDI_DATA_MICROSECONDS_NOTES_ETC()
namespace SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
{
public static class PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
{
public static string PUBLIC_STATIC_STRING_TO_REPORT_PLAY_STATUS_LOGS = "";
public static List<PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS> PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
= new List<PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS>();
public static void public_static_void_prepare_notes_sequences_for_prelistening_populate_to_rows()
{
if(PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS!=null)
{
PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
.Clear();
}
else
{
PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
=
new List<PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS>();
PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
.Clear();
}//end of else of if(PUBLIC_STATIC_LIST___OF___PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS!=null)
}//public static void public_static_void_prepare_notes_sequences_for_prelistening_populate_to_rows()
}//public static class PUBLIC_STATIC_CLASS_TO_PRELISTEN_HANDLING
public class PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
{
public double PUBLIC_DOUBLE_CURRENT_NOTE_NUMBER = 0;
public double PUBLIC_DOUBLE_CURRENT_EVENT_COUNTER = 0;
public int INT_SERIAL_NUMBER_OF_NOTE = 0;
public int INT_NOTE_NUMBER_TO_PLAY_0_TO_127 = 0;
public double DOUBLE_MILLISECOND_DURATION_FOR_THE_NOTE_TO_PLAY = 0;
public int INT_CURRENT_NOTES_VELOCITY_0_TO_127 = 127;
public int INT_CURRENT_NOTES_PATCH_0_TO_127 = 127;
public string STRING_COMMA_SEPERATED_WITHIN_NOTES_PITCH_BENDS_PERCENTAGES_DURATIONS = "";
public string STRING_COMMA_SEPERATED_WITHIN_NOTES_PITCH_BENDS_VALUES = "";
public long LONG_START_ABSOLUTE_TIME_FOR_CURRENT_NOTE = 0;
public long LONG_TICKS_DURATIONS_FOR_CURRENT_NOTE = 0;
public List<double> PUBLIC_LIST_OF_DOUBLE_PERCENTAGES_WITHIN_NOTE_PITCH_BEND_POSITIONS = new List<double>();
public List<int> PUBLIC_LIST_OF_INT_0_TO_8192_16368_PRECALIBRATED_POPULATED_AS_PER_NOTES_CONDITIONS = new List<int>();
public List<long> PUBLIC_LIST_OF_REAL_OF_LONG_ABSOLUTE_START_POINT_OF_THE_EVENT_FOR_CURRENT_PITCH_BEND_IN_WHOLE_SEQUENCE = new List<long>();
public PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS()
{
this.PUBLIC_DOUBLE_CURRENT_NOTE_NUMBER = 0;
this.PUBLIC_DOUBLE_CURRENT_EVENT_COUNTER = 0;
this.INT_SERIAL_NUMBER_OF_NOTE = 0;
this.INT_NOTE_NUMBER_TO_PLAY_0_TO_127 = 0;
this.DOUBLE_MILLISECOND_DURATION_FOR_THE_NOTE_TO_PLAY = 680;
this.INT_CURRENT_NOTES_VELOCITY_0_TO_127 = 127;
this.INT_CURRENT_NOTES_PATCH_0_TO_127 = 127;
string STRING_COMMA_SEPERATED_WITHIN_NOTES_PITCH_BENDS_PERCENTAGES_DURATIONS = "0,100";
string STRING_COMMA_SEPERATED_WITHIN_NOTES_PITCH_BENDS_VALUES = "8192,16368";
this.LONG_START_ABSOLUTE_TIME_FOR_CURRENT_NOTE = 0;
this.LONG_TICKS_DURATIONS_FOR_CURRENT_NOTE = 0;
this.PUBLIC_LIST_OF_DOUBLE_PERCENTAGES_WITHIN_NOTE_PITCH_BEND_POSITIONS = new List<double>();
this.PUBLIC_LIST_OF_DOUBLE_PERCENTAGES_WITHIN_NOTE_PITCH_BEND_POSITIONS.Clear();
this.PUBLIC_LIST_OF_INT_0_TO_8192_16368_PRECALIBRATED_POPULATED_AS_PER_NOTES_CONDITIONS = new List<int>();
this.PUBLIC_LIST_OF_INT_0_TO_8192_16368_PRECALIBRATED_POPULATED_AS_PER_NOTES_CONDITIONS.Clear();
this.PUBLIC_LIST_OF_REAL_OF_LONG_ABSOLUTE_START_POINT_OF_THE_EVENT_FOR_CURRENT_PITCH_BEND_IN_WHOLE_SEQUENCE = new List<long>();
this.PUBLIC_LIST_OF_REAL_OF_LONG_ABSOLUTE_START_POINT_OF_THE_EVENT_FOR_CURRENT_PITCH_BEND_IN_WHOLE_SEQUENCE.Clear();
}// public PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS()
public static void UPDATE_CURRENT_NOTE_WITH_CURRENT_STARTING_ABSOLUTE_TIME_LONG(long START_ABSOLUTE_TIME)
{
}//public static void UPDATE_CURRENT_NOTE_WITH_CURRENT_STARTING_ABSOLUTE_TIME_LONG(long START_ABSOLUTE_TIME)
}// public class PUBLIC_CLASS_TO_LOAD_FOR_PRELISTENS_SINGLE_ROWS_NOTE_DATA_DETAILS
}//namespace SAANS_ROUGH_BEATS_COMPOSER_FOR_ON_SELECTIONS_LOOP_CYCLES
No comments:
Post a Comment