"compose" package (music composition) for Puppy Linux

Stuff that has yet to be sorted into a category.
Message
Author
jeffrey
Posts: 168
Joined: Mon 16 Jan 2006, 04:20
Location: Christchurch, New Zealand

#16 Post by jeffrey »

mcewanw, I did upload the package and asked Mark to make it available (via a personal message) but got no response, hence my rather clumsy solution of providing it in two parts. The piano voice is timidity's default. If you want something else modify the timidity call in the compose script to use a different 'voice' - there's a sample line there for banjo instead - look in the directory indicated to see what the possible voice names are.

Richard, I've attached a modified compose for you to try. This gives sub-directories. I could probably improve on it but it's a start. The Help button in Xdialog doesn't seem to give the option to link to a URL. I'll think about that...
Attachments
compose-1.0.3.gz
(4.2 KiB) Downloaded 354 times

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

he must have missed your message I think

#17 Post by mcewanw »

jeffrey wrote:mcewanw, I did upload the package and asked Mark to make it available (via a personal message) but got no response
Hmmm, I uploaded a couple of apps via Mark recently with no such problem. I suspect he missed your message. I can imagine he gets a lot of mail. I suggest you try again, if you like; its such a good package, I think it would be good to have it stored as one big file.
jeffrey wrote:modify the timidity call in the compose script to use a different 'voice' - there's a sample line there for banjo instead - look in the directory indicated to see what the possible voice names are.
That's great. Thanks. Aaaaagh, music to my ears, I have it playing bagpipes now! :-)

timidity -id -Od $Music.midi --polyphony=2 -x 'bank 0\n0 /usr/local/share/timidity/instruments/bagpipes.pat'
[extract from the slightly modified /usr/local/bin/compose script]

Sorry to pester you with another question, since I'm sure I could find documentation for timidity somewhere on the net. But to save time, the next step up: can it play more than one instrument at a time? Timidity is a pretty big package, so I'm imagining it must be so capable. I'll do a google anyway.

Well, I still don't know how to use two or more instruments from timidity commandline options, but it seems to be possible according to web pages on timidity. For example, the windows frontend to timidity, shown at the link below, clearly shows several tracks, each with a different instrument. If you can point me to more definite info I'd be grateful, thanks. My daughter is learning/playing sax in school jazz-band; she is going to love this program I'm sure!. Windows OS frontend images:

http://timidity.s11.xrea.com/index.en.html#cfgs

ricstef
Posts: 52
Joined: Wed 02 Aug 2006, 02:25
Location: Woodstock, ON. Canada

Compose pkg feature to categorize your music

#18 Post by ricstef »

Hi Jeffrey,
I am a little unsure what all you intended with the "sub directories" feature. Could you please elaborate on how you want us to understand the second dialog.

Code: Select all

"Enter a short title for the music e.g. 'my_music', 'classics/beethoven5'" 
Cheers,
Richard

jeffrey
Posts: 168
Joined: Mon 16 Jan 2006, 04:20
Location: Christchurch, New Zealand

#19 Post by jeffrey »

