omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    chordcalc - a stringed instrument chord calculator

    Pythonista
    7
    42
    28447
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • polymerchm
      polymerchm last edited by

      I believe I panicked. I am mostly back, with a better implementation anyway. Using gitui really helps and now that I better understand git I don't have to go back to stacks of versioned punch cards in labelled boxes. ;-)

      1 Reply Last reply Reply Quote 0
      • wradcliffe
        wradcliffe last edited by

        Punch cards had their benefits. It was a very satisfying way to write code. Made great fire starter and an endless supply of confetti.

        Found a really good tutorial on git here

        I think the tough part to get used to is that the code for all branches is suppose to live in the same local directory. That makes me nervous and I would want to zip up and stash a copy before I trust a script doing the push (upload).

        1 Reply Last reply Reply Quote 0
        • polymerchm
          polymerchm last edited by

          Nervouseness agreed upon. Kaplooey again. Seems existing git tools for pythonista don't allow rollback to a previous commit. Especially if the base file has disappeared.

          This is why my parents never bought a color TV. They were waiting for it to be perfected.

          Zips and email for me from hereon out.

          Trust everyone, but cut the cards.

          1 Reply Last reply Reply Quote 0
          • JonB
            JonB last edited by

            If you do a push to github, your entire local history gets pushed as well, so you can use github to get back to any previous commit. then pull back into pythonista.

            If you have deleted a file, but didn't rm from the repo, you will get an error. I'll have to think about fixing that. In the meantime, just recreate the missing files, or if you have no other changes pending, just checkout the current branch. then you can push.

            I've been planning a "checkout sha" feature... But this is also a really good way to get lost. I think the way it would have to work would be to create a branch from that sha. Alternatively it would update the files on disk, but leave head pointing the same.

            1 Reply Last reply Reply Quote 0
            • JonB
              JonB last edited by

              By the way, you can create a new branch by typing a new branchname in the branch box. Maybe that is not intuitive, I should add a button.
              You should do that BEFORE making any changes....the current version seems to nuke any unstaged changes if you create a new branch... I need to fix that..

              1 Reply Last reply Reply Quote 0
              • JonB
                JonB last edited by

                Actually, I forgot... Current gitview lets you paste a sha from the log into the branch field, and it will checkout a previous commit (but be sure to commit any outstanding unstaged commits or you will lose them forever)

                1 Reply Last reply Reply Quote 0
                • JonB
                  JonB last edited by

                  FYI the latest version on github is a little safer, prompting you in most cases before clobbering uncommitted changes. Also, it handles missing files, offering to recreate them from the latest checkin. If you want to remove a file, remove it by pressing X on a file, then commit. You can then delete any untracked files safely.

                  The Log button now shows you every commit, sorted by date. If you drag the table entry to the left, it will show you an Open button, which checks out that revision into your current file system.

                  Then, you could stage a file and check in (to the active branch). Need to work on a proper merge system....

                  1 Reply Last reply Reply Quote 0
                  • wradcliffe
                    wradcliffe last edited by

                    @polymerchm - Is everything OK? Did you lose it all again?

                    1 Reply Last reply Reply Quote 0
                    • polymerchm
                      polymerchm last edited by

                      Chordcalc Version 2 is now up on Github. The capo enabled version is in the devel-capo branch. It is still a little buggy, and this thing does so many variants, that I can't test all the potential bad states without a little help. In addition, I've added 5-string banjo (with capo options) that handles the short 5th string and its reentrant tuning. I only included standard open G banjo tuning.

                      Had to delete the old branch and copy/paste all the new stuff. Included is a spinner class used to set the span (how many frets you can stretch to reach all the fretted strings).

                      Comments please. Some rest, then re-build the GUI to allow for iPhones (just got a 6). That one I might not release to github if I take the plunge and become a developer. We'll see. Got to check out the way xcode handles this beast.

                      1 Reply Last reply Reply Quote 0
                      • wradcliffe
                        wradcliffe last edited by

                        Thanks for adding the capo feature. I did a simple test with my special tuning and the partial capo and was able to find the two fingered chords I have been playing. So it seems to work! I would like to post a screenshot but can't figure out how to do it in this interface.

                        1 Reply Last reply Reply Quote 0
                        • polymerchm
                          polymerchm last edited by

                          you need to have it on some website and post a link. I have a website in the works, so I'll try. Don't think I can put on github and provide a link..Maybe on fo the gurus know.

                          1 Reply Last reply Reply Quote 0
                          • polymerchm
                            polymerchm last edited by

                            @JonB Seems gitview is gone from github.

                            1 Reply Last reply Reply Quote 0
                            • dgelessus
                              dgelessus last edited by

                              @polymerchm, it still exists in a "Test" branch: https://github.com/jsbain/gitview/tree/Test

                              1 Reply Last reply Reply Quote 0
                              • wradcliffe
                                wradcliffe last edited by

                                Been playing with the new version a bit and have a few comments:

                                1. I was adding some tunings (4ths) and scales (Chromatic) and editing the chordcalc_constants.py. I wanted to add a reload on the module to get my edits but could not because you import everything as globals. I wonder if this file should be some kind of config file - ini - json, etc. This opens up the topic of persistence of "settings".

                                2. Would be nice to have a Save/Restore for the current settings.

                                3. I notice that the Inspect mode prevents picking notes behind the capo or partial capo and this should be happening in Chord mode as well.

                                4. The visual feedback provided when selecting between S,I,C could use some enhancement. Maybe highlight the mode or add an animation? Lots of other stuff changes when you hit each of these, but it still a bit unclear at times that these modes are selected.

                                I REALLY like this new version!

                                1 Reply Last reply Reply Quote 0
                                • polymerchm
                                  polymerchm last edited by

                                  Final Version up on github (barring bugs)

                                  the devel-json branch.

                                  chordcalc Version 4.0

                                  Turning Gek S. Low's chordcalc python script into a full-featured chord calculator/player
                                  Updated to be a full featured stringed instrument chord analysis tool by Steven K Pollack

                                  • makeWaves.py

                                  generates a set of 96 2 second wave files used by chordcalc.py to play the sound of the notes.

                                  • chordcalc.py

                                  • chordcalc_constants.py

                                  • debugStream.py

                                  • Spinner.py

                                  • Shield.py

                                  The new features in 4.0 are:

                                  • constants can now be reloaded. No longer "globals"

                                  • Chord, Capo, Filter and Instrument Tableviews can be edited to re-order or delete rows

                                  • The current configuration of the tables can be saved or the "factory standard" restored

                                  • The current settings for chord, capo and filters can be saved under/loaded from a named setting. The settings list can be edited.

                                  • Sweep gestures and long-touch on the fingerboard are enabled

                                  Editing the Tables

                                  The labels of the editable tables are actually buttons that enable/disable deleting rows or re-ordering each editable table. If you wish to save this new "configuration", you hit the "Config" button. It will give you the option of saving the current setup, or restoring the "factory setting" (from the file chordcalc_constants.py). The configuration is stored as a json object in the file "config.ini"

                                  Saving the Settings

                                  The Save and Load buttons allow the user to save the current instrument, filters and capos as a named entry in the "Settings" list. If an existing default setting is changed, the user is prompted to confirm the overwrite. There also the option to edit the list (delete rows/reorder). The data for this list is stored in a file called "settings.ini"

                                  Instrument Editor

                                  Hitting the New button on the main menu brings up an instrument editor. It will take the current selected instrument/tuning and allow you to adjust the tuning. You can then save this to the Intrument/tuning list. You will be forced to use a new name. If you want to delete it later, you can edit the intrument/tuning list to remove it. To have this intrument saved fo rhte next time you run chord calc, hit the "config" button to save it.

                                  Capos:

                                  The list (lower right hand corner) allows the user to select one or more capos. When you select a capo, you are prompted for a fret to place it. All subsequent operations acccount for the presence of the capos. The full capo will adjust to the number of strings (except 5-string banjo, see below) A partial capo will only fret a subset of strings. As supplied these assume a 6-stringed instrument. The standard partial capos predefined are the "drop E" capo that only covers 5 consecutive guitar strings (when placed on the second fret, accomplishes a drop D tuning, up a tone without retuning) and the "sus2" capo (covers the "ADG" strings or the "DGB" strings of a guitar). Five string banjo capos are one for the "normal" four strings and a one strng capo for the 5th string. Multiple capos are allowed.

                                  There are three modes of operation: Calc, Identify and Scale. These are selected by the C, I and S buttons. The active mode is highlighted

                                  Calc Mode:

                                  Select an instrument/tuning (upper right-hand corner), a root (key) (left-most side) and a chord type, (second column on left), and all possible fingerings will be displayed on the fretboard. You cycle through them with the up and down arrows.

                                  New Feature. If you sweep up or down the fretboard, it will "fast forward" the chords in proportion to the distance you sweep. If you sweep across, it will jump in smaller increments. If you do a long-touch (> 1/2 second), the present chords will jump to the closest chord to that fret.

                                  By choosing various filters (center right-hand list), you can reduce the number and type of chords displayed. For example, 'LOW_3' is a mandolin filter that only presents chords played on the lower 3 strings and leaves the high E string unplayed. The 'DOUBLE_STOP' filter (also for mandolin) will show all valid double stops for a given chord (2 note chord partials). 'NO_DEAD' will only show chords where every string is sounded.

                                  If a given instrument/tuning cannot represent the chord, an appropriate offensive noise is sounded and message is displayed. The filters NO_ROOT, NO_3RD and NO_5TH will find chord shapes for
                                  mandolin (you notice the mandolin emphasis here) that allows those chord tones not to be
                                  ignored in testing for valid fingerings. On mandolins, and other 4 stringed instrumetns, the player often abandons the root, 5th or 3rd.

                                  Hitting the chord button will play the chord (see makeWaves.py above). Hitting the arpeggio button will play the notes one by one. Hitting the button which describes the individual string tunings will play the sound of the instrument when un-fretted (when a capo(s) is applied, it effects the tones appropriately)

                                  The slider at the bottom is a volume control and the slider at the top determines the "speed" of the arpeggio.

                                  For any chord, touching the fretboard will display all of the chordtones on the entire fretboard. Touching it again displays the current chord.

                                  The chord tones and notes are displayed in the upper right

                                  Identify mode

                                  In identify mode, you touch the fingerboard to indicate a fingering When you hit Find, all possible "names" for the chord are given. If the fingering is a chord partial, then the missing chord tones are indicated. If there are capos, you will be prevented from fretting "behind" the capo.

                                  Scale Mode

                                  In scale mode, you select a key (the root) and the scale type (second column on left). All notes on the scale across the entire fretboard are displayed. If you touch a root position, a two octave display is highlighted. Hitting the scale button plays the scale. The speed/volume sliders are also effective here. If the mode is one of the greek modes, then the base key is displayed in the upper right hand corner (for example, A Aoelian is based on C Ionian (major), A Dorian is actually the key of G Ionian (major)). Every effort is made to have the appropriate anharmonics (sharps or flats) display based on the key signature (or for the greeek modes, its base). You can toggle the display between scale notes and scale degrees and, for "ambiguous" key signatures (like A#/Bb), you can toggle anharmonic notes between sharps and flats. New Feature. A Spinner is presented to allow for different modes of calculating a 2 0ctave scale. This is experimental at this point.

                                  • debugStream.py

                                  is a handy class for creating output that doesn't bog down the pythonista console which can slow debugging down.

                                  Usage:

                                  out = debugStream()
                                  
                                  out.push("this {} is formated to here {}",'string1','string2')
                                  .
                                  .
                                  .
                                  .
                                  out.send()
                                  

                                  first parameter is the format string that would be used with the .format method. Any number of arguments that correspond to fields in the format string can follow.

                                  • Spinner.py

                                  is a custom view class that creates a spinner view, consisting of a value field and and up/down button pair. The spinner values can be scalar (int/float) or lists. In the former case, you can specify an increment that represents the effect of the buttons and limits that prevent the buttons from going past the limits. You can associate two actions, one for a successful button push (before reaching a limit) and one that fires when you push a button at a limit. You can set/get value or position in a list.

                                  Usage:

                                  	spinner = Spinner(name='spinner',  # useful for dictionary type reference to subview
                                  										initialValue= 10, # can be a list or tuple
                                  										limits=(0,100),   # only relevant for scalar 
                                  										action=None, # done if action was successful
                                  										limitAction=None, #done if hit a limit
                                  										textFraction = 0.75, # for width of spinner, defines portion that value field occupies
                                  										fontSize = 12,       # font size of displayed value (system font)
                                  										spinnerSize=(80,80)  # width,height of spinner
                                  	                  )
                                  	spinner.position = (200,200)	# positions spinner in containing view. 
                                  	where = spinner.position			# returns current position
                                  	fred = spinner.value 					# returns current value
                                  	spinner.value = 25 						# sets current value
                                  	spinner.increment = 2					# sets increment
                                  	spinner.pointer = 5						# set where in a list value to display
                                  	index = spinner.pointer				# returns the pointer
                                  
                                  • Shield.py

                                  is a custom view that creates a translucent "shield" to prevent views behind it from being responsive to touches. Simplifying having only the topmost view respond to touches.

                                  v = ui.View(frame=(0,0,500,500))
                                  vShield = Shield(v)  # created a shield instance the size and position of the argument view
                                  v.present()
                                  vShield.conceal()   # turns on the shield
                                  vShield.reveal()    #turns off the shield
                                  vShield.isActive()  # returns that status
                                  vShield.delete()		# destroys the shield object.
                                  

                                  Have fun

                                  1 Reply Last reply Reply Quote 0
                                  • polymerchm
                                    polymerchm last edited by

                                    For those interested, here is what it started from

                                    1 Reply Last reply Reply Quote 0
                                    • polymerchm
                                      polymerchm last edited by

                                      I've added a couple of more things to the iPad version. Realistic sounds from soundfonts, better results in the identify mode. Now I am contemplating an iPhone version using Scrollviews. More new fun stuff to learn.

                                      1 Reply Last reply Reply Quote 0
                                      • polymerchm
                                        polymerchm last edited by

                                        Now iPhone 6 compatible. see the iphone branch on github.

                                        1 Reply Last reply Reply Quote 0
                                        • First post
                                          Last post
                                        Powered by NodeBB Forums | Contributors