@ -139,7 +139,7 @@ uint8_t orig_attack_values[2][7];
uint8_t orig_release_values [ 2 ] [ 7 ] ;
int temp_int ;
bool menu_select_toggle ;
float32_ t temp_float ;
floa t temp_float ;
# ifdef I2C_DISPLAY
@ -266,6 +266,8 @@ void UI_func_sequencer(uint8_t param);
void UI_func_seq_live_transpose_oct ( uint8_t param ) ;
void UI_func_seq_lenght ( uint8_t param ) ;
void UI_func_seq_pat_chain ( uint8_t param ) ;
void UI_func_seq_pattern_load ( uint8_t param ) ;
void UI_func_seq_pattern_save ( uint8_t param ) ;
void UI_func_volume ( uint8_t param ) ;
void UI_func_load_performance ( uint8_t param ) ;
void UI_func_save_performance ( uint8_t param ) ;
@ -3701,7 +3703,7 @@ void UI_func_drum_volume(uint8_t param)
lcd . setCursor ( 1 , 1 ) ;
sprintf ( displayname , " %02d " , activesample ) ;
lcd . print ( displayname ) ;
lcd . show ( 1 , 4 , 6 , basename ( drum_config [ activesample ] . filename ) ) ;
lcd . show ( 1 , 4 , 7 , basename ( drum_config [ activesample ] . filename ) ) ;
sprintf ( displayname , " %03d " , ( int ) ( drum_config [ activesample ] . vol_max * 100 ) ) ;
lcd . setCursor ( 12 , 1 ) ;
lcd . print ( displayname ) ;
@ -3769,10 +3771,6 @@ void UI_func_drum_pan(uint8_t param)
menu_select_toggle = false ;
} else
{ menu_select_toggle = true ;
// if (drum_config[activesample].pan>0.00)
//temp_int=drum_config[activesample].pan*100;
//else
//temp_int=drum_config[activesample].pan*-100;
}
}
@ -3789,9 +3787,6 @@ void UI_func_drum_pan(uint8_t param)
sprintf ( displayname , " %02d " , activesample ) ;
lcd . print ( displayname ) ;
lcd . show ( 1 , 4 , 6 , basename ( drum_config [ activesample ] . filename ) ) ;
sprintf ( displayname , " %+f " , drum_config [ activesample ] . pan ) ;
lcd . setCursor ( 12 , 1 ) ;
lcd . print ( displayname ) ;
} else {
lcd . setCursor ( 0 , 1 ) ;
lcd . print ( " " ) ;
@ -3801,11 +3796,23 @@ void UI_func_drum_pan(uint8_t param)
lcd . print ( " [ " ) ;
lcd . setCursor ( 15 , 1 ) ;
lcd . print ( " ] " ) ;
sprintf ( displayname , " %+03d " , temp_int ) ;
lcd . setCursor ( 12 , 1 ) ;
lcd . print ( displayname ) ;
drum_config [ activesample ] . pan = mapfloat ( temp_int , - 99 , 99 , - 1.0 , 1.0 ) ;
drum_config [ activesample ] . pan = mapfloat ( temp_int , - 99 , 99 , - 1.0 , 1.0 ) ;
}
temp_int = mapfloat ( drum_config [ activesample ] . pan , - 1.0 , 1.0 , - 99 , 99 ) ;
lcd . setCursor ( 12 , 1 ) ;
if ( temp_int > 1 ) {
lcd . print ( " R " ) ;
} else if ( temp_int < 0 ) {
lcd . print ( " L " ) ;
}
else {
lcd . print ( " C " ) ;
}
sprintf ( displayname , " %02d " , temp_int ) ;
lcd . setCursor ( 13 , 1 ) ;
lcd . print ( displayname ) ;
}
if ( LCDML . FUNC_close ( ) ) // ****** STABLE END *********
{
@ -4336,6 +4343,175 @@ void UI_func_seq_pat_chain(uint8_t param)
}
}
void UI_func_seq_pattern_load ( uint8_t param )
{
static uint8_t mode ;
if ( LCDML . FUNC_setup ( ) ) // ****** SETUP *********
{
char tmp [ 10 ] ;
temp_int = param ;
mode = 0 ;
encoderDir [ ENC_R ] . reset ( ) ;
lcd . setCursor ( 0 , 0 ) ;
lcd . print ( F ( " Load Patterns " ) ) ;
lcd . setCursor ( 0 , 1 ) ;
sprintf ( tmp , " [%2d] " , param ) ;
lcd . print ( tmp ) ;
}
if ( LCDML . FUNC_loop ( ) ) // ****** LOOP *********
{
if ( ( LCDML . BT_checkDown ( ) & & encoderDir [ ENC_R ] . Down ( ) ) | | ( LCDML . BT_checkUp ( ) & & encoderDir [ ENC_R ] . Up ( ) ) | | ( LCDML . BT_checkEnter ( ) & & encoderDir [ ENC_R ] . ButtonShort ( ) ) )
{
if ( LCDML . BT_checkDown ( ) )
{
temp_int = constrain ( temp_int + ENCODER [ ENC_L ] . speed ( ) , 0 , 99 ) ;
}
else if ( LCDML . BT_checkUp ( ) )
{
temp_int = constrain ( temp_int - ENCODER [ ENC_L ] . speed ( ) , 0 , 99 ) ;
}
else if ( LCDML . BT_checkEnter ( ) )
{
mode = 0xff ;
lcd . setCursor ( 0 , 1 ) ;
if ( load_sd_seq_json ( temp_int ) = = false )
lcd . print ( " Does not exist. " ) ;
else
{
load_sd_seq_json ( temp_int ) ;
lcd . print ( " Done. " ) ;
}
delay ( MESSAGE_WAIT_TIME ) ;
LCDML . FUNC_goBackToMenu ( ) ;
}
lcd . setCursor ( 0 , 1 ) ;
char tmp [ 10 ] ;
sprintf ( tmp , " [%2d] " , temp_int ) ;
lcd . print ( tmp ) ;
}
}
if ( LCDML . FUNC_close ( ) ) // ****** STABLE END *********
{
if ( mode < 0xff )
{
lcd . show ( 1 , 0 , 16 , " Canceled. " ) ;
delay ( MESSAGE_WAIT_TIME ) ;
}
else
encoderDir [ ENC_R ] . reset ( ) ;
}
}
void UI_func_seq_pattern_save ( uint8_t param )
{
static bool overwrite ;
static bool yesno ;
static uint8_t mode ;
if ( LCDML . FUNC_setup ( ) ) // ****** SETUP *********
{
char tmp [ FILENAME_LEN ] ;
yesno = false ;
mode = 0 ;
encoderDir [ ENC_R ] . reset ( ) ;
lcd . setCursor ( 0 , 0 ) ;
lcd . print ( F ( " Save Patterns to: " ) ) ;
lcd . setCursor ( 0 , 1 ) ;
sprintf ( tmp , " [%2d] " , temp_int ) ;
lcd . print ( tmp ) ;
sprintf ( tmp , " /%s/%s%d.json " , SEQ_CONFIG_PATH , SEQ_CONFIG_NAME , temp_int ) ;
if ( SD . exists ( tmp ) )
overwrite = true ;
else
overwrite = false ;
}
if ( LCDML . FUNC_loop ( ) ) // ****** LOOP *********
{
if ( ( LCDML . BT_checkDown ( ) & & encoderDir [ ENC_R ] . Down ( ) ) | | ( LCDML . BT_checkUp ( ) & & encoderDir [ ENC_R ] . Up ( ) ) | | ( LCDML . BT_checkEnter ( ) & & encoderDir [ ENC_R ] . ButtonShort ( ) ) )
{
if ( LCDML . BT_checkDown ( ) )
{
if ( mode = = 0 )
temp_int = constrain ( temp_int + ENCODER [ ENC_L ] . speed ( ) , 0 , 99 ) ;
else
yesno = true ;
}
else if ( LCDML . BT_checkUp ( ) )
{
if ( mode = = 0 )
temp_int = constrain ( temp_int - ENCODER [ ENC_L ] . speed ( ) , 0 , 99 ) ;
else
yesno = false ;
}
else if ( LCDML . BT_checkEnter ( ) )
{
if ( mode = = 0 & & overwrite = = true )
{
mode = 1 ;
lcd . setCursor ( 0 , 1 ) ;
lcd . print ( F ( " Overwrite: [ ] " ) ) ;
}
else
{
mode = 0xff ;
if ( overwrite = = false | | yesno = = true )
{
if ( yesno = = true )
{
char tmp [ FILENAME_LEN ] ;
sprintf ( tmp , " /%s/%s%d.json " , SEQ_CONFIG_PATH , SEQ_CONFIG_NAME , temp_int ) ;
SD . remove ( tmp ) ;
}
save_sd_seq_json ( temp_int ) ;
lcd . show ( 1 , 0 , 16 , " Done. " ) ;
delay ( MESSAGE_WAIT_TIME ) ;
LCDML . FUNC_goBackToMenu ( ) ;
}
else if ( overwrite = = true & & yesno = = false )
{
char tmp [ 10 ] ;
mode = 0 ;
lcd . setCursor ( 0 , 1 ) ;
sprintf ( tmp , " [%2d] " , temp_int ) ;
lcd . print ( tmp ) ;
}
}
}
if ( mode = = 0 )
{
char tmp [ FILENAME_LEN ] ;
sprintf ( tmp , " /%s/%s%d.json " , SEQ_CONFIG_PATH , SEQ_CONFIG_NAME , temp_int ) ;
if ( SD . exists ( tmp ) )
overwrite = true ;
else
overwrite = false ;
lcd . setCursor ( 0 , 1 ) ;
sprintf ( tmp , " [%2d] " , temp_int ) ;
lcd . print ( tmp ) ;
}
else
{
lcd . setCursor ( 12 , 1 ) ;
if ( yesno = = true )
lcd . print ( F ( " YES " ) ) ;
else
lcd . print ( F ( " NO " ) ) ;
}
}
encoderDir [ ENC_R ] . reset ( ) ;
}
if ( LCDML . FUNC_close ( ) ) // ****** STABLE END *********
{
if ( mode < 0xff )
{
lcd . show ( 1 , 0 , 16 , " Canceled. " ) ;
delay ( MESSAGE_WAIT_TIME ) ;
}
encoderDir [ ENC_R ] . reset ( ) ;
}
}
void UI_func_information ( uint8_t param )
{
if ( LCDML . FUNC_setup ( ) ) // ****** SETUP *********