mcewanw, timidity is able to map different channels to different instruments (but I don't know how to do that either); pmw can produce output for different midi channels using the midichannel directive, although the author does indicate that his midi output is basic. Search through the PMW specification PDF for "midi" and that should give you a good lead. Look especially at midichannel. If you work i out a posting would be appreciated. Some URLs that may help are:
http://linux.die.net/man/1/timidity
http://www.zogotounga.net/GM/GMtimidity.html
Once the current changes settle I'll re-issue it and ask Mark again so that it can be downloaded as one pet file.

Richard, the idea of the sub-directories is that the separate pieces can be grouped by directory. You can have one directory for classics, one for pop, and one for personal. This would give you the option for grouping your pieces by genre, eg genre1/piece1, genre1/piece2, genre2/piece1, genre2/sub-genre1/piece1, etc. Not very pretty but it should work. If this is an important extension I should probably change the music selection window to a more general file browsing window.
Let me know if it's any use. If not, let me know what would work.

I'd be interested in hearing how easy/difficult it is to write music with this interface. Is it next to useless, as good as anything else out there, or really fast and efficient? I'm not trained in music, don't have perfect pitch, etc, so it's a laborious effort for me to generate even the simplest piece, but a musician may have a different perspective.

ricstef
Posts: 52
Joined: Wed 02 Aug 2006, 02:25
Location: Woodstock, ON. Canada

compose pkg

#20 Post by ricstef »

Jeffrey,
Ok, we are talking about the same functionality / need. I think you are trying to do too much for the user and coding too strictly to how I worded my previous request. It wasn't till I played with it for a while that it dawned on me that I find myself at the directory selection window for more than one reason. Each reason invoking different needs.
a) If I want to enter a new song, then what you did is the most efficient way to get there. However,
b) If I'm looking for a song that I entered some time ago and I don't remember how I spelled the name, (whether I used abbreviations or not, or underscores etc) then I can't get there from here. [ I exaggerate for effect ]

So, what I'm thinking now is: a two step selection system works better for the end user to find previously entered songs. And it's no burden for someone wishing to enter a new song either. How I envision it is:
1) The first dialog displays the option for creating a new directory plus the contents of your $BasDir which shows all the already established categories (directories). The same as you had for selecting a file name. I like this method: 1-click-selection ... no spelling mistakes !!
2) The second dialog: exactly the same as you had originally done. I can see what's in that folder. a) if it's not there: create new file. b) if it's there: 1-click-to-select ... no spelling mistakes !! So, the file opens and then comes ... music to my ears. ;-)

Please understand that I am enthusiastic about this concept based on what I have learned so far. It won't hurt my feelings one bit if you tell me that I missed something which invalidates my suggestion. I believe that by this kind of dialogue the functionality can grow and improve incrementally to most peoples satisfaction. Most of the hard technical concerns seem to be solved already. Making the user interface really intuitive is the next challenge and can be just as challenging as the technical nitty gritty.

You mention:
" If this is an important extension I should probably change the music selection window to a more general file browsing window. "
I leave the choice up to you. If you know that this kind of functionality is better realized by that means, fine.
I'm just making suggestions that seem relevant to me. I am sure others will come up with more and different ideas still.

Cheers,
Richard.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

other software

#21 Post by mcewanw »

jeffrey wrote:I'd be interested in hearing how easy/difficult it is to write music with this interface. Is it next to useless, as good as anything else out there, or really fast and efficient?
I haven't been able to try anything else, though I've been looking around and have become interested in three other packages:

"Rosegarden" http://www.rosegardenmusic.com/
"NoteEdit" http://abcplus.sourceforge.net/#noteedit
"ABC Plus" http://abcplus.sourceforge.net/

The problem with the first two is that they seem to require KDE, and I have a feeling that that would be a big load on my minnow of a system. I believe both of these can also use Timidity if you want them to.

"ABC Plus" may be an interesting alternative, but I haven't had time to look into it further as yet. It seems to provide a similarly fast textual means of entering music as PMW. ABC Plus builds upon the facilities offered by ABC ( http://www.walshaw.plus.com/abc/ ). I like your interface to the PMW/Timidity combination; being written with bash and Xdialog it's relatively easy to modify. However, it would be nice to have a package that was inherently more interactive with both the music score and the textual representation, which is no criticism of your work; there is a limit to what you can do with the underlying packages. Timidity itself puts quite a heavy load on my system actually (seems to occupy a fair amount of memory). That said, the program works well and is very useful indeed.

Here is some blurb about ABC Plus, though you may well know about the package already:
ABC plus website wrote:I find that the ABC music notation language is a wonderful tool to typeset sheet music. ABC is one of the best designed, easy to use, well-thought out, and nicely implemented notation formats I've ever seen: IMHO, it surpasses other good notation languages like GNU Lilypond or MusiXTeX. (Philip's Music Writer is a serious contender though.) You can write music in a very simple ASCII format and convert it to MIDI, or typeset it to make professional-looking scores. . . . The only serious problem with ABC is that it was originally designed for melody, not for harmony. In simple words, this means that you can only write music for a single instrument or voice. . . . Some ABC applications implement unofficial extensions to the ABC language that make it possible to write polyphonic music. Low-level details (formatting and MIDI effects) are supported too. The purpose of the ABC Plus project is to provide software and documentation for this extended ABC.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

