zaibuyidao / ReaScripts

REAPER, ReaScripts, MIDI Editor
22 stars 5 forks source link

2 (probably last) asks and 1 question #5

Closed ARkaine2 closed 4 years ago

ARkaine2 commented 4 years ago

Scripts (for MIDI Editor), that I need, are:

All Selected Notes Length as First Selected Note As name says.

Random Notes Start Position on Grid

  1. It has to move all notes on grid of selected item.
  2. Without horizontal overlaping of notes' start.
  3. Notes, that are moved, shouldn't overlap with their starts, but can be overlapped with their ends.

Probably I'll need two versions of this script: For monophonic notes and polyphonic version 1. For polyphonic version 2.

Look, how it should act with:

Monophonic notes: dsadd

Polyphonic notes algorithm 1 (polyphonic notes that start at same time become/stay as "blocks" of notes, and these blocks of notes are moved by script): dsadd-vdvdsvsdv

Polyphonic notes algorithm 2 (notes are fully independient [but still without horizontal overlaping of notes' start]): vevsavev

(I moved notes by hand, so don't think that I already have theese scripts :D) If you know how to do and can do this, please do, I will be very appreciate.

...

Question about: MIDI Notes Random Key

-- USER AREA
-- Settings that the user can customize.

key_signature = "C" -- Use # : C C# D D#...
key_min = "C5"
key_max = "C6"

-- End of USER AREA

Can it be changed to another scale (for example to: c, db, e, f, g, a, b) or it is only diatonic? It's not necessarily (so I don't ask you about anything in this question), but only interes.

zaibuyidao commented 4 years ago
  1. All Selected Notes Length as First Selected Note:

zaibuyidao_All Selected Notes Length to First Selected.lua


  1. Random Notes Start Position on Grid

Random notes I have seen kawa's advanced script, he has done very well, maybe you can try his: http://kawa.works/reascripts

I have thought about implementing similar functions, but there are still some deficiencies in the logic. However, I also tried to write a script with random note positions:

zaibuyidao_Random Notes Position (Customize) .lua

At present, there are no restrictions on notes of the same pitch, so they cannot be used perfectly. Please try to avoid notes of the same pitch. If there is time, I will continue to improve this script.


  1. MIDI Notes Random Key

The scale script logic is more complicated, if you want to customize the scale, you can refer to here:

scales = {0,2,4,5,7,9,11} 
scales_map = {[0]=1,[2]=2,[4]=3,[5]=4,[7]=5,[9]=6,[11]=7}
scales_pos = {[0]=0,[1]=0,[2]=2,[3]=2,[4]=4,[5]=5,[6]=5,[7]=7,[8]=7,[9]=9,[10]=9,[11]=11}
tones_map = {["C"]=0, ["C#"]=1, ["D"]=2, ["D#"]=3, ["E"]=4, ["F"]=5, ["F#"]=6, ["G"]=7, ["G#"]=8, ["A"]=9, ["A#"]=10, ["B"]=11}

0-11 represents the piano key relationship, you need to adjust it according to different scales.

ARkaine2 commented 4 years ago

zaibuyidao_All Selected Notes Length to First Selected.lua

Thanks for script. ...

However, I also tried to write a script with random note positions: If there is time, I will continue to improve this script.

Thanks for taking this task. ...

Please try to avoid notes of the same pitch.

ATM when there are multiple notes of the same pitch they are simply disappear on using this script. But you probably know this. I hope that at least this thing can be fixed. ...

The scale script logic is more complicated, if you want to customize the scale, you can refer to here:

Thanks for advice.

I'm going to make:

zaibuyidao_Random Notes Key (Customize) - 0 - C.lua zaibuyidao_Random Notes Key (Customize) - 1 # - G.lua zaibuyidao_Random Notes Key (Customize) - 1 b - F.lua zaibuyidao_Random Notes Key (Customize) - 2 # - D.lua zaibuyidao_Random Notes Key (Customize) - 2 b - Bb.lua zaibuyidao_Random Notes Key (Customize) - 3 # - A.lua zaibuyidao_Random Notes Key (Customize) - 3 b - Eb.lua zaibuyidao_Random Notes Key (Customize) - 4 # - E.lua zaibuyidao_Random Notes Key (Customize) - 4 b - Ab.lua zaibuyidao_Random Notes Key (Customize) - 5 # - B.lua zaibuyidao_Random Notes Key (Customize) - 5 b - Db.lua zaibuyidao_Random Notes Key (Customize) - 6 #-b - F#-Gb.lua

For all diatonic scales (= modes and that would be nice). ;)