Old 09-22-2013, 10:43 AM   #41
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

Okay, if you don't mind: I'm going to work on the latest posted version and post a new version with some changes later today. So that we don't work on the same thing.
Sasje is offline   Reply With Quote
Old 09-22-2013, 11:42 AM   #42
reapertribal
Human being with feelings
 
reapertribal's Avatar
 
Join Date: Apr 2013
Location: Spain
Posts: 274
Default

Hi
Here in my mac does not work
Some mac user has managed to use it?
Thanks
Regards
reapertribal is offline   Reply With Quote
Old 09-22-2013, 03:17 PM   #43
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

New version of ReaChorder is attached. Please use this version when making new changes. It now also contains a changelog file to keep track what has been modified.

I hope Lazarus can check the enumeration issues? the enumeration on the chord V/C structure leads often to a SWS crash (0xc0000417). The longer the structure, the more time it takes to draw it and probably consumes too much CPU cycles? It needs to be more efficient. I think it is due to enumerating the V & C parts?

Tested for Python 3.3.

ReaChorder changelog.

9/22/2013 - Author: Sasje.
--------------------------------------------
+ chord structures: VV CC, VV CC VV.
+ more chord progressions: Catchy, Flamenco, Flamenco II, Love, Jazz, Sad II, Sad III, Sweet home, Wild side, Weep, Weep II
+ selectNote highlight for melody, it pre-selects the notes so it's easier to transpose them if needed.
+ a Chord attack menu.
+ extra notes in melody (chosen randomly)
+ the float line again: self.root.wm_attributes("-topmost", 1) so that it floats on top.
+ centering of the ReaChorder window.
--------------------------------------------
Critical issues:
--------------------------------------------
ReaChorder crashes Reaper due too many enumerations,
especially when the V/C sequence increases.
reaper_sws.dll will crash. CPU spikes to 25-30%
when structure increases.
Need Fix.
--------------------------------------------
Attached Files
File Type: zip ReaChorder.zip (40.6 KB, 70 views)

Last edited by Sasje; 09-23-2013 at 02:54 AM.
Sasje is offline   Reply With Quote
Old 09-22-2013, 06:38 PM   #44
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

Cool, the new melodies are getting better. I think maybe a Diva control to insert variable amounts of held notes or some other form of interactive logic would be good to alter the style at some point.

That's the hanging problem mostly fixed - it was actually just the sheer awe inspiring efficiency of my code not giving Reaps enough time to set and free takes.

I've moved the setting and freeing outside of the loops and it now draws 12 minutes of MIDI without problems. I need to do the same with the regions because that still crashes after a certain length when enabled.

Thinking of fwd0120's suggestions, as well as yours about the drums etc I think on a housekeeping front it would be wise to split the code up a bit more into seperate classes and files. Perhaps a tabbed interface (using tkinter's notebook) for different sections would be better too since we have already run out of space with the few options currently implemented.

If you want to have a look at my ReaSongBuilder script a few threads down from this one, I am going to implement those different song sections and relative lengths so that one click eventually writes a whole song based on more user defined input, rather than the more automated output at the moment. Perhaps you could think about what kind of automated generation you'd want to implement for the Middle 8 or Bridge for example?
Lazarus is offline   Reply With Quote
Old 09-22-2013, 10:00 PM   #45
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

Quote:
Originally Posted by Lazarus View Post
Cool, the new melodies are getting better. I think maybe a Diva control to insert variable amounts of held notes or some other form of interactive logic would be good to alter the style at some point.

That's the hanging problem mostly fixed - it was actually just the sheer awe inspiring efficiency of my code not giving Reaps enough time to set and free takes.

I've moved the setting and freeing outside of the loops and it now draws 12 minutes of MIDI without problems. I need to do the same with the regions because that still crashes after a certain length when enabled.

Thinking of fwd0120's suggestions, as well as yours about the drums etc I think on a housekeeping front it would be wise to split the code up a bit more into seperate classes and files. Perhaps a tabbed interface (using tkinter's notebook) for different sections would be better too since we have already run out of space with the few options currently implemented.

If you want to have a look at my ReaSongBuilder script a few threads down from this one, I am going to implement those different song sections and relative lengths so that one click eventually writes a whole song based on more user defined input, rather than the more automated output at the moment. Perhaps you could think about what kind of automated generation you'd want to implement for the Middle 8 or Bridge for example?

Yes I think we need to have more user input variables, so a tabbed window would be the best way to approach this. +1 on the notebook/tabs. Later on, I think it would be great to add a chord-picker in a newly tab. So that one can draw in chords manually? Would be a great learning tool as well.

+1 on fwd0120's idea: creating a custom field for custom chord progression.

