Jump to content

Modify the velocity of all notes of a DIn module with MIDI128 with a I2c sensor


zaordsword
 Share

Recommended Posts

  • 2 weeks later...

Hi latigid !

Thanks for your answear :)

>>have you written a driver for it to be used with MIOS?


No, I don't know how to wrote the driver working with MIOS, but I have a script for making it working with arduino and python.
Do you have examples of drivers ? I have see nothing about this topic anywhere on ucapp or on wiki or documentation and forum ...

The bmp280 is a pressure / temperature and humidity sensor manufactured by boch. I join the datasheet, my python and a arduino script. (c ++)

Edit: I had upload server -200 error when I try to up the datasheet . It's a project exemple availble here. The datasheet is on le page or  datasheet



 >>How would you expect the velocity values to be modified?
The sensor give the barometric pressure . I plan to save the atmospheric pressure at initialization as P0 and find the realtime surpressure like P_surpess= ( Press_sensor(t) - P0) 

Then I would like to map a certain variation of pressure matching with the velocity from 0 ... 127

>>Have you looked into the MBIO code?

What is MBIO code ? If you talk about the code on github there is a lot of file and I don't know where to find the file where to modify or to put a driver.
I did not find documentation of a list of the reference classes / function. 

BMP280.cpp BMP280.h measurment.txt

bme280.py

Edited by zaordsword
Link to comment
Share on other sites

13 hours ago, zaordsword said:

Hi latigid !

Thanks for your answear :)

>>have you written a driver for it to be used with MIOS?


No, I don't know how to wrote the driver working with MIOS, but I have a script for making it working with arduino and python.
Do you have examples of drivers ? I have see nothing about this topic anywhere on ucapp or on wiki or documentation and forum ...

As far as I know, there are no I2C peripherals that were coded into MIOS32. The closest thing that I am familiar with is the I2C MIDI modules, that according to TK. were not trivial to code for, and at that on very low-performance 16F PIC chips.

All the MBHP framework gives you is a hardware port on the MCU. You could consider to compare your arduino sketch with a device running off an STM32F4 chip or similar.

Alternatively, you might find more code examples of SPI devices. Maybe you can try to code a driver for a similar sensor with an SPI interface?

 

13 hours ago, zaordsword said:

The bmp280 is a pressure / temperature and humidity sensor manufactured by boch. I join the datasheet, my python and a arduino script. (c ++)

Edit: I had upload server -200 error when I try to up the datasheet . It's a project exemple availble here. The datasheet is on le page or  datasheet



 >>How would you expect the velocity values to be modified?
The sensor give the barometric pressure . I plan to save the atmospheric pressure at initialization as P0 and find the realtime surpressure like P_surpess= ( Press_sensor(t) - P0) 

Then I would like to map a certain variation of pressure matching with the velocity from 0 ... 127

>>Have you looked into the MBIO code?

What is MBIO code ? If you talk about the code on github there is a lot of file and I don't know where to find the file where to modify or to put a driver.
I did not find documentation of a list of the reference classes / function. 

The uCapps project is here:
http://ucapps.de/midio128.html -- it is more targeted towards general users who would like to use the project without writing code for it.

The git project is here:
https://github.com/midibox/mios32/tree/master/apps/controllers/midio128_v3

You would need to modify the code to suit your needs. Note that the code is written in C, not python.

You can find the documented functions and some examples here:
http://www.midibox.org/mios32/manual
http://ucapps.de/mios32_c.html
 

Best of luck to you if you decide to follow this journey. Others will probably not write the software for you, but if you post your modifications and explain where you are having difficulty, some might be able to help.

Link to comment
Share on other sites

Hi,
 

On 2/13/2021 at 8:41 AM, latigid on said:

Maybe you can try to code a driver for a similar sensor with an SPI interface?

The bmp280 is also working with SPI interface !
Do you think it could be more easy do use this kind of interface ?
Do you have exemple of coded drivers working with SPI interface working with MIOS32 that could be closer than wroting a driver in I2C interface ?

Thanks by advance !

 

Link to comment
Share on other sites

https://github.com/midibox/mios32/blob/master/mios32/STM32F4xx/mios32_ain.c
https://github.com/midibox/mios32/blob/master/modules/ainser/ainser.c

https://github.com/midibox/mios32/tree/master/modules/aout

Basic drivers/assignments:
https://github.com/midibox/mios32/blob/master/mios32/STM32F4xx/mios32_spi.c
https://github.com/midibox/mios32/blob/master/mios32/STM32F4xx/mios32_iic.c

 

Maybe it would be easier for you to use the Arduino and output an analogue voltage to be read by the STM32F4 AIN? That way you can use your working system without much extra coding effort. MBIO supports AIN either on the MCU ports J5A/B or using the AINSER module (typically less noise on the signal).

Link to comment
Share on other sites

For SPI I have this question :

1) Should I create a special new file for my driver (for exemple bmp380.c ), or should I modify another file existing file in the MIDO128 project and add my code into ?

2) In which file should I need to declare my new SPi driver ? I had a look in MIOS-32spi.c /.h and it seems the declaration is on this file but I am not sure

3) Is there a IDE specially adapted for coding MIOS ? Eclispe ? Borland ? something even better ?

 

Quote

There is some module board which convert SPI to Analog, that could be a easy solution.

So 2 maybe more "easy" questions :

1 ) How can I calibrate my Ain threshold on MIDIO to say for exemple that a +0.4V correspon to 0 velocity and 4.5 correspond to 127 in velocity ?

2) How can I set that this realtime velocity given by the AInput is applied to all the MIDI event from the DIN module ?

Thanks a lot, I really hope that I could fond a solution


 

Link to comment
Share on other sites

  • 3 weeks later...
On 2/17/2021 at 6:52 PM, latigid on said:

Maybe it would be easier for you to use the Arduino and output an analogue voltage to be read by the STM32F4 AIN? That way you can use your working system without much extra coding effort. MBIO supports AIN either on the MCU ports J5A/B or using the AINSER module (typically less noise on the signal).

Do you have any idea to do that, I have worked a lot on it but still I don't know how to do that.

Thanks by advance for your helps

Link to comment
Share on other sites

Sorry, the extent to which I could help is already in the posts above. If you have more specific questions there might be others who are more into code modification. But at the moment it is hard to know what step you are on. It sounds to me like you are stuck right at the beginning, and I think it is rather up to you to learn how to modify the code to get what you want out of it.

Link to comment
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

Loading...
 Share

×
×
  • Create New...