Core32 Reading sysex file from SD and send it via midi

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

 

 

 

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)

 

1 Like