sjoens Posted January 18 Share Posted January 18 Is there one to alternate every other note by the same value? i.e. 100 - 120 - 100 - 120 - 100 - 120... Link to comment Share on other sites More sharing options...
Promidi Posted January 18 Share Posted January 18 38 minutes ago, sjoens said: Is there one to alternate every other note by the same value? i.e. 100 - 120 - 100 - 120 - 100 - 120... No, but I am sure one could be written. 1 Link to comment Share on other sites More sharing options...
Promidi Posted January 18 Share Posted January 18 Quickly came up with this script This script asks for the alternative value, then sets all alternative notes to that alternative value, leaves the rest alone. (do (int count 0) (int Alt_velocity 100) (getInt Alt_velocity "Please enter velocity for every alternative note" 1 127) (forEachEvent (if (== Event.Kind NOTE) (do (if (== (% count 2) 0) (= Note.Vel Alt_velocity)) (++ count)))) );end do Link to comment Share on other sites More sharing options...
sjoens Posted January 18 Author Share Posted January 18 Hey thanks Promidi, will check it out. Link to comment Share on other sites More sharing options...
Promidi Posted January 18 Share Posted January 18 Your question should not be “Is there a CAL script that..........”, but rather, “Can a CAL script be written that..........” 1 Link to comment Share on other sites More sharing options...
Glenn Stanton Posted January 18 Share Posted January 18 Just now, Promidi said: Your question should not be “Is there a CAL script that..........”, but rather, “Can a CAL script be written that..........” hey! can you write a CAL script which removes HiHat note which is parallel to a Snare note to help thin down the drum MIDI ? Link to comment Share on other sites More sharing options...
David Baay Posted January 18 Share Posted January 18 1 hour ago, Promidi said: Your question should not be “Is there a CAL script that..........”, but rather, “Can a CAL script be written that... Or maybe "Can this be done without a CAL script?" If the notes can't be easily be differentiated by note number, you might be able to use Select By Filter to pick out every other note based on Beat/Tick values. Or you could make a short Groove Clip consisting of just 2 or 4 of the events and roll it out as needed. Link to comment Share on other sites More sharing options...
sjoens Posted January 18 Author Share Posted January 18 1 hour ago, Promidi said: Your question should not be “Is there a CAL script that..........”, but rather, “Can a CAL script be written that..........” I was sure one could be written but wanted to know if one already existed. If not, I would have asked how to make one, tho I have no clue how to read/write CAL. Also seems like one of the MFX should do this but apparently not. FWIW, I have a huge collection of CAL from Mudgel and others, but some don't work right or at all. Link to comment Share on other sites More sharing options...
sjoens Posted January 18 Author Share Posted January 18 2 minutes ago, David Baay said: Or you could make a short Groove Clip consisting of just 2 or 4 of the events and roll it out as needed. This was my next option but a CAL script would be easier after the fact. Link to comment Share on other sites More sharing options...
Promidi Posted January 18 Share Posted January 18 1 hour ago, Glenn Stanton said: hey! can you write a CAL script which removes HiHat note which is parallel to a Snare note to help thin down the drum MIDI ? This is one I came up with at such short notice. To use this, select the notes, so that the hi hats are the highest notes selected are the snares are the lowest selected is the snares It should delete any hihats that are within 50 ticks of a snare. No warranties (do (int min_val 127) (int max_val) (int current_note_count) (int Previous_note_count) (long Snare_time) (long time_diff) (forEachEvent (if (== Event.Kind NOTE) (do (if (<= Note.Key min_val) (= min_val Note.Key)) (if (>= Note.Key max_val) (= max_val Note.Key)) );end do );end if );end for (forEachEvent (if (== Event.Kind NOTE) (do (if (== Note.Key min_val) (= Snare_time Event.Time)) (if (== Note.Key max_val) (do (= time_diff (- Event.Time Snare_time)) (if (&& (< time_diff 50) (> time_diff -50)) (delete)) );end do );end if );end do );end if );end for );end do Link to comment Share on other sites More sharing options...
Promidi Posted January 18 Share Posted January 18 7 minutes ago, sjoens said: FWIW, I have a huge collection of CAL from Mudgel and others, but some don't work right or at all. That might be down to the differences in the way CAL commands are processed between CPA9 and CbB For instance, issue EditCut40 EditCopy40 or EditPaste40 commands without paramters in CPA9 bring up a dialogue box. In CbB, the command just executes. Also the EditSlide40 command will categorically crash CbB. Any CAL scripts I have written, I make sure work in CbB. Link to comment Share on other sites More sharing options...
Promidi Posted January 18 Share Posted January 18 13 minutes ago, David Baay said: Or maybe "Can this be done without a CAL script?" If the notes can't be easily be differentiated by note number, you might be able to use Select By Filter to pick out every other note based on Beat/Tick values. Or you could make a short Groove Clip consisting of just 2 or 4 of the events and roll it out as needed. Yeah, that could work if the notes are different. However, if they are the same and/or the timing is all over the place, then it’s a CAL script. A CAL script that selected every other note could work - then set the velocity of selected notes to an arbitrary value. These are the sort of things I would like to see in the new Sonar as native functions rather than having users messing around with CAL scripts. Link to comment Share on other sites More sharing options...
David Baay Posted January 18 Share Posted January 18 (edited) 14 minutes ago, Promidi said: Yeah, that could work if the notes are different. However, if they are the same and/or the timing is all over the place, then it’s a CAL script. Dollars to donuts, anyone trying to alternate velocities between two values is starting with a string of notes all at the same velocity that are exactly on the grid. ;^) And even if there's some variation, Select By Filter can usually be made to accomodate that though it might be necessary to make a second selection. 14 minutes ago, Promidi said: These are the sort of things I would like to see in the new Sonar as native functions rather than having users messing around with CAL scripts. I strongly agree Sonar should have a library of basic MIDI selection/transformation rules with user-specifiied parameters to facilitate basic operations like this. And, related to this, that all the existing CAL scripts should be converted to native functions as has been frequently suggested in the past. Edited January 18 by David Baay 1 Link to comment Share on other sites More sharing options...
sjoens Posted January 18 Author Share Posted January 18 (edited) 14 hours ago, Promidi said: (do (int count 0) (int Alt_velocity 100) (getInt Alt_velocity "Please enter velocity for every alternative note" 1 127) (forEachEvent (if (== Event.Kind NOTE) (do (if (== (% count 2) 0) (= Note.Vel Alt_velocity)) (++ count)))) );end do This works for single non-stacked notes but not when notes are stacked vertically at the same time stamp. What I get: c3 1-120 2-120 3-120 4-120 b2 1-100 2-100 3-100 4-100 What I want: c3 1-120 2-100 3-120 4-100 b2 1-120 2-100 3-120 4-100 What line can I add to affect this outcome? Or will I need to process the lines separately? Edited January 18 by sjoens Link to comment Share on other sites More sharing options...
Promidi Posted January 18 Share Posted January 18 14 minutes ago, sjoens said: This works for single non-stacked notes but not when notes are stacked vertically at the same time stamp. What I get: c3 1-120 2-120 3-120 4-120 b2 1-100 2-100 3-100 4-100 What I want: c3 1-120 2-100 3-120 4-100 b2 1-120 2-100 3-120 4-100 What line can I add to effect this outcome? Or will I need to process the lines separately? Separately.... 1 1 Link to comment Share on other sites More sharing options...
Glenn Stanton Posted January 19 Share Posted January 19 thanks for the script! ? i was being snarky though... i'll definitely try it out Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now