alexiszbik / midiLoop

A nice MIDI looper made with Arduino
47 stars 6 forks source link

Midi Velocity #4

Open Wladimir25 opened 6 months ago

Wladimir25 commented 6 months ago

Hi Alex,

What has to be changed in your code to record the incoming midi velocity values together with the midi notes?

Thanks in advance

Andreas

alexiszbik commented 6 months ago

Hello Wladimir,

What could be done : In Track.h there is a member called sequence which is an array of byte. This member stores every note. A byte > 0 is a note, and when byte is equal 0, there is no note. You will have to create a struct with two members : a byte for the pitch, and one for the velocity. Then you replace the byte array by an array of this struct. You will have to replace any call to sequence[index] by sequence[index].pitch & store/read the velocity into sequence[index].velocity.

You'll have to be careful, the RAM usage will be multiplied by 2 ... Maybe on some Arduino you will lack of memory. A warning will be triggered by the Arduino IDE then. I don't remember well the current code usage. But you could get rid of this by reducing the max bar count from 8 to 4.

I hope it will help you. The code is a bit dirty, I am currently working on a v2 which will be I hope, easier to adapt.

Alex

Le lun. 12 févr. 2024 à 12:00, Wladimir25 @.***> a écrit :

Hi Alex,

What has to changed in your code to record the incoming midi velocity values together with the midi notes?

Thanks in advance

Andreas

— Reply to this email directly, view it on GitHub https://github.com/alexiszbik/midiLoop/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABH3EWJNQKNJJJ3DLMTTF3LYTHY5DAVCNFSM6AAAAABDEQSYOWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEZDSOBYHA4DEMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Alexis ZBIK @.*** +33 (0) 6 37 54 34 26

Wladimir25 commented 6 months ago

Thank you very much! I will give it a try

Wladimir25 commented 6 months ago

Hi Alex, It works well! Thank you very much for this great Looper! Regards, Andreas

alexiszbik commented 6 months ago

Awesome !