I also think we need to lengthen the chord progressions? Now it only does a 4 chord trick. But in blues/jazz/classical, there are very lengthy progressions.
Sasje is offline   Reply With Quote
Old 09-22-2013, 10:42 PM   #46
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

Okay, here is a quick intermediate fix for the "hanging" i.e. crashing issue/bug. Looks pretty stable to me

ReaChorder changelog.

9/23/2013 - Author: Sasje.
--------------------------------------------
- freeing MIDI take in functions
+ freeing midi take outside loop
--------------------------------------------
Attached Files
File Type: zip ReaChorder.zip (40.7 KB, 55 views)

Last edited by Sasje; 09-23-2013 at 12:25 AM.
Sasje is offline   Reply With Quote
Old 09-23-2013, 01:14 AM   #47
knutteballa
Human being with feelings
 
Join Date: Mar 2011
Posts: 3
Default

Hi!

Not working here. There is no button to draw chords into midi take or clear button. (see attachment) No graphics. I have installed python 3.3 (32 bit) Reaper (32) 4.52, windows 8
Attached Images
File Type: jpg reachord.jpg (47.8 KB, 110 views)
knutteballa is offline   Reply With Quote
Old 09-23-2013, 02:40 AM   #48
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

Quote:
Originally Posted by knutteballa View Post
Hi!

Not working here. There is no button to draw chords into midi take or clear button. (see attachment) No graphics. I have installed python 3.3 (32 bit) Reaper (32) 4.52, windows 8

Looks pretty bad. Seems like the window is resized? probably due to your theme?

Can you try the attached version? I made some changes to the GUI's ttk.Frame. it makes the frame re-sizable and expands to fill the window. Maybe then the buttons will be visible. Would love to hear your feedback.

-
Attached Files
File Type: zip ReaChorder.zip (40.7 KB, 74 views)
Sasje is offline   Reply With Quote
Old 09-23-2013, 03:41 AM   #49
knutteballa
Human being with feelings
 
Join Date: Mar 2011
Posts: 3
Default

Still no buttons in the new version. My theme is default plus plus. Tried to switch to default theme, but no changes. Yes I had resized the window. Here is what it looks like when I not resize (attachment)
Attached Images
File Type: jpg reachord2.jpg (53.3 KB, 117 views)
knutteballa is offline   Reply With Quote
Old 09-23-2013, 05:21 AM   #50
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

It seems Win 8 is trying to force it's own widths/heights on the widgets. Could be a font issue as well. I thought it was correct though... can't discover any issues so far. I might try to combine both absolute and relative options. I'll try to read up on the Tkinter place geometry manager in a moment and install a Win 8 VM image to test it.
Sasje is offline   Reply With Quote
Old 09-23-2013, 06:57 AM   #51
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

I don't have time at the mo, but I think the issue might be that the child widgets are placed in the Frame, but the frame doesn't have explicit dimensions unless the background image is in it. So perhaps Win 8 window management doesn't automatically resize as gracefully as before.

To check, you'd need to in ReaChorder __init__....
Code:
 else:
            self.img = None
            self.bgLabel = ttk.Frame(self.root, borderwidth=5, relief="sunken", width=740,height=300)
            self.bgLabel.pack()
Lazarus is offline   Reply With Quote
Old 09-23-2013, 07:04 AM   #52
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

Cannot reproduce.

Just installed a clean Win 8 VM ISO image (with all updates), installed a Reaper evaluation, Python33, SWS on it and I don't get the layout errors.

See screenshot:


Last edited by Sasje; 09-23-2013 at 07:10 AM.
Sasje is offline   Reply With Quote
Old 09-23-2013, 09:40 AM   #53
knutteballa
Human being with feelings
 
Join Date: Mar 2011
Posts: 3
Default

Strange, can it be something with my python install? I`ve installed Python 32bit. Found python33.dll in c:/windows/SysWOW64, copied to PYTHON33 directory.

I`ve also tried to change font size and font type in the script, but nothing happens.

Looks like a cool script,so it would be nice to got it working! So can somebody please give me a advice to what to try next?
knutteballa is offline   Reply With Quote
Old 09-23-2013, 11:50 AM   #54
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

I dunno, I'll make that change I was talking about in the next version to see if that changes anything. It won't do any harm to redownload and install Python in the meantime.

@Sasje: I'll book it out at the moment if that's cool. I am in the process of....

- splitting up the section logic from ReaChord_Functions into seperate classes (and files)
- already moved all the MIDI funtions you made into a reusable class
- changing the GUI to a tabbed one

Need to at some point...
- change the ExtState storage and recall so that it can be managed per section, since later there will be different numbers and types of settings that need to be stored.
- I've already made a minor change to progression parsing so that it will go through an unlimited size of progression for verses. Will leave at that for now, cause a better think needs to be made of how this will work with choruses and other sections.

