Tabula Posted April 18, 2023 Share Posted April 18, 2023 Hello, I would like to convert Midi note to midi CC, my volca drums can play melody if we trig the CC pitch of the drums parts. If anyone knows how to make a script for that, It will be very useful ! So to be clear, something like that, for example : C1 > CC30 C#1 >CC31 D1>CC32 D#1>CC33 etc.... Thanks ! Quote Link to comment Share on other sites More sharing options...
Jordi Torres Posted April 18, 2023 Share Posted April 18, 2023 Hi Tabula, It fairly easy to convert Notes to CCs but as MIDI notes usually come as a pair of Note On and Note Off you need to be specific about how you want to deal with that. In other words, would you take into account both Note On and Note Off for the conversion to CC or just one of them (On or Off)? Then there's the velocities. Would you use those values "as is" for the resulting CCs? For example: C1 with velocity 90 should result in CC30 with a value of 90? J. 1 Quote Link to comment Share on other sites More sharing options...
Tabula Posted April 18, 2023 Author Share Posted April 18, 2023 (edited) thanks for your answer! I just realized that I made a mistake. I always want to make different note to one midi cc, but rather like this: C1 > CC30 value 20 note on/off short sustain C#1 >CC30 value 25 D1>CC30 value 30 D#1>CC30 value 35 etc.. I don't need to manage sustain, volca drum doesn't manage it, I just need to impulse a midi CC value I hope I make myself understood Edited April 18, 2023 by Tabula Quote Link to comment Share on other sites More sharing options...
Jordi Torres Posted April 18, 2023 Share Posted April 18, 2023 (edited) Hi Tabula, Thanks for clarifying. Here's a version (no GUI, just code). I added plenty of comments so it should be clear what's going on: // Create Control Change object const cc = new ControlChange(); // Return true if event is a specific Note On function incomingNote(event, note) { return event instanceof NoteOn && event.pitch === MIDI.noteNumber(note); } // Send a CC of choice function outgoingCC(num, val) { cc.number = num; cc.value = val; cc.send(); } function HandleMIDI(e) { // Take incoming C1 Note On if (incomingNote(e, 'C1')) { // Output CC30 value 20 outgoingCC(30, 20); // Take incoming C#1 Note On } else if (incomingNote(e, 'C#1')) { // Output CC30 value 25 outgoingCC(30, 25); } else if (incomingNote(e, 'D1')) { outgoingCC(30, 30); } else if (incomingNote(e, 'D#1')) { outgoingCC(30, 35); } else { // Let non-matching events pass through e.send(); } } J. Edited April 18, 2023 by Jordi Torres 1 Quote Link to comment Share on other sites More sharing options...
Tabula Posted April 19, 2023 Author Share Posted April 19, 2023 Thanks ! i will test it today, and I’ll tell you if it works like i desire ! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.