change to autocorrelate
This commit is contained in:
@@ -23,26 +23,24 @@ int piano_window_class::draw_trace(piano_data_struct *input_piano_data)
|
||||
|
||||
my_piano_data = input_piano_data;
|
||||
|
||||
// point to piano_key_texture
|
||||
if (my_piano_data->keyboard_key == 0)
|
||||
// Light the detected key and octive; blank when no note was detected.
|
||||
// keyboard_key is 0 - 11 and octive is 0 based (0 = octave 1)
|
||||
texture_current_piano_light = texture_key_blank;
|
||||
texture_current_octive_light = texture_octive_blank;
|
||||
if (my_piano_data->valid)
|
||||
{
|
||||
texture_current_piano_light = texture_key_blank;
|
||||
if ((my_piano_data->keyboard_key >= 0) &&
|
||||
(my_piano_data->keyboard_key < NUMBER_KEY_LIGHTS))
|
||||
{
|
||||
texture_current_piano_light = texture_keys[my_piano_data->keyboard_key];
|
||||
}
|
||||
if ((my_piano_data->octive >= 0) &&
|
||||
(my_piano_data->octive < NUMBER_OCTIVE_LIGHTS))
|
||||
{
|
||||
texture_current_octive_light = texture_octives[my_piano_data->octive];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
texture_current_piano_light = texture_keys[my_piano_data->keyboard_key - 1];
|
||||
}
|
||||
|
||||
// point to octive_texture
|
||||
if (my_piano_data->octive == 0)
|
||||
{
|
||||
texture_current_octive_light = texture_octive_blank;
|
||||
}
|
||||
else
|
||||
{
|
||||
texture_current_octive_light = texture_octives[my_piano_data->octive - 1];
|
||||
}
|
||||
|
||||
|
||||
// Put on screen
|
||||
SDL_RenderCopy(renderer_for_piano, texture_current_piano_light, NULL, &rect_for_keys);
|
||||
SDL_RenderCopy(renderer_for_piano, texture_current_octive_light, NULL, &rect_for_octives);
|
||||
|
||||
Reference in New Issue
Block a user