nice structure

#22 Post by mcewanw »

I must say jeffrey, I'm expressed with your coding style: nicely structured, good indentation, well-commented, and skilled use of unix utils. It's great that base Puppy contains all these scripting facilities, though when the interface becomes complicated, like this one, it must a bit of a battle trying to control it all. It would no doubt be easier with Python, but its great if you can manage without needing to load up the system with these bulkier higher level scripting languages. I'm pretty sure a lesser programmer would have lost their way long ago in a tangle of spaghetti! :-)

Taavi
Posts: 146
Joined: Fri 10 Mar 2006, 19:23
Location: Suomi, Finland

#23 Post by Taavi »

Hi,

this looks interesting. I have to take a look. I have done my notation works with abc. There is a dotpup for it in http://dotpups.de/dotpups/Multimedia/
as there are one for Rosegarden too in http://dotpups.de/dotpups/Multimedia/to ... c-apps-05/

To get abc dotpup working properly look here:
http://murga-linux.com/puppy/viewtopic. ... 65&t=14203

Rosegarden was kind of tricky to get going but here's jamesbonds instructions for it
http://murga-linux.com/puppy/viewtopic. ... 41&t=21239

I hope I'll soon have time to study this one.

Taavi

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

abc and rosegarden dotpups

#24 Post by mcewanw »

Taavi wrote:abc. There is a dotpup for it in http://dotpups.de/dotpups/Multimedia/
as there are one for Rosegarden too
Now that you mention it, I remember seeing them in there. How up-to-date are these dotpubs [freudian slip; I mean pups of course!] in terms of version number? Does the Rosegarden one need a lot of resources because of KDE like I wondered, or does it just use a few kde libraries? Do they run fine on Puppy 2.17 or any latest Puppy version without messing any current libraries or configurations up?

I must try both of them out.

The other thing I'm about to try is Fluidsynth as an alternative to Timidity. Any idea about the advantages and/or disadvantages of each?

Taavi
Posts: 146
Joined: Fri 10 Mar 2006, 19:23
Location: Suomi, Finland

#25 Post by Taavi »

I tried this nice one tonight. Just a quick look - but I like it. It goes basic way and that's fine. I like to write notes in text format as you get used to it it's faster and easier as do it with mouse and stave.

Only thing is that I have used abc for my notation and I hesitate to learn a new notation language.

The upgrading notation window is excellent - it made me wonder is there way to make something like that to work with abc too.

But anyway this looks good and thanks for it.

Rosengarden dotpup is of the newer serie. To get the midi working with it I had to get the Fluidsynth too.

jeffrey
Posts: 168
Joined: Mon 16 Jan 2006, 04:20
Location: Christchurch, New Zealand

#26 Post by jeffrey »

Thanks for all of your feedback. What a constructive project Puppy Linux is, and what a helpful, international community!

Richard, I've attached version 1.0.4 which may do what you want - a category selection followed by a title selection. The base directory is changed from my-documents/music to my-documents/compose since existing directory structures will confuse this version, but the base directory is now stored in /root/.compose-settings so you can relocate it whereever you want (but you have to move the files and directories youself of course). Note that such selection windows often have several functions: create, delete, change, and search. I'm only allowing the create and search functions in my interface, which are two quite different functions when you think about it. It does become complicated when the same interface is used for multiple purposes. I haven't tested Xdialog radio buttons with more than 12 songs in a folder so I don't know how large it can go without exploding! Thanks for your patience.

