Jump to content

Antichambre

Programmer
  • Posts

    1,291
  • Joined

  • Last visited

  • Days Won

    101

Everything posted by Antichambre

  1. 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! Bruno
  2. 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:
  3. 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:
  4. Ca vaut bien un petit coup de Nudelholz!
  5. 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...
  6. It may be better to prepare a log and antilog table then just use multiply, instead of heavy math processing. Best Bruno
  7. Hello, I'm interested in the software, I've got a Yocto 1, the bad point with this machine is the low quality pots and the ATmega firmware. I resolve the pot problem by replacing it by 808 original set, was not easy not the same size at all! But I founda way ;) Now it remains me to put a good sequencer inside, a MB one ;) Best
  8. According to your diagram, it seems you connect SO to FS, SC to DIN and RC to SCLK it's totally wrong. Must be: SO to DIN RC to FS SC to SCLK Best Bruno
  9. What is the exact message on screen? This message comes from NOTIFY_MIDI_TimeOut Function which notifies an error of Sysex or BLM (uncomplete). Is there any MIDI In connected? Check if one of your external equipment don't send any Sysex, check your configuration Port for the BLM in your SEQ. Best
  10. interresting ;) for your Y axis: //////// show WAVE-FORM - S C O P E //////// MUTEX_LCD_TAKE; MIOS32_LCD_DeviceSet(14); APP_LCD_GCursorSet(H,(63-V)); // (h, v) set insert Position for Bitmap APP_LCD_Data(0x80 >> ((63-V) % 8)); MUTEX_LCD_GIVE; Where 0 <= V < 64
  11. Hello, Yes, refer to trunk/modules/app_lcd/ssd1306/app_lcd.c you don't need the command, sorry I shared a part of the universal module code. I don't understand the result you want to achieve(graphically) can you explain? Like peter said, it's better to manipulate a full frame instead of singles bit, this will avoid to get wrong remaining pixels. Best
  12. Hello, Check ssd1306 datasheet, you can write only one segment at a time, you can not write a single pixel. A segment is a 8 vertical pixel. Use: APP_LCD_Cmd(0x5c); // Write RAM APP_LCD_Data(abyte); Shift the pixel in the byte using >> or << e.g. abyte = 1 << ( V % 8 ); Something like that ;) best Bruno
  13. Latigid push you in the right way, a SRIO bécomes crazy when an input of a 165 is not connected(floating). They have to be all connected to a level even if They are not used, it is what thé résistor network do...
  14. Hello, this diagram is to connect an fx in jack directly to the uart tx/rx of a Core, i did not test it from and to Midi connectors. There’s optocoupling between rx and midi connector. I have to make some test, unfortunately i left home this morning, i can answer to your question but you will have to wait 2 weeks before that. is it fine for you? best bruno
  15. My eurorack may have the little sequencer it deserves!!! Best Bruno
  16. Hello, A = B = fits exactly the ucapps core board footprint. C = D = don't fit exactly the ucapps core board footprint. => for C and D we need to use wire or to bend a part of the header. Sorry if I wasn't clear before. For all cases bootloader is the same method, except that you will maybe need to advise Memory address at burn, depending on version of your LPCXpresso ide, see http://midibox.org/forums/topic/20590-lpcxpresso-ide/ Best Bruno
  17. https://www.lextronic.fr/lpcxpresso/14902-module-lpc1769-lpcxpresso-board.html I don't order board from them since a moment... If you want to be sure just ask them the revision of the board before order, rev A or B fits the core without modification. Best Bruno
  18. Hi, @vodrha You're right you can use an input pin as timer capture input, depending on timer frequency you will get a a good accuracy but this not the easiest way... Why not using SR_Service_Prepare(void) which is called every millisecond, check your input pin value, reset and start counting on first falling edge, stop and store counter value on second falling edge, you will get the duration per quarter note "D" in ms. Then calculate your tempo T= 60000/D an finaly set your tempo using MCLOCK_BPMSet(T); Best regards Bruno
  19. Maybe because I didn't reply oups! @u-link In one hand MIDI is already implemented on both side but the MIDI commands are limited, on the other hand the SPI interface is fully implemented on Tsunami side, but you will need to write a small module software driver for MIOS32. Write a dedicated module is not very complicated, and it can benefit everyone. Tell me if you do not know how to tackle it... Best Bruno
  20. Hello, I like those encoder caps, seems there's no needle, where did you find it? Best Bruno
  21. Bienvenue à toi, le toulousain, t'as fait le bon choix ;) I will follow your project too! For you to know that if your order amount is more than 70€, shipping is free at Mouser, then it's some time better to wait and group your order. Best regards Bruno de Dax ;)
  22. Ahah, finally it was quick! Better to open a dedicated new topic. Add some explanation of what you did, mostly the available ports. Just to know what changes are made. If the MIOS32 can be used as it is. Just an idea... if it is not too far from what you need to do, if you have to reduce the ports of the MIOS32 better they correspond to those that exist on a Core MIOS8;) Best regards Bruno
×
×
  • Create New...