jsg
Max Output Level: -69 dBFS
- Total Posts : 1079
- Joined: 2003/11/20 04:54:18
- Location: San Francisco, California
- Status: offline
Randomizing Note Lengths in the Interpolate Dialogue Box
I thought I figured out how to do this, but now I can't get it to work. Does anybody use Interpolate to randomize, say, 4 quarter notes into 4 notes with slightly less and slightly more duration? The Length command is good for precise change relative to start time, but not for randomizing note lengths. Thanks, Jerry
|
promidi
Max Output Level: -66 dBFS
- Total Posts : 1220
- Joined: 2014/11/21 18:46:39
- Location: South Australia
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/21 03:32:54
(permalink)
Have you considered using a CAL script to do this? The following script will randomise the duration of selected notes away from their original to a maximum possible of 30 (defined by the (int range 30) )
(do (int offset) (int range 30) (int new_duration) (int pos_range range) (int neg_range (*= range -1)) (forEachEvent (if (== Event.Kind NOTE) (do (= offset (random neg_range pos_range)) (= new_duration Note.Dur) (+= new_duration offset) (if (<= new_duration 127) (if (>= new_duration 0) (= Note.Dur new_duration) );end if );end if );end do );end if );end for );end do
Windows 10 64bit fully patched, 16 gig ram . PCR-800 Controller. (Working in Win 10 1809 64bit)CPU: i5 4670. Video: Nvidia GTX560ti (latest drivers). Audio IF: Focusrite 2i2 2nd Gen Internet always on. Software: Cakewalk by Bandlab (2018.09 B29) ASIO mode. 24bit 48khz 256 samples Rapture Pro, AAS GS2, VS-3, EP-4, VA-2, Chromophone 2, Z3TA+ 2, Addictive drums 2, Addictive Keys, Mpowersynth (latest), Iris 2, GPO5, Sampletank 3,
|
Bristol_Jonesey
Max Output Level: 0 dBFS
- Total Posts : 16775
- Joined: 2007/10/08 15:41:17
- Location: Bristol, UK
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/21 03:45:09
(permalink)
Great solution there Paul!
CbB, Platinum, 64 bit throughoutCustom built i7 3930, 32Gb RAM, 2 x 1Tb Internal HDD, 1 x 1TB system SSD (Win 7), 1 x 500Gb system SSD (Win 10), 2 x 1Tb External HDD's, Dual boot Win 7 & Win 10 64 Bit, Saffire Pro 26, ISA One, Adam P11A,
|
jsg
Max Output Level: -69 dBFS
- Total Posts : 1079
- Joined: 2003/11/20 04:54:18
- Location: San Francisco, California
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/21 14:59:05
(permalink)
promidi Have you considered using a CAL script to do this? The following script will randomise the duration of selected notes away from their original to a maximum possible of 30 (defined by the (int range 30) )
(do (int offset) (int range 30) (int new_duration) (int pos_range range) (int neg_range (*= range -1)) (forEachEvent (if (== Event.Kind NOTE) (do (= offset (random neg_range pos_range)) (= new_duration Note.Dur) (+= new_duration offset) (if (<= new_duration 127) (if (>= new_duration 0) (= Note.Dur new_duration) );end if );end if );end do );end if );end for );end do
Hey, thanks! I am almost certain I can do this with the Interpolation routine, but if I can't I'll use the CAL code above. By the way, when I paste this into a .txt file, how do I turn it into a CAL file? Sonar won't read it as a CAL file if it has an extension of .txt.. UPDATE: I was able to turn the file into a .CAL file, and tried running it on some music. It didn't do anything at all, there was no dialogue box to ask me how much variation I want, nothing. I copied and pasted the exact code you gave... Best, Jerry www.jerrygerber.com
|
scook
Forum Host
- Total Posts : 24146
- Joined: 2005/07/27 13:43:57
- Location: TX
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/21 15:03:46
(permalink)
Change the extension to .cal
|
Atsuko
Max Output Level: -83 dBFS
- Total Posts : 365
- Joined: 2012/09/21 18:17:28
- Location: Rio de Janeiro, Brazil
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/21 15:08:22
(permalink)
Desktop Intel I7 12GB RAM Win 10 64bit - Focusrite Scarlett 18i8 2nd gen - Roland A-300 PRO - Yamaha HS50M speakers - Sonar Platinum/CbB - Samplitude Pro X3 - Studio One 4 - Melodyne 4 Studio - Ozone 8 Adv - Neutron 2 Adv - RX7 Adv - ARC2 // Notebook Dell I7 8GB RAM Win 10 64bit
|
berlymahn
Max Output Level: -85 dBFS
- Total Posts : 257
- Joined: 2007/11/28 08:48:13
- Location: Northern VA
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/21 15:50:47
(permalink)
|
SquireBum
Max Output Level: -84 dBFS
- Total Posts : 347
- Joined: 2013/06/26 13:23:55
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/22 00:00:40
(permalink)
☄ Helpfulby jsg 2017/02/22 02:39:06
Jerry, I took the liberty of modifying the script by @promidi by adding an input field in ticks and removed the line that was preventing the script from setting the new duration. I tested it, but please use it at your own risk. -- Ron ;;Randomize duration ;;This script will randomize MIDI note duration based on a user ;;provided range in ticks from 1 to 240 ticks. Checks are ;;provided to prevent zero durations. ;; ;; (do (int offset) (int range 30) ;; Change default input value here (getInt range "Select +/- range (ticks): " 1 240) (int new_duration) (int pos_range range) (int neg_range (*= range -1)) (forEachEvent (if (== Event.Kind NOTE) (do (= offset (random neg_range pos_range)) (= new_duration Note.Dur) (+= new_duration offset) (if (>= new_duration 0) ;; Make sure calculated duration is not zero (= Note.Dur new_duration) );end if );end do );end if );end for );end do
Cakewalk by Bandlab, Sonar Platinum x64 2017.10, X3E, X2a, X1d, 8.5 Windows 10 x64 AMD Phenom II X4 955 3.20 GHz 8 GB Ram Nvidia GeForce 9500 GT Echo Gina 3G
|
jsg
Max Output Level: -69 dBFS
- Total Posts : 1079
- Joined: 2003/11/20 04:54:18
- Location: San Francisco, California
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/22 02:40:32
(permalink)
SquireBum Jerry, I took the liberty of modifying the script by @promidi by adding an input field in ticks and removed the line that was preventing the script from setting the new duration. I tested it, but please use it at your own risk. -- Ron ;;Randomize duration ;;This script will randomize MIDI note duration based on a user ;;provided range in ticks from 1 to 240 ticks. Checks are ;;provided to prevent zero durations. ;; ;; (do (int offset) (int range 30) ;; Change default input value here (getInt range "Select +/- range (ticks): " 1 240) (int new_duration) (int pos_range range) (int neg_range (*= range -1)) (forEachEvent (if (== Event.Kind NOTE) (do (= offset (random neg_range pos_range)) (= new_duration Note.Dur) (+= new_duration offset) (if (>= new_duration 0) ;; Make sure calculated duration is not zero (= Note.Dur new_duration) );end if );end do );end if );end for );end do
Thanks very much SquireBum, much appreciated. I tested it and it does exactly what I was trying to do. Thanks for tweaking it! Best, Jerry www.jerrygerber.com
|
chuckebaby
Max Output Level: 0 dBFS
- Total Posts : 13146
- Joined: 2011/01/04 14:55:28
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/22 07:06:52
(permalink)
This is very interesting to me as I don't use CAL scripts. It seems they have a lot to offer. I don't use Midi all that much, maybe 20% of my project has midi, the rest being Audio (stringed instruments, drums, vocals, exc). However CAL scripts is something I would like to learn more about. some good reads here in this thread (Promidi, Ron and others) Interesting stuff. thanks.
Windows 8.1 X64 Sonar Platinum x64 Custom built: Asrock z97 1150 - Intel I7 4790k - 16GB corsair DDR3 1600 - PNY SSD 220GBFocusrite Saffire 18I8 - Mackie Control
|
jsg
Max Output Level: -69 dBFS
- Total Posts : 1079
- Joined: 2003/11/20 04:54:18
- Location: San Francisco, California
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/22 12:49:24
(permalink)
chuckebaby This is very interesting to me as I don't use CAL scripts. It seems they have a lot to offer. I don't use Midi all that much, maybe 20% of my project has midi, the rest being Audio (stringed instruments, drums, vocals, exc). However CAL scripts is something I would like to learn more about. some good reads here in this thread (Promidi, Ron and others) Interesting stuff. thanks.
I hired a software programmer a number of years ago to create a CAL program called Contrary Motion, it takes a group of notes and chromatically inverts them. Very useful for composition although I should have asked him to include diatonic contrary motion as well. If there are any CAL programmers who read this and can do this, contact me and we can work out compensation or barter. CAL routines are very useful and have been a part of Sonar for a very long time. I use them as they provide an extension to MIDI operations that add to Sonar's MIDI capabilities. Jerry www.jerrygerber.com
|
chuckebaby
Max Output Level: 0 dBFS
- Total Posts : 13146
- Joined: 2011/01/04 14:55:28
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/22 15:32:12
(permalink)
jsg
chuckebaby This is very interesting to me as I don't use CAL scripts. It seems they have a lot to offer. I don't use Midi all that much, maybe 20% of my project has midi, the rest being Audio (stringed instruments, drums, vocals, exc). However CAL scripts is something I would like to learn more about. some good reads here in this thread (Promidi, Ron and others) Interesting stuff. thanks.
I hired a software programmer a number of years ago to create a CAL program called Contrary Motion, it takes a group of notes and chromatically inverts them. Very useful for composition although I should have asked him to include diatonic contrary motion as well. If there are any CAL programmers who read this and can do this, contact me and we can work out compensation or barter. CAL routines are very useful and have been a part of Sonar for a very long time. I use them as they provide an extension to MIDI operations that add to Sonar's MIDI capabilities. Jerry www.jerrygerber.com
Last thing I want to do is derail your thread, but may I ask, where would be the best place to learn about CAL Scripts ? Im very interested as I believe they can speed up the portion of my Midi workflow. thanks Jerry
Windows 8.1 X64 Sonar Platinum x64 Custom built: Asrock z97 1150 - Intel I7 4790k - 16GB corsair DDR3 1600 - PNY SSD 220GBFocusrite Saffire 18I8 - Mackie Control
|
jsg
Max Output Level: -69 dBFS
- Total Posts : 1079
- Joined: 2003/11/20 04:54:18
- Location: San Francisco, California
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/22 15:48:54
(permalink)
chuckebaby
jsg
chuckebaby This is very interesting to me as I don't use CAL scripts. It seems they have a lot to offer. I don't use Midi all that much, maybe 20% of my project has midi, the rest being Audio (stringed instruments, drums, vocals, exc). However CAL scripts is something I would like to learn more about. some good reads here in this thread (Promidi, Ron and others) Interesting stuff. thanks.
I hired a software programmer a number of years ago to create a CAL program called Contrary Motion, it takes a group of notes and chromatically inverts them. Very useful for composition although I should have asked him to include diatonic contrary motion as well. If there are any CAL programmers who read this and can do this, contact me and we can work out compensation or barter. CAL routines are very useful and have been a part of Sonar for a very long time. I use them as they provide an extension to MIDI operations that add to Sonar's MIDI capabilities. Jerry www.jerrygerber.com
Last thing I want to do is derail your thread, but may I ask, where would be the best place to learn about CAL Scripts ? Im very interested as I believe they can speed up the portion of my Midi workflow. thanks Jerry
There's probably info on Cakewalk's website about CAL. I don't know how to program, so can't help there, but I can tell you as a composer some of the CAL routines come in handy, such as strum, randomizing note lengths, velocities and start times. Many others. Check them out, input 5 or 6 notes and experiment, that's the best way to learn what they do. Jerry
|
promidi
Max Output Level: -66 dBFS
- Total Posts : 1220
- Joined: 2014/11/21 18:46:39
- Location: South Australia
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/22 16:01:07
(permalink)
☄ Helpfulby chuckebaby 2017/02/22 20:12:15
Windows 10 64bit fully patched, 16 gig ram . PCR-800 Controller. (Working in Win 10 1809 64bit)CPU: i5 4670. Video: Nvidia GTX560ti (latest drivers). Audio IF: Focusrite 2i2 2nd Gen Internet always on. Software: Cakewalk by Bandlab (2018.09 B29) ASIO mode. 24bit 48khz 256 samples Rapture Pro, AAS GS2, VS-3, EP-4, VA-2, Chromophone 2, Z3TA+ 2, Addictive drums 2, Addictive Keys, Mpowersynth (latest), Iris 2, GPO5, Sampletank 3,
|
chuckebaby
Max Output Level: 0 dBFS
- Total Posts : 13146
- Joined: 2011/01/04 14:55:28
- Status: offline
Re: Randomizing Note Lengths in the Interpolate Dialogue Box
2017/02/22 20:12:04
(permalink)
promidi Here is a link that contains an excellent PDF CAL programmer's reference guide. The site contains other useful information as well.
http://members.ziggo.nl/odw/en/indexmidi.html
This I a keeper. Just bookmarked it and im reading it right now. I can tell this is going to be a long road . but Jerry had some good advise. Just adding in some notes and experimenting. I believe I have been to this site before studying instrument definitions. Thank you Mr. Promidi. Im very grateful for the link.
Windows 8.1 X64 Sonar Platinum x64 Custom built: Asrock z97 1150 - Intel I7 4790k - 16GB corsair DDR3 1600 - PNY SSD 220GBFocusrite Saffire 18I8 - Mackie Control
|