Jump to content

Phatline

Members
  • Posts

    1,278
  • Joined

  • Last visited

  • Days Won

    71

Posts posted by Phatline

  1. i e.g. use a electribe rythm as master, and ableton live 9 as slave... where ableton sending midiloops to my hardwaresynths and do the audio mixing from this synths (live daw). for me it works great, because i use a RME-MultifaceII that is connectet via PCIe to the motherboard...i use the RME-Midiport instead of USB... the good drivers make also a part... then massive optimized windows 7 settings, and then the know how to setup the latency kompensation from ableton, and the use of "external-instrument" instead of "monitor-in"... for your synths.

  2. thx...by the next order i have some MCP6002!.....

     

    whats about the unused Side of the TL72?

     

    in the 606 i dont need -15V in there... but i thought of a MS20 filter on the master times bevore ,...and then i would need it again.... but no 7915 @ home... arghlxwahh  ...

  3. what type of rail to rail op amp - is common? (so i can easy buy it by going to conrad, or to the local radio shop?)

     

     

    i think it will end by building a bipolar supply, since it turned out that op amps are a own sience...

  4. http://ucapps.de/mbhp/mbhp_aout_lc.pdf >> This Circuit is made for a Bipolar-PowerSupply

    but how looks a unipolar powered Version?

     

    the comes out that a simple bc337 can do the job (idea from the core backlight shematic ;-)  )

    see this:

     
    one problem that i have to solve is the logaritmic... a linear scale with all the same 10k resistors in a network, dont sound very accourate... 

     

    How to handle the unused side of the OP-AMP?

    Whats about the Offset-section? > No -15V there... so clamp to ground?

    Is there something else to change.

     

    how to make a logaritmic variant?

     

    i have built the circuit above on vectorboard, and it act a bit strange when switching between DOUT-Pin 0 and 1 -pin 0 make louder sound then 1 >>> Pin 2-7 acting normal (Volume gets higher)
     
    0>1 (wrong)
    1<2 (right)
    2<3 (right)
    3<4 (right)
    4<5 (right)
    ...
     

     

  5.  

    does anybody know more about this, the forum search give me absulutly nothing about this....

    he built all of this without asking a single question to his quest... well then he is a master.... or maybe the forum lost data (alexandria...)

     

    why i ask.

    yes my 606 is dead, precisely my midi-retrofit is broken... but like most all other 606 links also my retrofit supllyers website from when vienna is dead. (Called MIDI606), it was fully velocity sensitive.

     

    where the individual trigger should come i know... where to connect the accent also... also i know that the individual triggers are 1ms pulse time.... since the accent is also a sequencer track on the same type of output i guess it is also 1ms time...

    but i must guess, because the orginal CPU of the device is not into the machine anymore.... i cant measure.

     

    ---I also think i found the accent-amount- the retrofit removes the bridge left to D8 and wire it to some pins to the retrofit-PIC (i think it was a pic... the data is filed away....) may he used some onboard DAC (on a 40pin PIC?)

     

     

     

    anyway, off but also ON-Topic >>>i hate that >>> of course of MONEY and  PROFIT THINKING - and so on, information gots lost, or never get free.... 80% of them retrofits where for money, and  now nolonger exist - so nobody makes money with it, but in the other side - the information how they done that devices is not here > LOST...

    this was a good example for that.

     

    a other one:

    i had a website with 100th of mine free songs online (all of mine, and a few other artists)... but i have to pay for that server year for year for year., then they said i had no payed, (i dont get no warning or so) and the ereased all of it, and then the want MONEY FROM ME.... they dont get them shit anyway..  since 2 years my website no longer exist...a example for information got lost.

     

    UPDATE:

    multiplicate the triggertime by velocity value change the sound and the loudness a bit, or more then a bit:

    // a midi note comes in and trigger the following events...:     
    TrgTmp[0]=1; //Trig-State - flag...
    
    TrigDecayValue[0] = velocity*10; //calculate Trigger-Time via Velocity > 1000us = 1ms
    MIOS32_DOUT_PinSet(40, 1); //Trigger-Velocity-Pin-Out
    
    //The real accent layer "common" -0-15V
    TrgTmp[8]=1;  //initalize Accent-Trigger-Layer  
    TrigDecayValue[8] = velocity*20; 
    if(TrigDecayValue[8] < 1000) {TrigDecayValue[8]=1000;} //1000us = 1ms
             if (AccentStage == 0) {MIOS32_DOUT_PinSet(32,  1);}
             if (AccentStage == 1) {MIOS32_DOUT_PinSet(33,  1);}
             if (AccentStage == 2) {MIOS32_DOUT_PinSet(34,  1);}
             if (AccentStage == 3) {MIOS32_DOUT_PinSet(35,  1);}
             if (AccentStage == 4) {MIOS32_DOUT_PinSet(36,  1);}
             if (AccentStage == 5) {MIOS32_DOUT_PinSet(37,  1);}
             if (AccentStage == 6) {MIOS32_DOUT_PinSet(38,  1);}
             if (AccentStage == 7) {MIOS32_DOUT_PinSet(39,  1);}} 
    
    
    //now the decay counter ---DOUT-hi-state-time
    static void TASK_Trigger_Decay(void *pVParameters){//Trigger > Note OFF
       portTickType xLastExecutionTime;
       xLastExecutionTime = xTaskGetTickCount();       // Initialise the xLastExecutionTime variable on task entry
    
      while( 1 ) {
          if (TrgTmp[8]==1)  { //is the Trigger state HI (ON)? 8 = ACCENT LAYER
              TrigDecayCount[8]++;
              if(TrigDecayCount[8] >= TrigDecayValue[8]){TrigDecayCount[8] = 0; //Reset Counter
    			  TrgTmp[8] = 0; //Reset the Trigger State > avoid endless loops
                  MIOS32_DOUT_PinSet(32, 0),MIOS32_DOUT_PinSet(33, 0),MIOS32_DOUT_PinSet(34, 0),
    		      MIOS32_DOUT_PinSet(35, 0),MIOS32_DOUT_PinSet(36, 0),MIOS32_DOUT_PinSet(37, 0),		                                       
    		      MIOS32_DOUT_PinSet(38, 0),MIOS32_DOUT_PinSet(39, 0);} }
       
    	  //Decay-Time > TrigTmp-State > DOUT-State
          if (TrgTmp[0]==1)  { //is the Trigger state HI (ON)?
              TrigDecayCount[0]++;
              if(TrigDecayCount[0] >= TrigDecayValue[0]){TrigDecayCount[0] = 0; //Reset Counter
    			  TrgTmp[0] = 0; //Reset the Trigger State > avoid endless loops
                  MIOS32_DOUT_PinSet(40,  0);//OUT Trigger > LO
                  MIOS32_DOUT_PinSet(48, 0);}} //OUT Trigger Indicator > LO}}
  6. hallo thorsten - thx for looking in

     

    where did you identify my gcc version?

     

    Anyway i did it, downloaded the toolchain copied the files, proved the envirnoment variables... > exactly the same warnings.

     

    bevore i used the lpc17.... i only changed now to STM32F4 for a other project... my environment variables now are, maybe copyied a false syntax for family processor and board, which was a result from a forum search...:

     

    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/tekkstar/mios32_toolchain/arm-none-eabi/bin"
    MIOS32_PATH=/home/tekkstar/mios32/trunk
    MIOS32_BIN_PATH=/home/tekkstar/mios32/trunk/bin
    MIOS32_GCC_PREFIX=arm-none-eabi
    MIOS32_FAMILY=STM32F4xx
    MIOS32_PROCESSOR=STM32F407VG
    MIOS32_BOARD=MBHP_CORE_STM32F4
    MIOS32_LCD=universal
  7. by compiling this code: note2light-withoutDMX.zip

     

    i got errors see below...

     

    make (im Verzeichnis: /home/tekkstar/c/note2light)
    rm -f project.hex
    Creating object file for app.c
    app.c:21:1: warning: 'bitband' attribute directive ignored [-Wattributes]
     } __attribute__((bitband)) my_struct;
     ^
    Creating object file for main.c
    Creating object file for strtol.c
    Creating object file for tasks.c
    Creating object file for list.c
    Creating object file for queue.c
    Creating object file for timers.c
    Creating object file for port.c
    Creating object file for umm_malloc.c
    Creating object file for startup_stm32f4xx.c
    Creating object file for mios32_srio.c
    Creating object file for mios32_din.c
    Creating object file for mios32_dout.c
    Creating object file for mios32_enc.c
    Creating object file for mios32_lcd.c
    Creating object file for mios32_midi.c
    Creating object file for mios32_osc.c
    Creating object file for mios32_com.c
    Creating object file for mios32_uart_midi.c
    Creating object file for mios32_spi_midi.c
    Creating object file for mios32_iic_midi.c
    Creating object file for mios32_iic_bs.c
    Creating object file for mios32_mf.c
    Creating object file for mios32_sdcard.c
    Creating object file for mios32_enc28j60.c
    Creating object file for mios32_timestamp.c
    Creating object file for mios32_bsl.c
    Creating object file for mios32_sys.c
    Creating object file for mios32_irq.c
    Creating object file for mios32_spi.c
    Creating object file for mios32_i2s.c
    Creating object file for mios32_board.c
    Creating object file for mios32_timer.c
    Creating object file for mios32_stopwatch.c
    Creating object file for mios32_delay.c
    Creating object file for mios32_ain.c
    Creating object file for mios32_usb.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_core.h:33,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/mios32_usb.c:30:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/mios32_usb.c:25:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for mios32_usb_midi.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33:0,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/mios32_usb_midi.c:27:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/mios32_usb_midi.c:22:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for mios32_usb_com.c
    Creating object file for mios32_uart.c
    Creating object file for mios32_iic.c
    Creating object file for printf-stdarg.c
    Creating object file for misc.c
    Creating object file for stm32f4xx_adc.c
    Creating object file for stm32f4xx_can.c
    Creating object file for stm32f4xx_crc.c
    Creating object file for stm32f4xx_cryp.c
    Creating object file for stm32f4xx_cryp_aes.c
    Creating object file for stm32f4xx_cryp_des.c
    Creating object file for stm32f4xx_cryp_tdes.c
    Creating object file for stm32f4xx_dac.c
    Creating object file for stm32f4xx_dbgmcu.c
    Creating object file for stm32f4xx_dcmi.c
    Creating object file for stm32f4xx_dma.c
    Creating object file for stm32f4xx_exti.c
    Creating object file for stm32f4xx_flash.c
    Creating object file for stm32f4xx_fsmc.c
    Creating object file for stm32f4xx_gpio.c
    Creating object file for stm32f4xx_hash.c
    Creating object file for stm32f4xx_hash_md5.c
    Creating object file for stm32f4xx_hash_sha1.c
    Creating object file for stm32f4xx_i2c.c
    Creating object file for stm32f4xx_iwdg.c
    Creating object file for stm32f4xx_pwr.c
    Creating object file for stm32f4xx_rcc.c
    Creating object file for stm32f4xx_rng.c
    Creating object file for stm32f4xx_rtc.c
    Creating object file for stm32f4xx_sdio.c
    Creating object file for stm32f4xx_spi.c
    Creating object file for stm32f4xx_syscfg.c
    Creating object file for stm32f4xx_tim.c
    Creating object file for stm32f4xx_usart.c
    Creating object file for stm32f4xx_wwdg.c
    Creating object file for usbd_core.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/src/usbd_core.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/src/usbd_core.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usbd_ioreq.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_ioreq.h:35,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/src/usbd_ioreq.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_ioreq.h:35,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/src/usbd_ioreq.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usbd_req.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_req.h:35,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/src/usbd_req.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/inc/usbd_req.h:35,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/src/usbd_req.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/src/usbd_req.c: In function 'USBD_GetString':
    /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/src/usbd_req.c:845:18: warning: comparison between pointer and integer [enabled by default]
         while (*desc != NULL)
                      ^
    /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/src/usbd_req.c: In function 'USBD_GetLen':
    /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_Device_Library/Core/src/usbd_req.c:863:17: warning: comparison between pointer and integer [enabled by default]
         while (*buf != NULL)
                     ^
    Creating object file for usbh_core.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/inc/usbh_ioreq.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/src/usbh_core.c:30:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/inc/usbh_ioreq.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/src/usbh_core.c:30:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usbh_hcs.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_regs.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_hcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/inc/usbh_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/inc/usbh_hcs.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/src/usbh_hcs.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_regs.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_hcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/inc/usbh_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/inc/usbh_hcs.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/src/usbh_hcs.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usbh_ioreq.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/inc/usbh_ioreq.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/src/usbh_ioreq.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/inc/usbh_ioreq.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/src/usbh_ioreq.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usbh_stdreq.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/inc/usbh_ioreq.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/src/usbh_stdreq.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/inc/usbh_ioreq.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_HOST_Library/Core/src/usbh_stdreq.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usb_core.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_core.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_core.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usb_dcd.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_dcd.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_dcd.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usb_dcd_int.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd_int.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_dcd_int.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_dcd_int.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_dcd_int.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usb_hcd.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_hcd.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_hcd.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usb_hcd_int.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_hcd_int.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_core.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_hcd_int.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for usb_otg.c
    In file included from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_defines.h:33:0,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_otg.c:29:
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:176:0: warning: "__packed" redefined [enabled by default]
       #define __packed    __attribute__ ((__packed__))
     ^
    In file included from /usr/include/newlib/stdio.h:35:0,
                     from /home/tekkstar/mios32/trunk/include/mios32/mios32.h:57,
                     from /home/tekkstar/mios32/trunk/mios32/STM32F4xx/usb_conf.h:29,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/inc/usb_defines.h:33,
                     from /home/tekkstar/mios32/trunk/drivers/STM32F4xx/v1.1.0/STM32_USB_OTG_Driver/src/usb_otg.c:29:
    /usr/include/newlib/sys/cdefs.h:250:0: note: this is the location of the previous definition
     #define __packed __attribute__((__packed__))
     ^
    Creating object file for app_lcd.c
    Creating object file for glcd_font_normal.c
    Creating object file for glcd_font_normal_inv.c
    Creating object file for glcd_font_big.c
    Creating object file for glcd_font_small.c
    Creating object file for glcd_font_tiny.c
    Creating object file for glcd_font_knob_icons.c
    Creating object file for glcd_font_meter_icons_h.c
    Creating object file for glcd_font_meter_icons_v.c
    Creating object file for diskio.c
    Creating object file for ccsbcs.c
    Creating object file for ff.c
    Creating object file for file.c
    Creating object file for mini_cpp.cpp
    Creating object file for freertos_heap.cpp
    -------------------------------------------------------------------------------
    Application successfully built for:
    Processor: STM32F407VG
    Family:    STM32F4xx
    Board:     MBHP_CORE_STM32F4
    LCD:       universal
    -------------------------------------------------------------------------------
    arm-none-eabi-size project_build/project.elf
       text       data        bss        dec        hex    filename
      71794        248      17144      89186      15c62    project_build/project.elf
    Kompilierung erfolgreich beendet.
    20000000 D __ram_start
    200043f0 B __ram_end

     

  8. I use now STM32F4 ... but still compiling error

    the orginal DMX code was written for a STM32F1 (i think that was i read...) but that board i dont have @ home

    so i switched my setup to a     CORE_STM32F4... in the hope that it would run  on it... No it dont compile.

     

    how ever my test-code >>note2light-withDMX.zip << with the DMX-Parts activatet - which give me following compiling errors:

    make (im Verzeichnis: /home/tekkstar/c/note2light)
    rm -f project.hex
    Creating object file for app.c
    app.c:21:1: warning: 'bitband' attribute directive ignored [-Wattributes]
     } __attribute__((bitband)) my_struct;
     ^
    Creating object file for dmx.c
    /home/tekkstar/mios32/trunk/modules/dmx/dmx.c: In function 'DMX_Init':
    /home/tekkstar/mios32/trunk/modules/dmx/dmx.c:65:34: error: 'GPIO_Mode_AF_PP' undeclared (first use in this function)
       GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
                                      ^
    /home/tekkstar/mios32/trunk/modules/dmx/dmx.c:65:34: note: each undeclared identifier is reported only once for each function it appears in
    /home/tekkstar/mios32/trunk/modules/dmx/dmx.c:69:34: error: 'GPIO_Mode_IPU' undeclared (first use in this function)
       GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
                                      ^
    Kompilierung fehlgeschlagen.
    /home/tekkstar/mios32/trunk/include/makefile/common.mk:160: recipe for target 'project_build//home/tekkstar/mios32/trunk/modules/dmx/dmx.o' failed
    make: *** [project_build//home/tekkstar/mios32/trunk/modules/dmx/dmx.o] Error 1

     

    -for controll this is my code without DMX-Code in it:>> note2light-withoutDMX.zip<<

     

     

     

    by the way when i try to compile examples/dmx - code i got following compiling errors:

    make (im Verzeichnis: /home/tekkstar/mios32/trunk/apps/examples/dmx)
    rm -f project.hex
    Creating object file for startup_stm32f4xx.c
    Creating object file for mios32_bsl.c
    Creating object file for mios32_sys.c
    Creating object file for mios32_irq.c
    Creating object file for mios32_spi.c
    Creating object file for mios32_i2s.c
    Creating object file for mios32_board.c
    Creating object file for mios32_timer.c
    Creating object file for mios32_stopwatch.c
    Creating object file for mios32_delay.c
    Creating object file for mios32_ain.c
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/mios32_ain.c: In function 'DMA2_Stream0_IRQHandler':
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/mios32_ain.c:583:25: error: 'GPIO_TypeDef' has no member named 'BSRR'
         MIOS32_AIN_MUX0_PORT->BSRR = (mux_value & (1 << 0)) ? MIOS32_AIN_MUX0_PIN : (MIOS32_AIN_MUX0_PIN<<16);
                             ^
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/mios32_ain.c:586:25: error: 'GPIO_TypeDef' has no member named 'BSRR'
         MIOS32_AIN_MUX1_PORT->BSRR = (mux_value & (1 << 1)) ? MIOS32_AIN_MUX1_PIN : (MIOS32_AIN_MUX1_PIN<<16);
                             ^
    /home/tekkstar/mios32/trunk/mios32/STM32F4xx/mios32_ain.c:589:25: error: 'GPIO_TypeDef' has no member named 'BSRR'
         MIOS32_AIN_MUX2_PORT->BSRR = (mux_value & (1 << 2)) ? MIOS32_AIN_MUX2_PIN : (MIOS32_AIN_MUX2_PIN<<16);
                             ^
    Kompilierung fehlgeschlagen.
    /home/tekkstar/mios32/trunk/include/makefile/common.mk:160: recipe for target 'project_build//home/tekkstar/mios32/trunk/mios32/STM32F4xx/mios32_ain.o' failed
    make: *** [project_build//home/tekkstar/mios32/trunk/mios32/STM32F4xx/mios32_ain.o] Error 1
  9. hi,

    no - i setuped this linux pc 2015, the actual toolchain is 2013

     

    I also opened Tutorial 1 and  i made a simple operation:

    #include <mios32.h>
    #include "app.h"
    #include <math.h>
    
      float midi[127] = {}; //represent Midinote 0-127 - and its value is a Frequency in [hz]
      u32 actualnote = 69; // where 69 is A3 named A (which is tuned with "tuning" Variable above)
      s32 notecount = 0; // only a counter variable to calculate the note frequencys.
      float tuning = 431; //represent the tuning of "Kammerton A3"  
      float finetuning = 0.95; //represent the floating point of tuning (eg.: 431,095hz)
      
    void APP_Init(void){}
    void APP_Background(void){}
    void APP_Tick(void){}
    void APP_MIDI_Tick(void){}
    
    void APP_MIDI_NotifyPackage(mios32_midi_port_t port, mios32_midi_package_t midi_package)
    { 
    	       notecount = tuning * pow(2, 2);
             //for (notecount = 0; notecount < 127; ++notecount)  
             //{midi[notecount] = tuning * pow(2, (float)(notecount - 69)/12);}
    }
    
    void APP_SRIO_ServicePrepare(void){}
    void APP_SRIO_ServiceFinish(void){}
    void APP_DIN_NotifyToggle(u32 pin, u32 pin_value){}
    void APP_ENC_NotifyChange(u32 encoder, s32 incrementer){}
    void APP_AIN_NotifyChange(u32 pin, u32 pin_value){}
    

    which is compiling without problems

     

    but by using again your code line:

    #include <mios32.h>
    #include "app.h"
    #include <math.h>
    
      float midi[127] = {}; //represent Midinote 0-127 - and its value is a Frequency in [hz]
      u32 actualnote = 69; // where 69 is A3 named A (which is tuned with "tuning" Variable above)
      s32 notecount = 0; // only a counter variable to calculate the note frequencys.
      float tuning = 431; //represent the tuning of "Kammerton A3"  
      float finetuning = 0.95; //represent the floating point of tuning (eg.: 431,095hz)
      
    void APP_Init(void){}
    void APP_Background(void){}
    void APP_Tick(void){}
    void APP_MIDI_Tick(void){}
    
    void APP_MIDI_NotifyPackage(mios32_midi_port_t port, mios32_midi_package_t midi_package)
    { 
    	       //notecount = tuning * pow(2, 2);
             for (notecount = 0; notecount < 127; ++notecount)  
             {midi[notecount] = tuning * pow(2, (float)(notecount - 69)/12);}
    }
    
    void APP_SRIO_ServicePrepare(void){}
    void APP_SRIO_ServiceFinish(void){}
    void APP_DIN_NotifyToggle(u32 pin, u32 pin_value){}
    void APP_ENC_NotifyChange(u32 encoder, s32 incrementer){}
    void APP_AIN_NotifyChange(u32 pin, u32 pin_value){}
    

    i got the known error message:

    make (im Verzeichnis: /home/tekkstar/mios32/trunk/apps/tutorials/001_forwarding_midi)
    rm -f project.hex
    Creating object file for app.c
    /usr/lib/gcc/arm-none-eabi/4.8/../../../arm-none-eabi/lib/armv7-m/libm.a(lib_a-w_pow.o): In function `pow':
    /build/buildd/newlib-2.1.0+git20140818.1a8323b/build/arm-none-eabi/armv7-m/newlib/libm/math/../../../../../../newlib/libm/math/w_pow.c:210: undefined reference to `__errno'
    /build/buildd/newlib-2.1.0+git20140818.1a8323b/build/arm-none-eabi/armv7-m/newlib/libm/math/../../../../../../newlib/libm/math/w_pow.c:164: undefined reference to `__errno'
    /build/buildd/newlib-2.1.0+git20140818.1a8323b/build/arm-none-eabi/armv7-m/newlib/libm/math/../../../../../../newlib/libm/math/w_pow.c:120: undefined reference to `__errno'
    Kompilierung fehlgeschlagen.
    /home/tekkstar/mios32/trunk/include/makefile/common.mk:139: recipe for target 'project_build/project.elf' failed
    /build/buildd/newlib-2.1.0+git20140818.1a8323b/build/arm-none-eabi/armv7-m/newlib/libm/math/../../../../../../newlib/libm/math/w_pow.c:207: undefined reference to `__errno'
    collect2: error: ld returned 1 exit status
    make: *** [project_build/project.elf] Error 1
    

    strange.

  10. hi peter, thank you for watching in.

     

    for POW i had to add first:

    #include <stdio.h>
    #include <math.h>

     

    i got then following compiling error with your line:

    (app.c:21:1: was there bevore and has something to do what that dmx stuff...that i "//" out  @ the moment)

     

    make (im Verzeichnis: /home/tekkstar/c/note2light)
    rm -f project.hex
    Creating object file for app.c
    app.c:21:1: warning: 'bitband' attribute directive ignored [-Wattributes]
     } __attribute__((bitband)) my_struct;
     ^
    /usr/lib/gcc/arm-none-eabi/4.8/../../../arm-none-eabi/lib/armv7-m/libm.a(lib_a-w_pow.o): In function `pow':
    /build/buildd/newlib-2.1.0+git20140818.1a8323b/build/arm-none-eabi/armv7-m/newlib/libm/math/../../../../../../newlib/libm/math/w_pow.c:210: undefined reference to `__errno'
    /build/buildd/newlib-2.1.0+git20140818.1a8323b/build/arm-none-eabi/armv7-m/newlib/libm/math/../../../../../../newlib/libm/math/w_pow.c:164: undefined reference to `__errno'
    /build/buildd/newlib-2.1.0+git20140818.1a8323b/build/arm-none-eabi/armv7-m/newlib/libm/math/../../../../../../newlib/libm/math/w_pow.c:120: undefined reference to `__errno'
    /build/buildd/newlib-2.1.0+git20140818.1a8323b/build/arm-none-eabi/armv7-m/newlib/libm/math/../../../../../../newlib/libm/math/w_pow.c:207: undefined reference to `__errno'
    collect2: error: ld returned 1 exit status
    Kompilierung fehlgeschlagen.
    /home/tekkstar/mios32/trunk/include/makefile/common.mk:139: recipe for target 'project_build/project.elf' failed
    make: *** [project_build/project.elf] Error 1
     
  11. THX TK!  - worked! - have updatet the code above...i think there are better way to show floating in LCD, but thats the workaround i can do (which much code lines extra.)

     

    now i see what the code does... and it does not right:

     

    the calculation from midi notes to frequency, is based on

    tuning of note Number 69 (A3): for example @ 432hz

     

    the formular on the internet give me this:

    freq = 430 * 2^((n-69)/12) where 'n' is the MIDI note number (2)

     

    i progrommed this:

    for (notecount = 0; notecount < 127; ++notecount)  
           {midi[notecount] = tuning * (2 ^ ((notecount-69) / 12));} 

     

    it should fill a 127 wide array with Frequencys corresponding to its note numbers.

     

    the formular make something wrong because the outputs are wrong:

    when i put in Note Nr 33, i get -14hz (A0)  should be 54

    when i put in Note Nr 45, i get -17hz (A1)  should be 107

    when i put in Note Nr 57, i get -12hz (A2)  should be 215

    when i put in Note Nr 69, i get 866hz (A3)  should be 431

    when i put in Note Nr 61, i get 129hz (A4)  should be 862

    when i put in Note Nr 93, i get 0hz     (A5)  should be 1724

  12. the calculation from midi notes to frequency, is based on

    tuning of note Number A3: eg. 430-450hz

     

    the formular on the internet give me this:

    freq = 440 * 2^((n-69)/12) where 'n' is the MIDI note number (2)
    //Calculate Frequencys 4 notes...   
    for (notecount = 0; notecount < 127; ++notecount)   
        { midi[notecount] = tuning * pow(2, (float)(notecount - 69)/12); }

    it should fill an 127 wide array with Frequencys corresponding to its note numbers.

     

    the formular make something wrong:  --- SOLVED - i updetate the working code > THX to Peter

    when i put in Note Nr 33, i get -14hz (A0)

    when i put in Note Nr 45, i get -17hz (A1)

    when i put in Note Nr 57, i get -12hz (A2)

    when i put in Note Nr 69, i get 866hz (A3)

    when i put in Note Nr 61, i get 129hz (A4)

    when i put in Note Nr 93, i get 0hz     (A5)

    I put in:
    actualnote: 69 (which is A3 &gt;&gt;&gt; Kammerton A)
    tuning: 431 (A3 = 431hz)

    it should put out: midi[actualnote]=431    

    but on the LCD i prints out:1079427072 --- and this is not right >> SOLVED: write (float) in front of a Variable if you want to print it >>> thx to TK
     

    WORKING CODE:

    #include <mios32.h>
    #include <FreeRTOS.h>
    #include <task.h>
    #include "tasks.h"
    #include "file.h"
    #include "app.h"
    #include <portmacro.h>
    #include <queue.h>
    #include <semphr.h>
    #include <string.h>
    #include "mios32_timer.h"
    #include "float.h"  
    #include <stdio.h>
    #include <math.h>
    //#include "dmx.h"
     
    //DMX:
    typedef struct {
        int normal_access : 3;
        int single_bit_bb : 1;
    } __attribute__((bitband)) my_struct;
    my_struct phil;
     
    #define NUM_ENCODERS 9 //5 Menue Encoders are connectet
    const mios32_enc_config_t encoders[NUM_ENCODERS] = {//(SR begin with 1, ENC with 0) // setup the Pinout of that Encoders
        { .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=1, .cfg.pos=0 },        //Menue Encoder 0     - only virtual, since they are mapped to differnt Variables...  
        { .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=1, .cfg.pos=2 },        //Menue Encoder 1    - ...if "Menue Page Encoder" has changed
        { .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=1, .cfg.pos=4 },        //Menue Encoder 2
        { .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=1, .cfg.pos=6 },        //Menue Encoder 3
        { .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=2, .cfg.pos=0 },        //Menue Encoder 4  
        { .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=2, .cfg.pos=2 },        //Menue Encoder 5
        { .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=2, .cfg.pos=4 },        //Menue Encoder 6
        { .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=2, .cfg.pos=6 },        //Menue Encoder 7    
        { .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=3, .cfg.pos=0 },};    //Menue Page Encoder
    xSemaphoreHandle xLCDSemaphore;        // take and give access to LCD
     
        u32 MenueUpdateCount = 0; //to calculate the LCD-Menue-Update-Rate
        float value = 0; //Encoder calculation...
        u32 i = 0; //Encoder calcualtion
     
    //DMX
    u8 RGBWdmx[4]={0, 0, 0, 250}; //RGBW values
    u8 RGBWenc[4]={0, 0, 0, 250}; //RGBW values
    u8 count = 0; //to count thru the rgbw-channels while sending DMX...
     
    //note2sound
      u32 nm = 10;
      u32 rpm = 25680;
      u32 time = 2161; //setup timer time
      u32 timecount = 0;
      u32 hzcount = 0;
      u32 decaytime = 128;
      float tuning = 431; //represent the tuning of "Kammerton A3"   
      float finetuning = 0.95; //represent the floating point of tuning (eg.: 431,095hz)
      u32 finetuningLCD = 95; //float of tuning - to calculate to show on display
      float midi[127] = {}; //represent Midinote 0-127 - and its value is a Frequency in [hz]
      u32 actualnote = 69; // where 69 is A3 named A (which is tuned with "tuning" Variable above)
      s32 notecount = 0; // only a counter variable to calculate the note frequencys.
       
    //MidiSetup
    u8 midich = Chn9;
    u8 midiport= 32; //Midi-Melody Input, [32=UART0=Midi1, 33=UART1=Midi2 on LPC17core]
     
    //Task Prioritys    
    #define MUTEX_LCD_TAKE { while( xSemaphoreTakeRecursive(xLCDSemaphore, (portTickType)0) != pdTRUE ); }  //a Mutex reserve a Resoure (LCD or SD-Card) for a task, until it is given away...
    #define MUTEX_LCD_GIVE { xSemaphoreGiveRecursive(xLCDSemaphore); }
    #define PRIORITY_StoreLoad   ( tskIDLE_PRIORITY + 2 ) //3:Mios standart
     
    static void StoreLoad(u8 tick, u16 order);        
     
    void APP_Init(void){
        MIOS32_BOARD_LED_Init(0xffffffff);                                  //initialize all LEDs
        xLCDSemaphore         = xSemaphoreCreateRecursiveMutex();                //create Mutex for LCD access                                                                                                    //initialize encoders   i = counter
        for(i=0; i<NUM_ENCODERS; ++i) MIOS32_ENC_ConfigSet(i, encoders[i]); //initialize encoders
        //DMX_Init(0);
    }
     
     
    void APP_Background(void){  
    //DMX:
      // endless loop
    /*  while(1) { for (count=0;count<4;count++)
                 { if (RGBWdmx[count]!=RGBWenc[count]) //if something has changed - send the value via DMX!
                   {   RGBWdmx[count]=RGBWenc[count];
                       DMX_SetChannel(count,(u8)RGBWdmx[count]);}
                 }
               } */
    }
     
    void APP_Tick(void) {  //1ms Event Triggering
    MenueUpdateCount = MenueUpdateCount + 1;  
         if(MenueUpdateCount > 650){MenueUpdateCount = 0; StoreLoad(0, 0);}} //update the Menue
     
    void APP_MIDI_Tick(void){}
     
    void APP_MIDI_NotifyPackage(mios32_midi_port_t port, mios32_midi_package_t midi_package){
      if(port==midiport && midi_package.chn == midich && midi_package.type == NoteOn)
        {actualnote=midi_package.note;}}
        
    void APP_SRIO_ServicePrepare(void){}
    void APP_SRIO_ServiceFinish(void){}
    void APP_DIN_NotifyToggle(u32 pin, u32 pin_value){}
     
    void APP_ENC_NotifyChange(u32 encoder, s32 incrementer){    
        if(encoder == 1){ value = tuning + incrementer; //tuning of note A-3  
           if(value < 430)   {value = 450;}
           if(value > 450)   {value = 430;}
           tuning = value;
           //Calculate Frequencys 4 notes...   
           for (notecount = 0; notecount < 127; ++notecount)   
             {midi[notecount] = tuning * pow(2, (float)(notecount - 69)/12);}
           //{midi[notecount] = tuning * (2 ^ ((notecount-69) / 12));}  
        }    
        
        if(encoder == 2){ value = finetuning + ((float)incrementer/1000); // finetune
                          if(value < 0.001)   {value = 0;}
                          if(value > 1)       {value = 1;}
                          finetuning = value;
                          tuning=tuning + finetuning;      
                          if(tuning < 430)   {tuning = 430;}
                          if(tuning > 450)   {tuning = 450;}
                          finetuningLCD = finetuning*1000;    }
                              
        if(encoder == 3){ value = RGBWenc[0] + incrementer; //RED
                          if(value < 0)   {value = 255;}
                          if(value > 255)   {value = 0;}
                          RGBWenc[0] = value;               }
     
        if(encoder == 4){ value = RGBWenc[1] + incrementer; //GREEN
                          if(value < 0)   {value = 255;}
                          if(value > 255)   {value = 0;}
                          RGBWenc[1] = value;               }                       
        if(encoder == 5){ value = RGBWenc[2] + incrementer; //BLUE
                          if(value < 0)   {value = 255;}
                          if(value > 255)   {value = 0;}
                          RGBWenc[2] = value;               }
                           
        if(encoder == 6){ value = RGBWenc[3] + incrementer; //White
                          if(value < 0)   {value = 255;}
                          if(value > 255)   {value = 0;}
                          RGBWenc[3] = value;               }                      
    }
     
    void APP_AIN_NotifyChange(u32 pin, u32 pin_value){}
     
    static void StoreLoad(u8 tick, u16 order){         //Display MENUE
        if(tick == 0){//Menue tick
             MUTEX_LCD_TAKE;        //request LCD access
                MIOS32_LCD_Clear(); //clear screen
              //1st Line = Encoder Variables....change something!
                MIOS32_LCD_CursorSet(0,  0);  MIOS32_LCD_PrintFormattedString("%u", actualnote);
                MIOS32_LCD_CursorSet(4,  0);  MIOS32_LCD_PrintFormattedString("%d", (int)tuning);
                MIOS32_LCD_CursorSet(7,  0);   
                if (finetuningLCD>=100)                      {MIOS32_LCD_PrintFormattedString("%s" "%d", ".",   finetuningLCD);}
                if (finetuningLCD< 100 && finetuningLCD>=10) {MIOS32_LCD_PrintFormattedString("%s" "%d", ".0",  finetuningLCD);}
                if (finetuningLCD< 10)                       {MIOS32_LCD_PrintFormattedString("%s" "%d", ".00", finetuningLCD);}     
                       
                MIOS32_LCD_CursorSet(16, 0);  MIOS32_LCD_PrintFormattedString("%d", RGBWenc[0]);
                MIOS32_LCD_CursorSet(21, 0);  MIOS32_LCD_PrintFormattedString("%d", RGBWenc[1]);
                MIOS32_LCD_CursorSet(27, 0);  MIOS32_LCD_PrintFormattedString("%d", RGBWenc[2]);
                MIOS32_LCD_CursorSet(32, 0);  MIOS32_LCD_PrintFormattedString("%d", RGBWenc[3]);
                MIOS32_LCD_CursorSet(37, 0);  MIOS32_LCD_PrintFormattedString("%d", (int)midi[actualnote]);
                 
              //2nd Line = Menue Describtio
                MIOS32_LCD_CursorSet(0,  1);  MIOS32_LCD_PrintFormattedString("%s", "nte ");
                MIOS32_LCD_CursorSet(4,  1);  MIOS32_LCD_PrintFormattedString("%s", "tune");             
                MIOS32_LCD_CursorSet(16, 1);  MIOS32_LCD_PrintFormattedString("%s", "red  ");
                MIOS32_LCD_CursorSet(21, 1);  MIOS32_LCD_PrintFormattedString("%s", "gren  ");             
                MIOS32_LCD_CursorSet(27, 1);  MIOS32_LCD_PrintFormattedString("%s", "blue ");
                MIOS32_LCD_CursorSet(32, 1);  MIOS32_LCD_PrintFormattedString("%s", "whit ");                                    
                MIOS32_LCD_CursorSet(37, 1);  MIOS32_LCD_PrintFormattedString("%s", "frq");             
              MUTEX_LCD_GIVE;}}                    // release LCD access for other tasks
    
    

     

    &

     

    replace:
    LIBS =

    with

    LIBS = -lm

    in the makefile...

     

     
  13. 5. DMX - Part   NOT SOLVED YET

    the code which i cant compile if i activate the DMX functions: note2light-withDMX.zip

     

    Connect a 3 Pole- XLR-DMX-Connector to a LPC17 board: >>>J4B??? << I moved to STM32F4

    Connect a 3 Pole- XLR-DMX-Connector to a STM32 board: >>>J4B???

    do i need a IIC-Module? (RS485) >>> phil A other guy says that the voltage from lo to hi is a bit low... so it would only whith short cables... (a few meters...)

     

    is following pinout correct?: << I moved to STM32F4, but still dont know how to connect.

     

    under "dmx.h" there is the pinout for the DMX-Port  definied:

    #define DMX_TX_PORT     GPIOA
    #define DMX_TX_PIN      GPIO_Pin_9
    #define DMX_RX_PORT     GPIOA
    #define DMX_RX_PIN      GPIO_Pin_10
    #define DMX             USART1
    #define DMX_IRQ_CHANNEL USART1_IRQn
    #define DMX_IRQHANDLER_FUNC void USART1_IRQHandler(void)

    The LPC17-core describtion says: <<<I moved to STM32F4

    J4B      A second IIC port, which can also be used as an additional MIDI IN/OUT port (MIDI IN4/OUT4) if enabled in MIOS32 (add "#define MIOS32_UART_NUM 4" to the mios32_config.h file).
    MIDI IN4 will be available on the J4B.SC. If a 6N138 based optocoupler circuit should be connected, replace the 2.2k pull-up R10 by 1k, or add a second 2.2k in parallel to get 1.1k effectively.
    MIDI OUT4 will be available on the J4B.SD pin, it isn't required to remove R9 if already soldered - it doesn't hurt.

     

    The STM32F4 core describtion says:

    J4B: Two IIC ports. Interface to BankSticks or to MBHP_IIC_* modules like MBHP_IIC_MIDI.

     

    I could use then J4B? > MIOS32_UART_NUM 4?

    dmx.h is talking about RX, TX while a 3pole-DMX-XLR-Connector  is symetric: Mass and - and +.

    and do i have to change this lines to something like that?:
    #define DMX_TX_PORT     GPIOA
    #define DMX_TX_PIN      GPIO_Pin_10
    #define DMX_RX_PORT     GPIOA
    #define DMX_RX_PIN      GPIO_Pin_11
    #define DMX             USART4
    #define DMX_IRQ_CHANNEL USART4_IRQn
    #define DMX_IRQHANDLER_FUNC void USART4_IRQHandler(void)

    phils mios32 config: he disable uart...and disable with that midi of the whole board? can i workaround that?

    #ifndef _MIOS32_CONFIG_H
    #define _MIOS32_CONFIG_H
    #define MIOS32_DONT_USE_UART   // For now disable UART as we will be using DMX
    #endif /* _MIOS32_CONFIG_H */

     

    my mios32 config: i need midi becaue notes triggering events... ---disable uart4 by Assigment 0 make the same? or 2 > com?

    #ifndef _MIOS32_CONFIG_H
    #define _MIOS32_CONFIG_H
    #define MIOS32_USE_MIDI
    #define MIOS32_USE_UART
    #define MIOS32_USE_UART_MIDI
    #define MIOS32_UART_NUM 4
    #define MIOS32_UART0_ASSIGNMENT 1 //1=Midi, 0= Disabled, 2= COM
    #define MIOS32_UART1_ASSIGNMENT 1
    #define MIOS32_UART2_ASSIGNMENT 1
    #define MIOS32_UART3_ASSIGNMENT 2
    #endif /* _MIOS32_CONFIG_H */
  14. very cool!

    tomorrow i will order such a display, the rest i have @ home.

     

    dont miss understand that as "auftrag" i write down my needings, and my idea, i need some simular device, and maybe the ideas which came up can bring us forward a bit...

     

    I am thinking about to built that the device in a 19" case, with midi conection to my already built footboard (with virtual buttons and displays and so on....) - fully controllable over the 19" case, and via midi the most interesting record and loop features in a jam situation e.g. Start Stop Loops, Record Loops, changing Loop length (offset/shift, length)

     

    yes the "always record mode"... i told my guitarist about that, and he was not very family with the idea, to always record, and then when he thougt it was good to press record and it was done >>> i think he learned it about the old way -press record, press stop > and now he cant think that there is  a better way "was der bauer nicht kennt frisst er nicht..." - for me as a human that want to express my self ONCE - and once it is done i will express me a other way - because otherwhise it would be boring... ok for me as a ONCE-Man i want to express the holy vibration once - and in this moment it is perfect! (oh it is always the first time you press on a keyboard...) the Machine have to capture this moment and have to loop that moment over and over over - while my guitarist want to repeat and repeat and repeat it ever and ever he says that is ReProducing-ability or something... i think just make that the device and say "PLAY!"

     

    i thougt about the idea the last years... and there came out a few designs..

    -1 Button - Move all the data in a cycle reward - it make sense to install some scroll mechanism - e.g. longer press automatic continue the shifting stepwise

    +1 Button - Move all the data in a cycle forward -     --//--   --//--    -  maybe other technologies have to be used - IR-Transistors and LED-Arrays....

     

    when you have just pressed the Always Recording-Button , you use normally the +1 button to shift the last recordet notes to the start of the loop... and a loop is long maybe something aroung 512 (in steps) so it is generally not hearable... the last recordet notes generally are not played good, because you was focused to find the RECord button and press it... maybe a automatic mode with a standard +Offset that is triggerd with the REC-Button is a solution,

    how much steps (3 4 6 8...) automatic offset? > that is a user definied question and depends on how fast can a musican act, and how far are the ways to the Record Buttons... so it has to be changed via the Display-Menue.

     

    Yes and of course -16 and + 16 Buttons (in 3er Mode these are automaticly -12 +12) Buttons which change the loop length

    thinkable extra buttons parallel to the -16 +16 Buttons would be "doubled Length" Buttons which change by the first step -32, - 64, -128, -256, -512

    just to jump faster to the "right" positions - and as nice side effect - when you always use this "doubled Length" buttons the 4 Loops are always in "Sync" >>> a 48 step loop and a 64 steps are always shifting around, in its endless loopness.... a 64 length loop and a  128 length loop will always play stable in the same playing to gether ---- maybe by playing mono-lead or bass sounds it does not matter, but when you play rich cords with half tones and full tones.... and on the other loop also...you can think there are moments when it sounds not so good.

  15. this is realtime record - no step based... but the length - i think - is step-counted (miditicks)?

    if the 4 LEDs are showing this - i think it is counting in 4er...8 16 32 64

     

    my quest: it would be nice if  i could choose un-straight counting like 3er, 6er 12er... (the setupd- counter structure is saved in the song, if the song is 3er based all 4 loops in this songs are 3er based)

     

    my synth-guitarist alwasys ask me to make un-straight beats... with my korg er1 it is possible...it just counts to 12 instead to 16...... in with his RC300 of course also 3er are possible... and i must say after one year playing with him i - am in love with 3er...

  16. Idea:

     

    it is inpired by the work of Andreas Körber and his "WortKraftSchwingung"

     

    Input: Midi notes

    Output1: DMX R-G-B values

    Destination1: RGBW-LED-PAR.

    Output2: LFO Audio Output 4 Bodyshacker

     

    a standart audio setup with a Midi-Sound-Synthesizer which is tuned to a specific frequency, a=430-445hz

    this tuning has to be set in the Converter-Software, because the converter gets only notes not frequencys...

     

    Hardware:

    switched to STM32F4

    Stairville LEDPAR36 - RGBW-LED-PAR

     

     

    Converting Idea:

    is to octave the sound frequency as long we see it... since all octaves are sounding great...and some greater...the visible frequency then maybe also...and anyway - its a cool effect on stage.

     

    so what has to be calculated?

    we have hearable-sound-frequency in Herz [hz]

    we want to calculate the Visible color frequency in NanoMeter [nm]

     

     

    for example:

     

    1. a note produce a sound of 100hz:

    float midi[127] = {}; //represent Midinote 0-127 - and its value is a Frequency in [hz]
    u32 actualnote = 69; // where 69 is A3 named A (which is tuned with "tuning" Variable above)
    s32 notecount = 0; // only a counter variable to calculate the note frequencys.
    float tuning = 431; //represent the tuning of "Kammerton A3"
    
    for (notecount = 0; notecount < 127; ++notecount) //calculte all 127 notes and frequencys
    {midi[notecount] = tuning * pow(2, (float)(notecount - 69)/12);}
    
    midi[actualnote] ///(=outputs the Frequency in [hz] for the actual played note



    2. calculate the visible octave of 100hz

        & divide lightspeed by that frequency

          (hz*42th octave) / 10^12 =THz   >>>>   (100hz*2^42)/10^12 = 439.804THz

           lightspeed/THz=nm                     >>>>   299792,458/439.804 = 681.640nm

     

    float nm;
    long thz;
    
    thz = ( (midi[actualnote] * pow(2, 42) ) / 1000000000000);
    nm = 299792.458 / (float)thz;

    is the result not in the visible Spectrum > not between 790 and 390nm? whats then?:::

    i figured out that D2-D3 is the visible octave (midi nr 42 - 54)

    @431hz A3 tuning:

    F2=753nm, F3=376nm

     

    is it under 42?

    +12 notes until it is above or equal F2, how many octaves?>how many change the whithe LED-Level....

    is it above 53?

    -12 notes until it is under or equal F3, how many octaves?>how many change the whithe LED-Level....:::

         //transpose the note to the visible Octave (NoteNr41-53) and save the octave Nr for further LED-White Parameters.
         octaveCOUNT = 4; //4 is the visible octave
         visiblenote = midinote;
         if (midinote < 42) {visiblenote = midinote + 12; --octaveCOUNT; // below visible octave?
             if (visiblenote < 42) {visiblenote = visiblenote + 12; --octaveCOUNT;
                 if (visiblenote < 42) {visiblenote = visiblenote + 12; --octaveCOUNT;        
                     if (visiblenote < 42) {visiblenote = visiblenote + 12; --octaveCOUNT; }}}}    
                             
         if (midinote > 54) {visiblenote = midinote - 12; ++octaveCOUNT; //above visible octave
             if (visiblenote > 54) {visiblenote = visiblenote - 12; ++octaveCOUNT;
                 if (visiblenote > 54) {visiblenote = visiblenote - 12; ++octaveCOUNT;        
                     if (visiblenote > 54) {visiblenote = visiblenote - 12; ++octaveCOUNT;
                         if (visiblenote > 54) {visiblenote = visiblenote - 12; ++octaveCOUNT;
                             if (visiblenote > 54) {visiblenote = visiblenote - 12; ++octaveCOUNT;}}}}}}   
    

     

     

    3. RGBW Calculation

    no matter which we use i have to offset the code with the real world the "RGB-LED-Spot" 

    we cant speak of a exact octaved visible Light colour... but maybe we fade in a range +-hz

    so your mind find the correct colour itself....like a detuned unisono synth---there are frequencys sometimes that sounds great...

     

    the other thing is: Frequencys below 400 are UV... a UV-LED-DMX light would do the job... maybe i get me one once the dam DMX-Code thing is done.

    //MIX WHITE Light to the RGB, by using the Octaves, you may turn of that feature if you dont want.
          if      (octaveCOUNT == 0) {RGBWnm[3] =   0;}
          else if (octaveCOUNT == 1) {RGBWnm[3] =  28;}    
          else if (octaveCOUNT == 2) {RGBWnm[3] =  57;}  
          else if (octaveCOUNT == 3) {RGBWnm[3] =  85;}           
          else if (octaveCOUNT == 4) {RGBWnm[3] = 110;}    
          else if (octaveCOUNT == 5) {RGBWnm[3] = 138;}         
          else if (octaveCOUNT == 6) {RGBWnm[3] = 166;}    
          else if (octaveCOUNT == 7) {RGBWnm[3] = 194;}         
          else if (octaveCOUNT == 8) {RGBWnm[3] = 222;}    
          else if (octaveCOUNT >= 9) {RGBWnm[3] = 255;}  
          //WHITE OFFSET:      
          RGBWdmx[3] = RGBWnm[3] -(RGBWenc[3]) ;  
     
     
          //convert [nm] 2 [RGB] --- the GAMMA is not calculatet so - the colors @ end of spectrum are static...but they
          //have to fade out....
          if      (nm < 380) {RGBWnm[0] = 0;    //if it is no visible spectrum
                              RGBWnm[1] = 0;
                              RGBWnm[2] = 12;}  //a UV-Source has alternativly to be activated
     
          if      (nm > 780) {RGBWnm[0] = 12;   //a IR source has alternativly to be activated
                              RGBWnm[1] = 0;
                              RGBWnm[2] = 0;}                                        
                                                                      
          else if (nm >= 380 && nm < 440) {RGBWnm[0] = ((-(nm - 440.) / (440. - 380.))*255);
                                           RGBWnm[1] = 0;
                                           RGBWnm[2] = 255;}
                                             
          else if (nm >= 440 && nm < 490) {RGBWnm[0] = 0;
                                           RGBWnm[1] = (( (nm - 440.) / (490. - 440.))*255);
                                           RGBWnm[2] = 255;}
                                             
          else if (nm >= 490 && nm < 510) {RGBWnm[0] = 0;
                                           RGBWnm[1] = 255;
                                           RGBWnm[2] = ((-(nm - 510.) / (510. - 490.))*255); }   
                                                                           
          else if (nm >= 510 && nm < 580) {RGBWnm[0] = (( (nm - 510.) / (580. - 510.))*255);
                                           RGBWnm[1] = 255;
                                           RGBWnm[2] = 0;}                                        
          else if (nm >= 580 && nm < 645) {RGBWnm[0] = 255;
                                           RGBWnm[1] = ((-(nm - 645.) / (645. - 580.))*255);
                                           RGBWnm[2] = 0;}    
                                             
          else if (nm >= 645 && nm < 780) {RGBWnm[0] = 255;
                                           RGBWnm[1] = 0;
                                           RGBWnm[2] = 0;}   
            }
    }

     

    4. Sending DMX Values

    when we have the RGB-Values we send it via DMX to a RGB-LED, by adapting this code:

    http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Fexamples%2Fdmx%2F

    & studying this code:

    http://svnmios.midibox.org/filedetails.php?repname=svn.mios32&path=%2Ftrunk%2Fmodules%2Fdmx%2Fdmx.c

     

    void APP_Background(void){ 
    //DMX:
      // endless loop
      while(1) { for (count=0;count<4;count++)
                 { if (RGBWdmx[count]!=RGBWenc[count]) //if something has changed - send the value via DMX!
                   {   RGBWdmx[count]=RGBWenc[count];
                       DMX_SetChannel(count,(u8)RGBWdmx[count]);}
    		     }
               }
    }

    that was not the complicated thing... the complicatect comes now!

  17. hmmm... the timer or the shiftregister update are not working as i want... i want a stable blink...instead, it sometimes some blinks dont accour... it looks like the counter overlaps with the shiftregister update or so...maybe it is a priority question --- any idea?

    here is the code: (attached is also the full project - it runs on a lp17 core with dio-shiftregisters connected-dout register 1 pin 0 is the blink-output... the din register 1 pin 0+1 = hz-encoder.... the used display is 2x40 signs...)

    #include <mios32.h>
    #include <FreeRTOS.h>
    #include <task.h>
    #include "tasks.h"
    #include "file.h"
    #include "app.h"
    #include <portmacro.h>
    #include <queue.h>
    #include <semphr.h>
    #include <string.h>
    #include "mios32_timer.h"
    
    #define NUM_ENCODERS 9 //5 Menue Encoders are connectet
    const mios32_enc_config_t encoders[NUM_ENCODERS] = {//(SR begin with 1, ENC with 0) // setup the Pinout of that Encoders
    	{ .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=1, .cfg.pos=0 },		//Menue Encoder 0 	- only virtual, since they are mapped to differnt Variables... 
    	{ .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=1, .cfg.pos=2 },		//Menue Encoder 1	- ...if "Menue Page Encoder" has changed
    	{ .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=1, .cfg.pos=4 },		//Menue Encoder 2
    	{ .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=1, .cfg.pos=6 },		//Menue Encoder 3
    	{ .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=2, .cfg.pos=0 },		//Menue Encoder 4 
    	{ .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=2, .cfg.pos=2 },		//Menue Encoder 5
    	{ .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=2, .cfg.pos=4 },		//Menue Encoder 6
    	{ .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=2, .cfg.pos=6 },		//Menue Encoder 7	
    	{ .cfg.type=DETENTED2, .cfg.speed=FAST, .cfg.speed_par=4, .cfg.sr=3, .cfg.pos=0 },};	//Menue Page Encoder
    xSemaphoreHandle xLCDSemaphore;		// take and give access to LCD
    
        u32 MenueUpdateCount = 0;
        u32 value = 0; //Encoder calculation...
        u32 i = 0; //Encoder calcualtion
    
    //WKS
      u32 hz = 428;
      u32 nm = 10;
      u32 rpm = 25680;
      u32 time = 2161; //setup timer time
      u32 timecount = 0;
      u32 hzcount = 0;
      u32 decaytime = 128;
        
    //Task Prioritys	
    #define MUTEX_LCD_TAKE { while( xSemaphoreTakeRecursive(xLCDSemaphore, (portTickType)0) != pdTRUE ); }  //a Mutex reserve a Resoure (LCD or SD-Card) for a task, until it is given away...
    #define MUTEX_LCD_GIVE { xSemaphoreGiveRecursive(xLCDSemaphore); }
    #define PRIORITY_StoreLoad                        ( tskIDLE_PRIORITY + 2 ) //3:Mios standart
    
    static void StoreLoad(u8 tick, u16 order);		
    static void Timer(void);
    
    void APP_Init(void){
    	MIOS32_BOARD_LED_Init(0xffffffff);                                  //initialize all LEDs
    	xLCDSemaphore 		= xSemaphoreCreateRecursiveMutex();	            //create Mutex for LCD access																									//initialize encoders   i = counter
    	for(i=0; i<NUM_ENCODERS; ++i) MIOS32_ENC_ConfigSet(i, encoders[i]); //initialize encoders
        MIOS32_TIMER_Init(1, 1, Timer, MIOS32_IRQ_PRIO_HIGH);               //1uS Timer set
         
    MIOS32_SRIO_ScanNumSet(1); // limit the number of DIN/DOUT SRs which will be scanned for faster scan rate
    
    //speed up SPI transfer rate (was MIOS32_SPI_PRESCALER_128, initialized by MIOS32_SRIO_Init())
    MIOS32_SPI_TransferModeInit(MIOS32_SRIO_SPI, MIOS32_SPI_MODE_CLK1_PHASE1, MIOS32_SPI_PRESCALER_64);
      // prescaler 64 results into a transfer rate of 1 uS per bit
      // when 2 SRs are transfered, we are able to scan the whole 16x8 matrix in 300 uS
    }
    
    void Timer(){
    timecount = timecount + 1;
    if (timecount > time) {MIOS32_DOUT_PinSet( 0, 1); timecount = 0;}
    if (timecount > decaytime) {MIOS32_DOUT_PinSet( 0, 0);}}
     
    void APP_Background(void){}
    
    void APP_Tick(void) {  //1ms Event Triggering
    MenueUpdateCount = MenueUpdateCount + 1; 
         if(MenueUpdateCount > 650){MenueUpdateCount = 0; StoreLoad(0, 0);}} //update the Menue
    
    void APP_MIDI_Tick(void){}
    void APP_MIDI_NotifyPackage(mios32_midi_port_t port, mios32_midi_package_t midi_package){}
    void APP_SRIO_ServicePrepare(void){}
    void APP_SRIO_ServiceFinish(void){}
    void APP_DIN_NotifyToggle(u32 pin, u32 pin_value){}
    void APP_ENC_NotifyChange(u32 encoder, s32 incrementer){
    	
    	if(encoder == 0){
    	value = hz + incrementer;                   // increment to virtual position and ensure that the value is in range 0..127
    	if(value < 0)   {value = 999;}
    	if(value > 999){value = 0;}
    	hz = value;
    
    	time = 1000000/hz; //we count in mikro Sekonds!
    	rpm = hz * 60;
    	}
    	
    	if(encoder == 2){
    	value =  time + incrementer;                   // increment to virtual position and ensure that the value is in range 0..127
    	if(value < 0)   {value = 3000;}
    	if(value > 3000){value = 0;}
    	time = value;
    	
    	hz = 1000000/time;
    	rpm = hz * 60;
    	}	
    	
    	if(encoder == 4){
    	value = rpm + incrementer;                   // increment to virtual position and ensure that the value is in range 0..127
    	if(value < 0)   {value = 100000;}
    	if(value > 100000){value = 0;}
    	rpm = value;
    	
    	hz = rpm / 60;
    	time = 1000000/hz;
    	}
    	
    	if(encoder == 7){
    	value = (incrementer * 2) + decaytime;                   // increment to virtual position and ensure that the value is in range 0..127
    	if(value < 0)   {value = 99999;}
    	if(value > 99999){value = 0;}
    	decaytime = value;
    	}
    }
    
    void APP_AIN_NotifyChange(u32 pin, u32 pin_value){ //AIN - - Potentiometer has mooved - - Analog InPut 
    }
    
    static void StoreLoad(u8 tick, u16 order){         //Display MENUE, Store+Load Bank & Sys-Config
        if(tick == 0){//Menue
             MUTEX_LCD_TAKE;        //request LCD access
                MIOS32_LCD_Clear(); //clear screen
              //1st Line = Encoder Variables....change something!
                MIOS32_LCD_CursorSet(0,  0);  MIOS32_LCD_PrintFormattedString("%d", hz);
                MIOS32_LCD_CursorSet(10,  0);  MIOS32_LCD_PrintFormattedString("%d", time);
                MIOS32_LCD_CursorSet(20, 0);  MIOS32_LCD_PrintFormattedString("%d", rpm);	
                MIOS32_LCD_CursorSet(35, 0);  MIOS32_LCD_PrintFormattedString("%d", decaytime);
              //2nd Line = Menue Describtio
                MIOS32_LCD_CursorSet(0,  1);  MIOS32_LCD_PrintFormattedString("%s", "hz");
                MIOS32_LCD_CursorSet(10,  1);  MIOS32_LCD_PrintFormattedString("%s", "usec");            
                MIOS32_LCD_CursorSet(20, 1);  MIOS32_LCD_PrintFormattedString("%s", "rpm");           
                MIOS32_LCD_CursorSet(35, 1);  MIOS32_LCD_PrintFormattedString("%s", "decay");            
              MUTEX_LCD_GIVE;}}					// release LCD access for other tasks     
    

     

    RPM_BLINK.zip

×
×
  • Create New...