Chords in OpenLP

245678

Comments

  • @Godisawesome: sorry, I didn't see it before. Brackets must be used for chords:
    {cl}I’m {c}[C(A)]{/c} gonna be me, I’m gonna be me, I’m gonna be me,{/cl}
  • @tomass: I've just installed the latest version 2.21 double checked the tags are imported and even with square brackets around the chords still get the same result just with square brackets around the chords. I'm considering removing openLP and reinstall it and see if that helps
  • Godisawesome: I had a friend trying out the chords plugin, running OpenLP 2.0.X and did not work. He installed 2.1.6 (OpenLP nightly app, not the plugin) and worked right away.
  • @tomasss: First: Awesome work! Thanks a bunch.
    When I try to view http://localhost:4316/files/print.html or slides.html, all I get is "Sorry, an error occurred". I copied the plugin/remotes... files into the OpenLP data folder, which I don't think is right as there was no plugin folder (?).

    I also have the same problem described by @Godisawesome in that the square brackets show up in http://localhost:4316/stage.

    I'm new to OpenLP and I'm running Arch Linux if it makes a difference. 
  • @timschul: files must be in OpenLP application directory - openlp/plugins/remotes/html/
    I wanted to see chords on stage view, because it's for musicians. I didn't want to make changes in original code and I made slide.html for it. You can switch on/off for chords in slide.html.
  • edited January 2016
    @timschulz: please see http://forums.openlp.org/discussion/comment/7998/#Comment_7998

    The problem lies in the issue that the chords are present in the text part of the web server reply. I have already issued a bugreport to the wishlist to be able to hide the code between {c} and {/c}. In the meantime you can edit the stage.js and change from the usage of text to html:
    line 103: text = slide["text"]; -> text = slide["html"];
    line 123: text = text + OpenLP.currentSlides[idx]["text"]; -> text = text + OpenLP.currentSlides[idx]["html"];
    This does not change the fact, that the chords are visible in the main window (reason they are in [ ]), but hopefully the change request will be implemented soon.
  • Hi guys,

    Just for your information, I've started experimenting with integrating your changes into OpenLP. It has a some way to go before being ready for use, but you can track the progress here: https://code.launchpad.net/~tomasgroth/openlp/chords
    So far the plan is to be able to show chords on both stage view, on the presentation screen and on printouts, all optional.
    One of the challenges is that there are atleast 2 different naming conventions when it comes to chords, as it can be seen here: https://en.wikipedia.org/wiki/Musical_note#12-tone_chromatic_scale
    I plan to support English/Dutch (their symbols are the same) and German conventions. Has anyone seen the other conventions used? If so, I would be very interested in seeing some examples.
  • Hi tgc, I also looked into integrating (even volunteering into development), but then I realized I know nothing about launchpad projects, and I have to learn python too (though it wouldn't be that hard, still...), so I delayed my efforts a little, having the working setup being enough for my sessions.

    However, if things do get serious, then I would have a few ideas that I consider worth looking into before it gets implemented.

    The chords (notation) depend on the scale of a song. I tried to smooth out as much as possible with notesPreferred, but in order to have it 100% accurate, every song needs a scale property. (ex. if a song is played in F (1 flat), then the 4 is Bb (or B in german) and not A#, also if played in D (2 sharps) then the 3minor is F#m instead of Gbm). This cannot be determined by any algorithm, it needs the scale property.

    I created a Chord entering helper script in AutoIt3, and even with it I find entering the chords not easy :) I know, professional work is hard work, but I think that this hard work can be prevented with a proper chord editor, as a second layer above the lyrics editor. Although this might look like further away in integration, might as well be the first step... I can attach the compiled OpenLPChordHelper(.exe) file if anyone needs it, with usage documentation of course :)

    Also if you have an easy to follow documentation on how to set up a working OpenLP development environment, with Python versions, editors, or any other tools you use, I would be more than grateful to be involved in deeper levels.
  • edited January 2016
    Hello @tgc, thanks for your job. I really like your information about integrating chords into OpenLP.
    I think it might be better if it was more configurable and versatil - define brackets, style and other stuff in Settings. This time, you can set style for lines and chords. May be better as OpenLP plugin not "hard coded" into OpenLP.
    Also this can be used for other think like phonetic reading not only for chords.

    I have lyrics database for cellphone or tablets in my "html wiki" woas with my chords plugin (screenshot). It's based on the same javascript. Also there is Android app (forum discussion) Tamil Christian Worship Songs (on github) using openlp database file, but without chords funcionality :(.
    But my vision is to have only one database or at least one database file for more application. But it's more difficult to develope it :).
    I know that it's not simple to make it so universal, but I think we are on good way.
    Thanks developers for OpenLP.
  • @STEPHANVS, feel free to help out! You should have a look at these wiki pages to get started: http://wiki.openlp.org/Windows_Environment and http://wiki.openlp.org/Testing:Getting_Started
    I can recommend the PyCharm IDE for development.
    In the first iteration I doubt we will add a dedicated chord editor, I think we should get the basics working first.

    @tomasss, I plan to make it fairly configurable, but I'll try to focus on the basic features first. I'm not sure it can be done as a separate plugin, since it affects code in many places, but I'll have it in mind.
  • @tgc: I checked your version from launchad on windows.
    There was one error before start:
    Traceback (most recent call last):

    File "C:\Python34\chords\openlp\core\ui\themeform.py", line 162, in resizeEvent

    if self.currentPage() == self.preview_page:

    AttributeError: 'ThemeForm' object has no attribute 'preview_page'

    but it wasn't critical and OpenLP started correctly before cancel this window.

    Is there only hidden chords in preview and show chord on stage view or something more?
  • @tomasss, that error is fixed in trunk, so it just needs to be updated.
    Currently there is no more features than what you've seen. After the 2.4 release I'll look at it again.
  • Okay, so I tried all the typical application directories that linux creates for its programs. None of them worked.
    So I just searched for all the folders that contain remotes/html and tried them one by one. The one that finally did it was /lib/python3.5/site-packages/openlp/plugins/remotes/html
    Not sure if that's something specific to my setup, but I figured if anybody else is stuck with "Sorry, an error occurred", this might be useful
  • Anybody know where these files are on mac?
  • @johnwry: I do not own a mac, but if I remember correctly I had to browse the app and copy them into the proper directory inside the app.
  • Me again. This time I did not keep track of all the changes I included in these files, so forgive me, if I leave something out:

    - main reason for posting: mid-song transpose support (guitar players can see set per-slide transpose/capo values, and they are shown before next slide, and also main value display flashes red for 5 seconds)
    - added android/ios add2homescreen support with icons
    - improved onthefly transpose changing speed

    Backward functionality breaking features!!!:
    - renamed files to chords.*
    - changed transpose value assignment logic, will ignore currently stored values in localstorage of the browser

    Tested with version 2.2.1 (newer versions seem a lot slower on search, and songbook view sorting is broken...)


    God bless you all.
  • About the new transpose storing:

    Adding the following lines in chords.js (after line 105 in loadslides function) will preserve/migrate the currently saved transpose settings of songs:

    if (localStorage.getItem(OpenLP.currentSlides[0].text.split("\n")[0] + '_transposeValue')) {
         localStorage.setItem(OpenLP.currentSlides[0].text.split("\n")[0] + '_transposeValue[0]',localStorage.getItem(OpenLP.currentSlides[0].text.split("\n")[0] + '_transposeValue'));//this line copies old format settings to new format settings
         localStorage.removeItem(OpenLP.currentSlides[0].text.split("\n")[0] + '_transposeValue');//this line removes old format settings
    }

  • edited March 2016
    Thanks @STEPHANVS
    I compare your changes to my code and I decided to upload my work to github (download as zip). I have some additional controls (chords on/off), print.html, .. etc. in it.
    So I will try to merge your changes to my code or .. you can do it better :)
    God bless you.

  • @tomasss: I could not yet find the time to look into "full involvement" in development, I hope this year I will manage to get in. In the meantime you are doing a favor for all of us by implementing.

  • Hi @STEPHANVS and @tomasss,
    I don't know if you've noticed, but OpenLP 2.4 have introduced Custom Stage View, which could be useful for your chords-stageview: https://manual.openlp.org/stage_view.html#custom-stage-views

    As mentioned earlier I've started a branch based on your work here. Will do some more work on it within a few weeks.
  • @tgc: thanks, will check it out

    I promise this will be my last contribution here, will catch up with the official contribution channels :D

    So, in one of my earlier posts I stated, that chord preference cannot be determined by algorithm, and songs have to have a chord property... I might have to contradict myself, as I did manage to work out a pretty close code for it in chords.js:

    var lastChord;
    var lastChordPreference;

    var chordSplit = chord.replace('♭', 'b').split('/'), transposedChord = '', note, notenumber, rest, currentChord, lastBass,
    var chordSplit = chord.replace('♭', 'b').split('/'), transposedChord = '', note, notenumber, rest, currentChord, lastChord, lastBass,

    notesPreferred = ['b', '#', '#', 'b', '#', 'b', '#', '#', 'b', '#', 'b', '#'];
    notesPreferred = ['-', '#', '#', 'b', '#', 'b', '#', '#', 'b', '#', 'b', '#'];

    lastChord = notesPreferred[notenumber] === '#' ? notesSharp[notenumber] : notesFlat[notenumber];
    lastChordPreference = notesPreferred[notenumber];
    if (notesPreferred[notenumber] === '#') {
    lastChord = notesSharp[notenumber];
    } else if (notesPreferred[notenumber] === 'b') {
    lastChord = notesFlat[notenumber];
    } else {
    lastChord = notesSharp[notenumber];
    }

    lastBass = notesSharp.indexOf(lastChord) === -1 ? notesFlat[notenumber] : notesSharp[notenumber];
    if (lastChordPreference === "#") {
    lastBass = notesSharp[notenumber];
    } else if (lastChordPreference === "b") {
    lastBass = notesFlat[notenumber];
    } else {
    if (notesPreferred[notenumber] === '#') {
    lastBass = notesSharp[notenumber];
    } else if (notesPreferred[notenumber] === 'b') {
    lastBass = notesFlat[notenumber];
    } else {
    lastBass = notesSharp[notenumber];
    }
    }

    Now transposing is reflecting my personal taste (hopefully correct one) of sharp/flat representation of chords.
  • edited May 2016
    I made some small mods to txt_to_openlyrics.html
    here is the result: txt_to_openlyrics_mod_01.html
    • added save button;
    • added [c] tag button for fast inserting "[c]" at cursor position
    • page fit well on small screens (mobile phones)
    OpenLyrics Gen v0.2
    Link will be available until August 31, 2016.

    David M.

  • I'm very impressed by the new OpenLP version 2.4.1 as it can display chords on a stage view for musicians on smart phones and it seems also on other PCs (I have not tried the latter). I have been looking for these features for about a year now and tried different song projection softwares (freeware). So OpenLP is the best till now and I hope that what you guys are coding here can be merged into the next release. So far it's rather difficult to figure out how to implement these features for people who are not familiar with tags and directory systems etc.

    We have been using OpenSong for many years and since a year with the OpenSong Tab App we can display songs on smartphones and tabs, but that is tedious to sync all the files. As we have several hundreds of songs in the OpenSong format and most of them have chords, I have been searching for a way to convert these and import them into OpenLP. I have tried the import feature in OpenLP but it strips out all the chords. The only thing that works is the file file txt_to_openlp_en.html (by tomasss), but that works only with copy and paste, convert in that page and then paste into the OpenLP lyrics editor. That's good and works well, but it's very tedious and time consuming for hundreds of songs. Could this be modified into a batch file or a small exe program so that it can be run with many song files. Or could it be included in the "import OpenSong songs" function of OpenLP? That would be a great help! Does OpenLP import lyrics with chords from any other file format? Thanks for all your work!
  • @JGE: Out of curiosity, what other freeware displaying chords did you try ?
Sign In or Register to comment.