Re tabs, I am thinking the overall plan might be....

Wizard - current combos and text box and/or other requirements
Song Edit - can create from scratch or change what the Wizard made
Melody - all melody settings/tools/options
Chords - ""
Bass - ""
Drums - just output different notes per section atm for triggering Jamstix/BFD any old drum or sample triggering thingumibob.

Once it's all split up it will be easier to manage and add/remove stuff anyway.
Lazarus is offline   Reply With Quote
Old 09-23-2013, 12:44 PM   #55
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,286
Default

I guess this function should be added to "select all notes in MIDI-editor":

Code:
    def selAllNotes(self,command_id=40003, islistviewcommand=0):
        """ Select all notes"""
        RPR_MIDIEditor_LastFocused_OnCommand(command_id, islistviewcommand)
(self.selAllNotesTselection() selects all notes in time selection)

...and self.selAllNotesTselection() should be replaced with self.selAllNotes():
Code:
    def drawMidi(self,mood,inKey,scale,structure,chordattack,highlight,layout):
        self.msg('RC.drawMidi - Enter')
        p, bpm, bpi = RPR_GetProjectTimeSignature2(0, 0, 0)
        bps = 60/bpm
        barLength = bps * bpi
        self.beatsInBar = bpi
        self.msg("wtf")
##        self.selAllNotesTselection()
        self.selAllNotes()
edit. "MIDI ticks per quarter note" can be set from Preferences -> Media -> MIDI. It's probably better to use "SNM_GetIntConfigVar("miditicksperbeat", -1)" to get that value from reaper.ini:
Code:
        [70,73,76, 'A#dim'], #34 A#dim
        [71,74,77, 'Bdim' ]  #35 Bdim
    ]

    ############### end of static data ##################

    def __init__(self):
        #init stuff here
        self.rt = RegionToolbox()  #small class at end of this file

##        self.quartNoteLength = 960 #quarter note length in ticks
        # get "miditicksperbeat" from reaper.ini -> return -1 if failed
        # (set it from Preferences -> Media -> MIDI)
        self.quartNoteLength = int(SNM_GetIntConfigVar("miditicksperbeat", -1))


and these lines should be edited/added:

drawMidi()
Code:
##        randPos = [0,480,960]
        randPos = [0, int(self.quartNoteLength / 2), self.quartNoteLength]
drawMelody()
Code:
##        randPos = [0,480,960]
        randPos = [0, int(self.quartNoteLength / 2), self.quartNoteLength]
drawChords()
Code:
        self.msg('--- take allocated:' + str(midiTake))
##        AttackStep0 = 120
##        AttackStep1 = 240
##        AttackStep2 = 480
##        AttackStep3 = 960
        AttackStep0 = int(self.quartNoteLength / 8)
        AttackStep1 = int(self.quartNoteLength / 4)
        AttackStep2 = int(self.quartNoteLength / 2)
        AttackStep3 = self.quartNoteLength

Last edited by spk77; 09-23-2013 at 01:30 PM.
spk77 is offline   Reply With Quote
Old 09-23-2013, 01:38 PM   #56
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,286
Default

Quote:
Originally Posted by Lazarus View Post
@Sasje: I'll book it out at the moment if that's cool. I am in the process of....

- splitting up the section logic from ReaChord_Functions into seperate classes (and files)
- already moved all the MIDI funtions you made into a reusable class
- changing the GUI to a tabbed one
Very nice! Maybe I can finally learn how to use classes properly
spk77 is offline   Reply With Quote
Old 09-23-2013, 01:38 PM   #57
axel_ef
Human being with feelings
 
axel_ef's Avatar
 
Join Date: Jan 2007
Location: Erfurt
Posts: 596
Default

Quote:
Originally Posted by reapertribal View Post
Hi
Here in my mac does not work
Some mac user has managed to use it?
Thanks
Regards
I get this error message on 10.6.8 and Reaper 4.5 (32bit)


Script execution error

Traceback (most recent call last):
File "ReaChorder.py", line 1
import os
^
SyntaxError: invalid syntax
axel_ef is offline   Reply With Quote
Old 09-23-2013, 03:26 PM   #58
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

You can take that line out because nothing in os is used. I'm tidying everything up for the next version so that will be removed anyway.

@spk77: thanks very much for that, I'll incorporate that too.

re...
Quote:
Maybe I can finally learn how to use classes properly
... now the pressure is on - I promise at least improper use.
Lazarus is offline   Reply With Quote
Old 09-23-2013, 03:41 PM   #59
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

