Jump to content

Hans Smedsrud

Members
  • Posts

    3
  • Joined

  • Last visited

Reputation

0 Neutral

About Hans Smedsrud

  • Birthday June 25

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi. Well, yes you guys are right, I wanted to double the MIDI note lenghts and slide them accordingly, to stretch out the MIDI part. The MIDI part is a Grieg piece I recorded a few years ago, but it's too fast for the audio I recorded recently. The Grieg piece is in the original 2/4 Time Signature, my audio is a Guitar Solo in 4/4 (Rock beat). I know I could of course re-record the MIDI part, or change the note one by one in the Piano Roll, but I was looking for an easier solution. I did not know about the "Lenght" feature in Cakewalk, but it seem to work, when set to approx 200% (to fit my Audio). Funny, because I googled this subject a lot, before I attempted to write a CAL script. I did find lots of people wanting to do the same as me, but there were no solutions presented. Thank you both 🙂🙏 Thanks. I knew about this solution, but I thought it was not precise enough, and that it's very easy to mess it up by dragging it too short or too far. Hence I wanted some exact way to do it, to align the MIDI track perfectly to the measure/beats. Thanks. I have not tested your script yet. But I will do it soon 😀
  2. ;REM "DOUBLE TROUBLE", a CAL script by Hans Smedsrud (do (dword dOffsett 0) ;Offset, starts at 0 (dword nTime 0) ;Timing (int ChanA Event.Chan); (int ChanB 2) ; New track (int NoteK 60) ;C4 Note KEY (int NoteL 0) ;Note length/duration (int i 0); Counter ) (do (if (&& (== Event.Kind NOTE) (> Note.Dur 0)) (do ;REM Save current data (= NoteK Note.Key) (= nTime Event.Time) (= NoteL Note.Dur) ;REM Manipulate the data and save to new channel (= nTime (+ Event.Time dOffsett)) (= dOffsett (+ dOffsett NoteL)) ;REM Update the offset, who will affect the next NOTE (= NoteL (* NoteL 2)) ;REM Double the note duration (message " Currently processing: Event: " i " ->" (meas nTime) ":" (beat nTime) ":" (tick nTime) " ") (insert nTime ChanB NOTE NoteK Note.Vel NoteL) (++ i) ) NIL ) ) NIL ---- Thanks for reply. Well, manual? Got something written by Glen Cardenas, but probably not the official Cakewalk CAL script manual. And it would of course be nice to write a working CAL script and learn a new dialect/language in the process. Any idea what's wrong with my script?
  3. Dear experts I have been struggling for a few days trying to write a CAL script. The script is supposed to double note duration and slide them to the right, so they don't all end up in a pile on top of each others. Because I am new to CAL/LISP, I don't know what it can do, or it's limitations. I have written some PSEUDO code, to explain what I want the script to do, please have a look. PSEUDO CODE ;REM Variables (Never mind the misspelling, it's like that to not conflict with CAL constants and such) dword dOffsett=0 ;REM Timing dword nTime = 0 ;REM Current Track integer ChanA = Event.Chan ;REM New track/chan integer ChanB = 2 ;Default, may be altered by User input later ;REM Note key integer NoteK = 60 ;Note C4 ;REM Note length/ duration integer NoteL = 0 ;REM counter integer i = 1 FOR EACH EVENT IN SELECTED CHANNEL IF ((Event.Kind == NOTE) && (Note.Dur > 0)) THEN [ ;REM Save current data LET NoteK = Note.Key LET nTime = Event.Time LET NoteL = Note.Dur ECHO " Currently processing: Event " i " ->" (meas nTime) ":" (beat nTime) ":" (tick nTime) " ;REM Manipulate the data (and save to new channel) LET nTime = (Event.Time + dOffsett) ;REM Let us slide the new note by current offset LET dOffsett = (dOffsett + NoteL) ;REM Update the offset, who will affect the next NOTE LET NoteL = (NoteL * 2) ;REM Double the note duration ;REM Save the new data to the new channel WRITE nTime ChanB NOTE NoteK Note.Vel NoteL ;REM Which According to CAL Reference guide, should be this: (insert nTime ChanB NOTE NoteK Note.Vel NoteL) ;REM BUT THE LINE ABOVE DOES NOT WORK, IT STORES THE "NEW" DATA IN THE SELECTED / ACTIVE CHANNEL, WHY? i++ } ELSE { Do nothing! } END IF NEXT --- Please remember that this is PSEUDO code, and just a subjective mix of different languages. But I think that a CAL / LISP expert should be able to get the grasp of it. I hope someone are able to help me solve this problem. Thanks in advance 🙂
×
×
  • Create New...