gianluca.cello Posted November 17, 2020 Share Posted November 17, 2020 Hi, i need a script that makes me play only some notes on the keyboard, all the rest must be disabled or mute. Basically I would like them to play only G2, A2, B2 and C4, D4, E4. Would that be possible or not? Sorry but I'm not a programmer, if anyone can help me I would be very grateful. Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted November 17, 2020 Share Posted November 17, 2020 Yes, that's definitely possible. Easy enough that I may be able to do it, although I'm sure some people here will do a cleaner coding job of it than I can. Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted November 17, 2020 Share Posted November 17, 2020 Here, try this: FilterNotes.pst.zip Quote Link to comment Share on other sites More sharing options...
gianluca.cello Posted November 17, 2020 Author Share Posted November 17, 2020 thank you very much David, it works great! If I want to change the active notes it would be enough for me to change the corresponding numbers in the script? Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted November 17, 2020 Share Posted November 17, 2020 thank you very much David, it works great!If I want to change the active notes it would be enough for me to change the corresponding numbers in the script? Yes exactly and if you need to include more notes just separate them with the | character. You're welcome! Glad to hear it works for you! Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted November 17, 2020 Share Posted November 17, 2020 ohh regular expressions... fancy! If you want to use pitch names then you can use the built in function to convert it to a number automatically. Wouldn't work with David's regular expression as is though... var pitch = MIDI.noteNumber("C3"); Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted November 17, 2020 Share Posted November 17, 2020 Nice, yours makes it easier to update. BTW for anyone who wants to see just the code here it is: function HandleMIDI(event) { if (event instanceof NoteOn) { if (/^(55|57|59|79|81|83)$/.exec(event.pitch)) { event.send(); } } else { event.send(); } } Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted November 17, 2020 Share Posted November 17, 2020 Here's one way with note names in an easy to change place var notes = ["C3", "E3", "G3"]; function HandleMIDI(event) { if(event instanceof Note) { if( notes.includes(MIDI.noteName(event.pitch))) { event.send(); } } else { event.send(); } } Quote Link to comment Share on other sites More sharing options...
Dan L Posted December 12, 2023 Share Posted December 12, 2023 Hi! I would like to be able to define two key ranges in scripter, where all notes should be played. (And all notes outsides these key ranges should be muted.) How should I do that? If anyone could help me with this I would be very greatful! Quote Link to comment Share on other sites More sharing options...
Solution David Nahmani Posted December 12, 2023 Solution Share Posted December 12, 2023 On 12/12/2023 at 1:04 PM, Dan L said: Hi! I would like to be able to define two key ranges in scripter, where all notes should be played. (And all notes outsides these key ranges should be muted.) How should I do that? I shared a script that does exactly that here: Quote Link to comment Share on other sites More sharing options...
Dan L Posted December 13, 2023 Share Posted December 13, 2023 17 hours ago, David Nahmani said: I shared a script that does exactly that here: Thank you very much! This was exactly what I was looking for! 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.