Would love to see a good class integration. I have a hard time with classes as well, especially on how to call (private) functions across different classes and scoping. I'm a Python newbie though... still a lot to learn.

-

Last edited by Sasje; 09-23-2013 at 03:54 PM.
Sasje is offline   Reply With Quote
Old 09-23-2013, 08:39 PM   #60
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

I'm currently working on a another Python file we can include later on. This file will focus on generating the melodies.

I've been thinking about using a Markov Chain to predict the next note in a melody.

Here the idea:

Here are our note pitches (0-11) starting on a middle C:
Code:
ChainPitch = [
[60],[61],[62],[63],[64],[65],[66],[67],[68],[69],[70],[71]
]
Then we use this chain below that contains popular melody steps (based on analysis on thousands of songs).
The top note line corresponds to the ChainPitch array (0-11) The numbers: 1 to 12 are the so called "weights",
1 being the strongest statistical note, and 12 the very least likely statistical note.
Then using a random integer we can produce a melody that is somewhat more consistent than it is now...

Code:
# popular melody progressions.
# C C# D D# E F F# G G# A A# B
#---------------------------------
MarkovChain = [
[1,11,2,9,3,7,10,5,12,6,8,4], #0  C
[3,4,1,5,2,6,7,8,9,10,11,12], #1  C#
[1,9,3,8,2,5,11,4,12,7,10,6], #2  D
[4,12,1,3,11,2,10,5,9,8,7,6], #3  D#
[5,10,1,12,2,4,7,3,11,6,9,8], #4  E
[7,12,4,8,1,3,11,2,10,5,9,6], #5  F
[7,12,5,11,4,6,2,1,10,3,9,8], #6  F#
[4,12,6,10,3,2,8,1,11,5,9,7], #7  G
[12,11,10,9,8,2,7,1,6,3,5,4], #8  G#
[5,12,6,11,7,4,9,1,10,2,8,3], #9  A
[4,12,6,10,5,7,11,2,9,3,1,8], #10 A#
[1,12,3,11,7,6,9,5,10,2,8,4]  #11 B
]
So when we generate a G note, we look up G which sits in: MarkovChain[7]
Looking in MarkovChain[7], the most likely note that comes next is another G. We do the lookup again in MarkovChain[7], and take the 2nd (F) or 3rd (A) chosen randomly.
And then we do another lookup on a F: MarkovChain[5] or A: MarkovChain[9], pick the most likely, and do it again. So for each note we generate, we do a statistical lookup.

Anyway, just an idea.

Last edited by Sasje; 09-23-2013 at 09:11 PM.
Sasje is offline   Reply With Quote
Old 09-24-2013, 06:44 AM   #61
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

I've transcribed 415 guitar chords today. I'm still lying sick in bed, so I have nothing else to do.

It would be useful to draw in chords for a guitar later on, because that requires a different layout then a piano chord.

The attached file contains an array with the chords and it's respective note pitches. We can use these pitch numbers -as usual- to draw in these notes.

It could be that I made a mistake in some weird chord, but getting the pitches for 415 chords isn't that easy. But I think I've done a fairly good job.

EDIT: some fixed notes.
-
Attached Files
File Type: txt 415chords.txt (11.8 KB, 86 views)

Last edited by Sasje; 09-25-2013 at 04:43 AM.
Sasje is offline   Reply With Quote
Old 09-24-2013, 10:52 AM   #62
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

Great work... it'll be great to see what everyone can get out of the Markov Chain!

Here's a wee screenshot of the progress....


It'll be another couple of days before I can release it... the wizard is operating out of its own class now, but it still needs to save the result for reuse in other sections and I want that method to be future proof... at least for the next couple of weeks. The other sections are getting there too.
Lazarus is offline   Reply With Quote
Old 09-24-2013, 12:15 PM   #63
reapertribal
Human being with feelings
 
reapertribal's Avatar
 
Join Date: Apr 2013
Location: Spain
Posts: 274
Default

Quote:
Originally Posted by axel_ef View Post
I get this error message on 10.6.8 and Reaper 4.5 (32bit)


Script execution error

Traceback (most recent call last):
File "ReaChorder.py", line 1
import os
^
SyntaxError: invalid syntax
Hi axel
I am sorry
I get the same frustration with scripts that have GUI (Tkinter)
for a year trying to make them work on my macs: One macbookpro with Snow Leopard 10.6.8 and another Imac with Mountain Lion 10.8
for long time wondering if any mac user got work them and I never got any response from mac users
My admired friend spk77 did everything possible to help me
He is a pc user but he tried to help me
I returned a few days ago to ask mac users about Reachorder (Sasje (creator) & Lazarus & Spk77 helper)and Arpeggiator (Spk77) scripts with GUI:
http://forum.cockos.com/showthread.php?t=128772