William (mcewanw), I also have a small, slow machine which is why I like the PMW/Timidity option. Let me know if you find anything else as small and easy to install. My apologies for the spaghetti - I've been using Unix shell for 25 years and it's my top computer skill. If it looks awful just take the line apart, piece by piece, and see what it does, i.e. cut and paste it into an rxvt window. I should add more comments still in case someone wants to modify it to their liking but is frightened by the code. The fact that I'm using standard Unix tools gives it good portability and hence more atractive (although Puppy's 'ps' isn't standard, but Barry's about to change that). Thanks for your encouragement.

Taavi, thanks for your encouragement too, and also for the links. I haven't installed alternatives because there weren't any that I could find when I wrote this wrapper for PMW/Timidity years ago, and I haven't had the time or interest to do comparisons since this system works fine for my small needs. My interface is rather crude, I'm afraid, but it's functional, which was all that I wanted. The Exit button doesn't always kill the gv window for some reason, but I can live with that. I shouldn't have replaced Barry's gv with mine, but when I first created it his gv was simply a symbolic link (to gsview I think). Now he's included a real 'gv' but it doesn't have the ability to watch the file that's open, updating the display as the file changes (which is a really great feature of the gv that I took from Fedora Core 2). And it's small too at 280kB! Perhaps I should leave Barry's gv alone and rename my version... Thanks for letting me know that you find it faster to code music in text fromat as opposed to using a mouse to drop notes on a stave. I would have thought the opposite would be true, but I'm not a musician and have to do it all by trial and error. It took me 10 minutes to get the first two bars of Beethoven's 5th symphony right, and I'm bound to have the wrong key, and probably time signature and notes too, but it sounds close enough. [Musicians cringe everywhere!]
Attachments
compose-1.0.4.gz
(4.4 KiB) Downloaded 318 times

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

not spaghetti

#27 Post by mcewanw »

jeffrey wrote:My apologies for the spaghetti - I've been using Unix shell for 25 years and it's my top computer skill. If it looks awful just take the line apart, piece by piece, and see what it does, i.e. cut and paste it into an rxvt window.
You must have misunderstood me. I meant to say "impressed" not "expressed"..! Far from being spaghetti, your code is very well structured. That's what I was trying to say.

Cheers

William

Taavi
Posts: 146
Joined: Fri 10 Mar 2006, 19:23
Location: Suomi, Finland

#28 Post by Taavi »

Hi,
I also appreciate programs that just do what they are supposed to do without useless extras. In Linux I like the possibility to make it do exactly what you want. I looked at your script - to learn - because I'm so in the beginning.

I still decided to stay with abc - I have used it so long. This is kind of impolite because this thread is for your nice compose package but I like to tell my invention with abcing.

First I found Jedabc from here : http://abcplus.sourceforge.net/

With Gslapt I installed Jed and Slang and I got it working and it is kind of functioning system - with the gv from this compose package. But then I figured out a really basic way. I made three scripts - and with my skills they are huge:

#!/bin/bash
cd ~/workfolder
abcm2ps *.abc | gv *.ps

and

#!/bin/bash
cd ~/workfolder
abcm2ps *.abc
abc2midi *.abc

and

#!/bin/bash
cd ~/workfolder
timidity -ig -Od -A 590 *.mid

And I configured keyboard shortcuts in JWM for eachscript.

Then I use Leafpad or Geany to write abc file and save it to workfolder and with those scripst and the gv version I got from your package I have real time ps and midifiles for the abc file I'm writing with text editor. I'll write fourth script to move finished notations from workfolder - I guess that is in the limits of my talents.

Yes - I found it easier and faster to write notations from keyboard - systems like abc and pmw makes it possible.

Sorry about using Your thread for my questionable intentions.

Taavi

jeffrey
Posts: 168
Joined: Mon 16 Jan 2006, 04:20
Location: Christchurch, New Zealand

#29 Post by jeffrey »

Taavi, you're quite welcome to suggest better (or alternative) tools and to compare tools. I haven't used abc so I'm interested to hear about it. I'll stick with pmw for the present, but if someone asks me what's the best tool for a particular situation I won't be limited by my own experience.
One of the problems in computing is the difficulty in migrating from one package to another. If the text format of abc is similar in structure to pmw it may be possible to write a conversion script to change an abc file into a pmw one or vice versa. Please paste a stave of abc text to see how it compares with pmw, which looks like this:

