Jump to content

Core32 Reading sysex file from SD and send it via midi


Phatline
 Share

Recommended Posts

hi

my idea is:

put a *.syx on the SD-Card

put the SD-Card in a STM34F4 core

var a. Core recognizes a *.syx and send it out on Port 32 (Midi A)

var b. I activate something in the program (with a Dip switch for example) and now it loads up

 

for what:

in use with generic Midicontrollers (BCR2000) to transfair a CC-Layout that is fitting to the Midibox programm

 

for which project:

http://wiki.midibox.org/doku.php?id=msq-cc-bcr

 

what i have up to now...

char filepathL[8];				//Number of Pathsymbols tm/bcr.sys >>> 8 max! 

      MUTEX_SDCARD_TAKE;  statusDir = FILE_DirExists("syx"); MUTEX_SDCARD_GIVE;
      if(statusDir != 1) {MUTEX_LCD_TAKE; 
                          MIOS32_LCD_DeviceSet(0); MIOS32_LCD_Clear(); MIOS32_LCD_PrintFormattedString	("%s %d", "no bcr.syx", statusDir);              
                          MUTEX_LCD_GIVE;}
      if(statusDir == 1) {
		   sprintf(filepathL, "tm/bcr.syx");
        
           FILE_ReadOpen	(&midifile_fi, filepathL);
        
        //normally i then start by reading the content and transfair it into variables..... but happens if i have Sysexfile instead? how to tunnel this to midiport?
        
           FILE_ReadBuffer((u8  *)file_typeBank,  4);  //"MQ01" = 4 Positons
           FILE_ReadBuffer((u8  *)CC_SEQ,        32);  //Container for static not touchable Variables      
           FILE_ReadBuffer((u8  *)CC_Morph,     128);  //Container for morphable Variables  
           FILE_ReadBuffer((u8  *)Velo_Morph,   256);  //Here we have 8x32=256, 
           FILE_ReadBuffer((u8  *)CC_Store,     256);  //Here we have 8x32=256, 
           FILE_ReadBuffer((u8  *)MSQ_Store,  65536);  //Motion-Sequence-Data 8x32*256=65536  

           FILE_ReadClose	(&midifile_fi);
       MUTEX_SDCARD_GIVE

 

 

 

Link to comment
Share on other sites

it was really simple:

insert in a the function which is scanned every 2 seconds, which checks the SD Card:

MUTEX_SDCARD_TAKE;   //SD-Card is now only for the following LINES reserved:
    statusSD = FILE_CheckSDCard();
MUTEX_SDCARD_GIVE;

    if (statusSD == 1) {// YES CARD! 
	MUTEX_SDCARD_TAKE;
    	FILE_SendSyxDump( "/bcr1.syx", 32, 45); //Send(filepath, midiport, paket rate)
	MUTEX_SDCARD_GIVE; 
}

or more readable without MUTEXes:

statusSD = FILE_CheckSDCard(); //check if card is connected

if (statusSD == 1) {  //YES CARD is connecdte! 
    	FILE_SendSyxDump( "/bcr1.syx", 32, 45);} //Send(filepath, midiport, paket rate)

 

Edited by Phatline
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...