There is a user (semiquaver) that says he got work it
I asked him how he got but at this moment has not answered me
I hope to do at some moment
Axel if one day you get it please let me know and if i will get i will inform you
Regards
Mario

Last edited by reapertribal; 09-24-2013 at 12:28 PM.
reapertribal is offline   Reply With Quote
Old 09-24-2013, 04:26 PM   #64
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

Here's the page with the information required for Mac users to install the correct version of Tk for their version of OSX....

http://www.python.org/getit/mac/tcltk/

.... hopefully this will help.
Lazarus is offline   Reply With Quote
Old 09-24-2013, 06:19 PM   #65
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

Quote:
Originally Posted by knutteballa View Post
Still no buttons in the new version. My theme is default plus plus. Tried to switch to default theme, but no changes. Yes I had resized the window. Here is what it looks like when I not resize (attachment)
In regard to knutteballa' s Win 8 issues, we might need to start using the grid layout manager instead of the absolute positioning? Would love to hear your ideas about it as I'm not sure if it will solve anything. It could be a Win 8 theme issue, or something deeper with absolute positioning. In the test I ran a default Win 8 on a VM ware player, and it worked fine. But you know how Microsoft works, they often radically change a lot of things without telling developers beforehand.

I'm now busy setting up a proper VM ware environment for testing. I can soon test for all Windows and some Mac OS version.
Sasje is offline   Reply With Quote
Old 09-24-2013, 06:28 PM   #66
reapertribal
Human being with feelings
 
reapertribal's Avatar
 
Join Date: Apr 2013
Location: Spain
Posts: 274
Default

Hi
Lazarus thanks to your link information
Yes i installed it time ago following the rules of that link but does not work for me
I don,t know what i did wrong;i think i did well
I suspect that tkinter in mac for reaper are incompatible or create many problems
Really i don,t know yet any mac user in this forum that can use Reachorder and arpeggiator scripts with GUI
Only one mac user (semiquaver) says that can use scripts with GUI but at the moment he has not specified which are
Your help is wellcome
Thanks
reapertribal is offline   Reply With Quote
Old 09-24-2013, 07:26 PM   #67
Lazarus
Human being with feelings
 
Join Date: Aug 2013
Posts: 1,355
Default

@reapertribal: de nada, I hope semiquaver can share some tips.

@Sasje: it's funny you should say that because I've used grid geometry for the lower frame the buttons seperate from the tabs are kept in already.

That's the wizard, chord and bass section functioning with the new system of passing the song structure and composed verse and chorus around now. Just need to do the melody, save/recall, widgets for the seperate tabs and tidying up reachord_functions. After that I need to put muchos comments in to let you (guys) and my future self know what's happening.
Lazarus is offline   Reply With Quote
Old 09-24-2013, 07:32 PM   #68
axel_ef
Human being with feelings
 
axel_ef's Avatar
 
Join Date: Jan 2007
Location: Erfurt
Posts: 596
Default

to use Python3 in Reaper OSX

Download and Install Python 3.4
Python 3.4

In Reaper Preferences - ReaScript
Custom Path to dll directory:
/Library/Frameworks/Python.framework/Versions/3.4/lib/
Force Python to use .dylib:
libpython3.4.dylib

Reaper will then use Python 3

but unfortunately ReaChorder will not work in OSX....

loading ReaChorder.py - nothing happens, no error message
axel_ef is offline   Reply With Quote
Old 09-25-2013, 01:45 AM   #69
reapertribal
Human being with feelings
 
reapertribal's Avatar
 
Join Date: Apr 2013
Location: Spain
Posts: 274
Default

Quote:
Originally Posted by axel_ef View Post
to use Python3 in Reaper OSX

Download and Install Python 3.4
Python 3.4

In Reaper Preferences - ReaScript
Custom Path to dll directory:
/Library/Frameworks/Python.framework/Versions/3.4/lib/
Force Python to use .dylib:
libpython3.4.dylib

Reaper will then use Python 3

but unfortunately ReaChorder will not work in OSX....
loading ReaChorder.py - nothing happens, no error message
Hi
Axel thanks to your links
At the moment i use python 3.3 and works fine
3.4 is beta and i prefer wait until it will be more estable
You need also Tkinter 8.5
Is strange;I think the problem is in Reaper
I can open Tkinter 8.5 in my mac without any problem as standalone
But when i open a script with GUI inside Reaper anything happens (as you: loading ReaChorder.py - nothing happens, no error message)
It seems that Reaper not detect Tkinter in mac
I think that Reaper service technician should pay attention to this problem emerged between tkinter and mac and give us a guide to follow,to solve it
Mac users also want to enjoy scripts as powerful as ReaChorder and Arpeggiator with GUI
Thanks
Regards
reapertribal is offline   Reply With Quote
Old 09-25-2013, 02:52 AM   #70
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,286
Default

