Leaderboard
Popular Content
Showing content with the highest reputation on 05/01/2018 in all areas
-
did you try this option in BPM menu Ext.Restart: sends a MIDI clock start event to all MIDI devices at the next measure - a very useful feature to re-synchronize external MIDI gear to the MIDIbox. To evaluate this function, try following steps: connect a MIDI sequencer (or synth. with sequencer function) to your MBSEQ and configure it for MIDI slave mode. ensure that MIDI clock is enabled for all OUT ports which should send the MIDI start event (+ a MIDI clock) press PLAY button of MBSEQ - the external sequencer should start to play as well. now stop the external sequencer (change a patch, sound, or whatever...) press Ext.Restart: the external sequencer should start once MBSEQ reaches the first step. Note that the same function can be accessed by pressing MENU+METRONOME. A dedicated button can be assigned to this function as well (requires a modification in MBSEQ_HW.V4 bests Kazik2 points
-
Ahah. Mine is a true log/antilog, this is math! see the function applied to a triangle LFO with variable speed and amplitude1 point
-
Adding curve response Log and Antilog: first point after adding Math lib, it seems the loading sequence of libraries is wrong. the `__errno' compilation error. To resolve it we have to set the loading sequence, just change this line in your Makefile: LIBS= to LIBS = -lm -lgcc -lc works for me ;) Now the curve: in declaration add the curve variable, I use MIOS Studio to control it u8 curve = 64; in MIDI_Notify CC#1 is curve parameter ///////////////////////////////////////////////////////////////////////////// // This hook is called when a MIDI package has been received ///////////////////////////////////////////////////////////////////////////// void APP_MIDI_NotifyPackage(mios32_midi_port_t port, mios32_midi_package_t midi_package) { // store incoming ModWheel values to curve if( midi_package.type == CC && midi_package.cc_number == 1 ) curve = (u8)midi_package.value; } Ok now we will change the function to: ///////////////////////////////////////////////////////////////////////////// // This hook is called before the shift register chain is scanned ///////////////////////////////////////////////////////////////////////////// void APP_SRIO_ServicePrepare(void) { column +=128; //column increment(x axis) if( column > 0xffff){ // 65535 max column = 0; // this will clear/reset the bitmap ! memset(bitmap_array, 0, sizeof bitmap_array); } // log/antilog function if(curve<64){ // reducing curve to a float between 0 and 1 float curv_f=(float)(64-curve)/64.0; // reducing column to a float between 0 and 1 float column_f = (1.0-((float)(column/65536.0))); // line value is line = (u32)(column + ((log(column_f)*curv_f*column_f)*65536)); }else{ // reducing curve to a float between 0 and 1 float curv_f=(float)(curve-64)/64.0; // reducing column to a float between 0 and 1 float column_f = (float)(column/65536.0); // line value is line = (u32)(column - ((log(column_f)*curv_f*column_f)*65536)); } u8 x= (u8)(column>>9); //reducing 16 bit to 128pixels(7bits) u8 y= (u8)(line>>11); //reducing 16 bit to 64pixels(6bits) // set the pixel MIOS32_LCD_BitmapPixelSet(bitmap, x, 63-y, 1); // 63-y is to invert the y axis } result: Voilà! I hope it will help you ;) have a good sunday! Bruno1 point
-
For a partial bitmap(not full screen) e.g. 32x32 centered change declare // You need 32*32 pixel, for SSD1306 a pixel is one bit // we will declare an u8 array, size is 32*32/8 = 128 //static u8 bitmap_array[128]; //I don't know why this not work static u8 bitmap_array[1024]; //this is fine init: // initialize bitmap width=32, height=32, offset=128(!) and depth=1 bit bitmap = MIOS32_LCD_BitmapInit(bitmap_array,32,32,128,1); calc: u8 x= (u8)(column>>11); //reducing 16 bit to 32pixels(5bits) u8 y= (u8)(line>>11); //reducing 16 bit to 32pixels(5bits) // set the pixel MIOS32_LCD_BitmapPixelSet(bitmap, x, 31-y, 1); // 31-y is to invert the y axis positionning: MIOS32_LCD_GCursorSet(48, 16); MIOS32_LCD_BitmapPrint(bitmap); result:1 point
-
Good morning, First thing: the bitmap manipulation Declaration: ///////////////////////////////////////////////////////////////////////////// // Local variables ///////////////////////////////////////////////////////////////////////////// // You need 128*64 pixel, for SSD1306 a pixel is one bit // we will declare an u8 array, size is 128*64/8 = 1024 static u8 bitmap_array[1024]; // the bitmap mios32_lcd_bitmap_t bitmap; // some other variables for the example u32 line, column; const float a=1.0; Init: ///////////////////////////////////////////////////////////////////////////// // This hook is called after startup to initialize the application ///////////////////////////////////////////////////////////////////////////// void APP_Init(void) { MIOS32_BOARD_LED_Init(0xffffffff); // initialize all LEDs // initialize bitmap width=128, height=64, offset=128(!) and depth=1 bit bitmap = MIOS32_LCD_BitmapInit(bitmap_array,128,64,128,1); ... } Linear function exemple: I used the SRIO_ServicePrepare as 1ms timer ///////////////////////////////////////////////////////////////////////////// // This hook is called before the shift register chain is scanned ///////////////////////////////////////////////////////////////////////////// void APP_SRIO_ServicePrepare(void) { column +=128; //column increment(x axis) if( column > 0xffff){ // 65535 max column = 0; // this will clear/reset the bitmap ! memset(bitmap_array, 0, sizeof bitmap_array); } // this is just a linear function y=ax line = (u32)(a*column); u8 x= (u8)(column>>9); //reducing 16 bit to 128pixels(7bits) u8 y= (u8)(line>>10); //reducing 16 bit to 64pixels(6bits) // set the pixel MIOS32_LCD_BitmapPixelSet(bitmap, x, 63-y, 1); // 63-y is to invert the y axis } now we send it: ///////////////////////////////////////////////////////////////////////////// // This task is running endless in background ///////////////////////////////////////////////////////////////////////////// void APP_Background(void) { column = 0; line = 0; // clear LCD MIOS32_LCD_Clear(); // endless loop while( 1 ) { int i; MIOS32_LCD_GCursorSet(0, 0); MIOS32_LCD_BitmapPrint(bitmap); // done! } } result:1 point
-
I did the same thing in MIOS32, applied to a 16bit linear function y=x: Is this what you want? Will explain tomorrow... have to get some sleep...1 point