Code: Select all

[stave 1 treble 1 text underlay]
"Doe a deer, a fe-male deer, Ray, a drop of gol-den sun,"
c. d- e. c- | e c E | d. e-; f- f-; e- d- | F+ | @ bars 1-4
[newline]
By the way, I wonder if your code "abcm2ps *.abc | gv *.ps" is correct. I suspect that abcm2ps is a program to converts a list of .abc files into .ps ones and doesn't send output to stdout. But you have abcm2ps's stdout ("standard output") piped into the stdin ("standard input") of gv. I don't recall that gv reads ps files from stdin. I suggest that these commands should not be connected together with a pipe (which sends the output of the first to the input of the second), but rather as two separate commands, each on a line by itself (so that abcm2ps runs first and finishes before gv starts).
My compose script started off like your small scripts. Small is beautiful - don't be concerned about that! I just found more functions that I could add to my script to save me from having to type our use the mouse, and slowly it grew...
JWM shortcuts are a great feature, making a very simple interface for your music development system. Well done.

Taavi
Posts: 146
Joined: Fri 10 Mar 2006, 19:23
Location: Suomi, Finland

#30 Post by Taavi »

Thanks for advice,

here's your example in abc, I hope it's correct:

Code: Select all

X: 1 (Beginning tag - numbering for songbook)
T:  (title of song)
M:4/4 (meter)
L: 1/8 (default note lenght)
K:C (key)
C3 D E3 C  |  E2 C2 E4  |  D3 E F F E D | F8 |
w:Doe a deer, a fe-male deer, Ray, a drop of gol-den sun.
In abc you set a default note lenght and then it requires a little mathematics.

Abc was originally written for melody, but abcplus can handle up to 16 voices (more by compiling the source).

Taavi

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

default note length

#31 Post by mcewanw »

From a quick glance at your music codes above, it looks to me like the main difference between pmw and abc is in the way of representing the default note length; otherwise they look very similar indeed.

ricstef
Posts: 52
Joined: Wed 02 Aug 2006, 02:25
Location: Woodstock, ON. Canada

compose pkg

#32 Post by ricstef »

Hi Jeffrey,
Sorry for taking so long to get back to you. Life getting in the way of my hobbies...
I got version 1.0.4 some time ago and am very happy to report that it does exactly what I asked for. Nice job 8) I spent quite some time working with it. I too find entering music score this way, faster than using a graphical point and click method. One would think that it would be the other way around but experience shows otherwise. What I use it for is to score and listen to hymns that I want to learn for our church choir. So I make extensive use of your "Re-run" button while I practice by myself.
1) Your code prevents me from using capital letters in song titles. After working with it for a while, it became clear to me that it is not easy to make out the titles when the words are all squished. And I don't want to make the titles any longer by adding dashes or underscores. My preference is to use capitals at the start of words with no intervening spaces. So the name does not become too long.
As a proof of concept, I made a small change to line 138 of compose-1.0.4.
was:

Code: Select all

	Music=`echo $Music | tr '[A-Z\ ]' '[a-z\_]'`
changed to:

Code: Select all

Music=`echo $Music | tr '[\ ]' '[\_]'`
Since I only wanted the title of songs to include capitals, that was all I changed. Now I find it easier to pick out the name I'm looking for.

2) Something I noticed in the Select sheet music name window is that the names appear unsorted. Is there a way that they could be displayed in sorted order? This would also aid finding what you're looking for.

3) I believe the group that is working on ChurchPup have earmarked your package to be included in their creation. Since you've refined and expanded it's functionality, this may be a strategic time :wink: to bundle the whole thing as a dotPet or what ever and upload it to MU like someone suggested.

BTW I tried it in Puppy-3.0 final and it looks good.

Cheers,
Richard.

Post Reply