Quote:
Originally Posted by Sasje View Post
In regard to knutteballa' s Win 8 issues, we might need to start using the grid layout manager instead of the absolute positioning? Would love to hear your ideas about it as I'm not sure if it will solve anything. It could be a Win 8 theme issue, or something deeper with absolute positioning. In the test I ran a default Win 8 on a VM ware player, and it worked fine. But you know how Microsoft works, they often radically change a lot of things without telling developers beforehand.

I'm now busy setting up a proper VM ware environment for testing. I can soon test for all Windows and some Mac OS version.
I think that the grid layout manager is easier to use (for more complex GUIs).

(from stackoverflow grid vs pack)
http://stackoverflow.com/questions/4...-grid-layouts:

"Neither is intrinsically better than the other. Each have strengths and weaknesses. Learn what those are and the choice of which to use becomes obvious.

grid is considerably easier to use if you need to lay things out in a grid. pack is generally easier to use if all you need to do is put some widgets in a single row or single column. There's a whole lot of gray area in-between where neither is necessarily better than the other.

The other thing to consider is what you said in your question: if you want to show and hide widgets at run-time, grid is probably the best choice because of the grid_remove method.
"


"I always recommend grid over pack for polished applications. There are only a few edge cases where pack is easier and fits the bill (everything in one row or col). grid has better "composability" (e.g. megawidgets or gridding elements of gridded elements). The reasons to prefer grid are the extra fine-tuning options that it provides. The use of weight (which effects growing and shrinking btw), minsize and maxsize, as well as convenience features like enforcing uniform rows/columns.

A fully gridded app of any size will use (significantly) fewer frames than an equivalent packed app, and have better shrink/expand control over inner elements.

BTW, both pack and grid can show/hide sub-elements, though the syntax differs slightly between the two. Grid is just slightly better because 'remove' (rather than 'forget') will remember the grid options on the slave widget.
"
spk77 is offline   Reply With Quote
Old 09-25-2013, 04:34 AM   #71
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

...In the mean time: A new toy to play with. GuitarChorder.

A small single python file that draws chords (415 in total)



I haven't manually checked all chords yet, so some might not be accurate.

Download: http://stash.reaper.fm/v/17940/GuitarChorder.zip

-

Last edited by Sasje; 09-25-2013 at 11:20 AM.
Sasje is offline   Reply With Quote
Old 09-25-2013, 05:37 AM   #72
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

I totally forgot to play with ReaChorder...

Here is another demo I just made in about 5 minutes:

https://soundcloud.com/sasha-sandbox...eachorder-demo

Nothing has been edited everything comes from ReaChorder. It uses the "catchy" formula with a random melody.
Sasje is offline   Reply With Quote
Old 09-25-2013, 08:24 AM   #73
joesacco
Human being with feelings
 
joesacco's Avatar
 
Join Date: Sep 2012
Location: Canada
Posts: 214
Default

Tried with python 3.2, 3.3 and 3.4.... Still no luck on Mac... Anyone here get it working... Sounds like a cool plugin. Just hope it doesn't put us out of business lol

I'm getting a traceback import error for line 12.
joesacco is offline   Reply With Quote
Old 09-25-2013, 09:57 AM   #74
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

Yeah we need to figure this Mac OS issue out. In a few days I'll have Mac OS running on a virtual machine so that I can test a bunch of stuff to see what and why some things don't work. Please be patient though, my health is still a bit fragile to seriously delve into this quickly.

More info in Tcl/Tk for Mac OS: http://wiki.tcl.tk/1013

For those on Mac OS, can you please supply me these details:

1. Mac OS version.
2. CPU Architecture 32/64 etc.
3. Python version.
4. SWS installed yes/no.

Last edited by Sasje; 09-25-2013 at 10:13 AM.
Sasje is offline   Reply With Quote
Old 09-25-2013, 09:59 AM   #75
axel_ef
Human being with feelings
 
axel_ef's Avatar
 
Join Date: Jan 2007
Location: Erfurt
Posts: 596
Default

Quote:
Originally Posted by reapertribal View Post
It seems that Reaper not detect Tkinter in mac
I think that Reaper service technician should pay attention to this problem emerged between tkinter and mac and give us a guide to follow,to solve it
Mac users also want to enjoy scripts as powerful as ReaChorder and Arpeggiator with GUI
I hope they will do it...

when I load the file "ArpeggiatorGUI.py" into IDLE 3.4.0a2, I see a graphical UI.(in 3.3.2 only a blank window)

axel_ef is offline   Reply With Quote
Old 09-25-2013, 10:53 AM   #76
Sasje
Human being with feelings
 
Sasje's Avatar
 
Join Date: Sep 2013
Posts: 137
Default

Since it gets somewhat confusing with all the forum attachments, I created a Reaper stash page:

http://stash.reaper.fm/v/17939/Rea-Chorder.zip

Here I'll upload the latest version when it's ready. The last uploaded version is from 9/23/2013. I'm now waiting on Lazarus to come up with something more spectacular.

-

Last edited by Sasje; 09-25-2013 at 10:58 AM.
Sasje is offline   Reply With Quote
Old 09-25-2013, 11:18 AM   #77
fwd0120
Human being with feelings
 
Join Date: Aug 2011
Posts: 285
Default

Wow, so awesome, guys!
fwd0120 is offline   Reply With Quote
Old 09-25-2013, 11:20 AM   #78
joesacco
Human being with feelings
 
joesacco's Avatar
 
Join Date: Sep 2012
Location: Canada
Posts: 214
Default

In the meantime, Mac users check out tonespace.

www.mucoder.net/en/tonespace
joesacco is offline   Reply With Quote
Old 09-25-2013, 12:14 PM   #79
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,286
Default

Here's an idea for harmonizing:

Code:
def msg(m):
    RPR_ShowConsoleMsg(m)

def convertScaleToAbsolutePitches(root, scale):
    """ 'scale' should be a list and all values should be from 0 to 11
        the returned list = 'all note positions from 0 to 127 in selected root in selected scale'
        Example: scale = [0, 2, 4, 6, 8, 9, 11] (Lydian_Aug) and root = 59 ('B' note)
                (0 = root, other values are relative pitches from the root)"""

    # note positions in MIDI editor
    b = [11, 23, 35, 47, 59, 71, 83, 95, 107, 119]
    aS = [10, 22, 34, 46, 58, 70, 82, 94, 106, 118]
    a = [9, 21, 33, 45, 57, 69, 81, 93, 105, 117]
    gS = [8, 20, 32, 44, 56, 68, 80, 92, 104, 116]
    g = [7, 19, 31, 43, 55, 67, 79, 91, 103, 115, 127]
    fS = [6, 18, 30, 42, 54, 66, 78, 90, 102, 114, 126]
    f = [5, 17, 29, 41, 53, 65, 77, 89, 101, 113, 125]
    e = [4, 16, 28, 40, 52, 64, 76, 88, 100, 112, 124]
    dS = [3, 15, 27, 39, 51, 63, 75, 87, 99, 111, 123]
    d = [2, 14, 26, 38, 50, 62, 74, 86, 98, 110, 122]
    cS = [1, 13, 25, 37, 49, 61, 73, 85, 97, 109, 121]
    c = [0, 12, 24, 36, 48, 60, 72, 84, 96, 108, 120]

    # ADD OFFSET:
    # if root note is 'B' (pitch 59) and scale = [0, 2, 4, 6, 8, 9, 11] (Lydian_Aug)
    # after adding the offset it will be [-1, 1, 3, 5, 7, 8, 10]
    for k, pitch in enumerate(scale):

        if root in b:
            rootNote = 'B'
            scale[k] -= 1
        elif root in aS:
            rootNote = 'A#'
            scale[k] -= 2
        elif root in a:
            rootNote = 'A'
            scale[k] -= 3
        elif root in gS:
            rootNote = 'G#'
            scale[k] -= 4
        elif root in g:
            rootNote = 'G'
            scale[k] -= 5
        elif root in fS:
            rootNote = 'F#'
            scale[k] -= 6
        elif root in f:
            rootNote = 'F#'
            scale[k] -= 7
        elif root in e:
            rootNote = 'E#'
            scale[k] -= 8
        elif root in dS:
            rootNote = 'D#'
            scale[k] -= 9
        elif root in d:
            rootNote = 'D'
            scale[k] -= 10
        elif root in cS:
            rootNote = 'C#'
            scale[k] -= 11
        else:
            rootNote = 'C'

    # currently the scale list looks like this: scale = [-1, 1, 3, 5, 7, 8, 10]
    # if there are negative numbers in the list -> "transpose" them one octave up:
    for e, pitch in enumerate(scale):
        if pitch < 0:
            scale[e] += 12

    # after the "transposing": scale = [11, 1, 3, 5, 7, 8, 10]
##    msg(scale)

    # sort: [11, 1, 3, 5, 7, 8, 10]...
    scale = sorted(scale)
    # ...[1, 3, 5, 7, 8, 10, 11] and now we have the scale in the lowest possible position (
##    msg(scale)

    # build a "full scale" -list with [1, 3, 5, 7, 8, 10, 11], from 0 to 127:
    fullScale = []
    fullScale = scale[:]    # copy list

    i = 0
    while max(fullScale, key=int) <= 127:   # still don't know how to use while-loops
        if i == len(scale):
            i = 0
        scale[i] += 12
        if scale[i] > 127:
            break
        fullScale.append(scale[i])
        i += 1

    # and this is the "Full scale" (scale = Lydian_Aug and root = 59):
    # [1, 3, 5, 7, 8, 10, 11, 13, 15, 17, 19, 20, 22, 23, 25, 27, 29, 31, 32, 34, 35, 37, 39, 41, 43, 44, 46, 47, 49, 51, 53, 55, 56, 58, 59, 61, 63, 65, 67, 68, 70, 71, 73, 75, 77, 79, 80, 82, 83, 85, 87, 89, 91, 92, 94, 95, 97, 99, 101, 103, 104, 106, 107, 109, 111, 113, 115, 116, 118, 119, 121, 123, 125, 127]

    # This function can be used for example for harmonizing, inversions etc.
    #
    # Here's an example (harmonize):
    # scale = [0, 4, 7] (major triad) and root = 60
    # full scale would be: [0, 4, 7, 12, 16, 19, 24, 28, 31, 36, 40, 43, 48, 52, 55, 60, 64, 67, 72, 76, 79, 84, 88, 91, 96, 100, 103, 108, 112, 115, 120, 124, 127]
    # if we have three notes in MIDI editor, f.ex 67, 64 , 72 and we want to "harmonize" them with the next note in the scale:
    #   loop through notes:
    #       get pitch from current note
    #       indexInFullScaleList = find note position (index) by pitch from the full scale list
    #       add note to current note position
    #       set added note pitch to fullScaleList[indexInFullScaleList + 1]


##    msg(fullScale)

    return fullScale, rootNote

def main():
    root = 59   # 'B' note

    # (0 = root, other values are relative pitches from root)
    scale = [0, 2, 4, 6, 8, 9, 11]  # Lydian_Aug
    scaleName = "Lydian_Aug"

##    scale = [0, 2, 4, 5, 7, 9, 11]  # major scale
##    scaleName = "Major"

##    scale = [0, 4, 7] # major triad
##    scaleName = "Major triad"
##
##    scale = [0, 1, 3]   # Phrygian_TriChord
##    scaleName = "Phrygian_TriChord"
##
##    scale = [0, 2, 3, 4, 7, 9]  # Blues_Dorian_Hexatonic_1
##    scaleName = "Blues_Dorian_Hexatonic_1"

    fullScale, rootNote = convertScaleToAbsolutePitches(root, scale)
    msg("Root: " + str(rootNote))
    msg("\n")
    msg("Selected scale name: " + str(scaleName))
    msg("\n")
    msg("Full scale: " + str(fullScale))
    msg("\n")

##################################################

main()
I can get the scales from the clumsy arpeggiator - it has a "ReaScale file parser" function. F.ex. Zappadave's reascale file has a lot of scales. (here I'm using the harmonize function):
spk77 is offline   Reply With Quote
Old 09-25-2013, 12:19 PM   #80
reapertribal
Human being with feelings
 
reapertribal's Avatar
 
Join Date: Apr 2013
Location: Spain
Posts: 274
Default

Quote:
Originally Posted by axel_ef View Post
I hope they will do it...

when I load the file "ArpeggiatorGUI.py" into IDLE 3.4.0a2, I see a graphical UI.(in 3.3.2 only a blank window)

Hi
Axel interesting your tkinter window when is opened ArpeggiatorGUI.py with IDLE
When i open ArpeggiatorGUI.py with IDLE python 3.3.2 is not appeared tkinter window,see my picture
Maybe i will have to try 3.4.0
*** Sasje:
In a few days I'll have Mac OS running on a virtual machine so that I can test a bunch of stuff to see what and why some things don't work
Great!!! it will be very helpful for us,thanks and i wish you your health is restored quickly

†††† For those on Mac OS, can you please supply me these details:

1. Mac OS version.
2. CPU Architecture 32/64 etc.
3. Python version.
4. SWS installed yes/no.

1- I have an old laptop Macbookpro with Snow Leopard Intel Mac OSX 10.6.8
I have an imac desktop with Mountain Lion (i will back to madrid in one week,i think is Intel MAC OSX 10.8)
2- 32 bits
3- Python 3.3.2 in both
4- yes,SWS 2.4.0 in both
5- Tkinter 8.5

Regards
Attached Images
File Type: jpg Arpe.jpg (40.2 KB, 97 views)
reapertribal is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:23 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.