Melodeon.net Forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the new melodeon.net forum

Pages: [1] 2   Go Down

Author Topic: Help please! ABC problem - need to debug tune  (Read 7012 times)

0 Members and 1 Guest are viewing this topic.

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping
Help please! ABC problem - need to debug tune
« on: January 22, 2011, 11:07:05 AM »

OK - here's one for all you ABC experts out there. I think I am usually fairly good at ABC coding, but this one has got me completely flummoxed.  :(

Here is a tune, 'New Venture Polka', written by my wife a few years ago for the Northumbrian Pipers' Society competitions, and transcribed into ABC by myself. The ABC coding of the melody on its own is basically OK - the syntax is fine and it all works as it should, playing nicely in Barfly 1.75 for Mac.

X:1
T:New Venture Polka
C:Janet Alton
L:1/8
M:2/4
Q:1/4=100
K:G
P:A
d/c/ |: Bd GG/F/ | EG cE | DG BG | A/G/F/E/ Dd/c/ |
Bd GG/F/ | EG cE | DG F/G/A/F/ |1 GB Gd/c/ :|2 GB GB/c/ ||
P:B
|: dd/B/ g>f |  eg cc/B/|  AF f>e | dd/c/ BB/c/ |
dd/B/ g>f | eg cc/B/ | AA/G/ F/G/A/F/ |1 GB GB/c/ :|2 GB G |]



The second setting below is an attempt to put a continuous G-D drone against the melody. It looks OK on staff notation display but it doesn't play correctly. The V:1 and V:2 fields in the header are MIDI instructions to make a rather dreamy sound on playback, and that's where I run into problems:

X:2
T:New Venture Polka
C:Janet Alton
V:1 program 1 46
V:2 program 1 4148
L:1/8
M:2/4
Q:1/4=100
K:G
[V:1] z2z  d/c/ |: Bd GG/F/ | EG cE | DG BG | A/G/F/E/ Dd/c/ |
[V:2] [G,4D4]- |: [G,4D4]- | [G,4D4]- | [G,4D4]- | [G,4D4]-|
%
[V:1] Bd GG/F/ | EG cE | DG F/G/A/F/ |1 GB Gd/c/ :|2 GB GB/c/ ||
[V:2] [G,4D4]- | [G,4D4]-| [G,4D4]- |1 [G,4D4]- :|2 [G,4D4]- ||
%
[V:1] |: dd/B/ g>f | eg cc/B/ | AF f>e | dd/c/ BB/c/ |
[V:2] |:  [G,4D4]- | [G,4D4]-| [G,4D4]-| [G,4D4]-|
%
[V:1] dd/B/ g>f | eg cc/B/ | AA/G/ F/G/A/F/ |1 GB GB/c/ :|2 GB G |]
[V:2] [G,4D4]-| [G,4D4]-| [G,4D4]- |1 [G,4D4]-:|2 [G,3D3] |]



As coded above, the playback of the melody is fine, but the accompanying drone cuts out halfway through bar 5, and I can't understand why.
I think the error is somehow linked to either the Q: (tempo) field in the header, or the ties (the "-" symbol in the drone coding [G,4D4]- ).

If I delete the tempo field Q:1/4=100 in the header the tune and drones play perfectly together throughout but at the wrong speed.
If I retain the tempo field Q:1/4=100 but delete the "-" symbols to give separated chords rather a continuous drone, it also plays perfectly together throughout at the correct tempo, but with separated chord accompaniment, which isn't what I want.

Barfly is also flagging up an error as "Tie (-) used as slur" on every bar (except the 1st time bars (interesting!) ). Well - I am not trying to use a tie as a slur. I really, really, intend this to be a tie; how else do I write code for a continuous drone?

In the PDF version (see attachment) which is generated from Barfly abcm2ps I am also slightly worried about the 1st and 2nd time bar nested bracketing in the drone lines. That doesn't look right and it may be indicative of the general error.

Any ideas as to what is wrong please?
I am using a registered version of Barfly 1.75 (the latest version I think) on an Intel Mac running Mac OS 10.4.11

Thanks for any help anyone can give!
« Last Edit: January 22, 2011, 11:15:09 AM by Steve_freereeder »
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Anahata

  • This mind intentionally left blank
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 6373
  • Oakwood D/G, C/F Club, 1-rows in C,D,G
    • Treewind Music
Re: Help please! ABC problem - need to debug tune
« Reply #1 on: January 22, 2011, 11:41:03 AM »

Purely a guess but does it work any better if you put the tie symbol after each note in the drone?
[G,4- D4-]
(I'm not even sure if that's legitimate)

Other than that, the discrepancy with the Q: header suggests a possible bug in barfly.

(disclaimer: I'm not an ABC language lawyer)
Logged
I'm a melodeon player. What's your excuse?
Music recording and web hosting: www.treewind.co.uk
Mary Humphreys and Anahata: www.maryanahata.co.uk
Ceilidh band: www.barleycoteband.co.uk

HallelujahAl

  • Guest
Re: Help please! ABC problem - need to debug tune
« Reply #2 on: January 22, 2011, 11:47:25 AM »

Can't help Steve - but it's a lovely tune, I've just played it through on the pokerwork and is really catchy - so many thanks to Jane!
AL
Logged

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping
Re: Help please! ABC problem - need to debug tune
« Reply #3 on: January 22, 2011, 11:58:24 AM »

Purely a guess but does it work any better if you put the tie symbol after each note in the drone?
[G,4- D4-]
(I'm not even sure if that's legitimate)
Thanks for the suggestion, Anahata!
Yes - it's legitimate, yes - I've already tried it, and no - it doesn't make any difference!

Quote
Other than that, the discrepancy with the Q: header suggests a possible bug in barfly.
Hmm... You could be right. I was afraid someone might say that.
The funny thing is that a few years ago (and a few versions of Barfly ago), I'm fairly sure that this method for drones actually worked as expected.
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping
Re: Help please! ABC problem - need to debug tune
« Reply #4 on: January 22, 2011, 11:58:57 AM »

Can't help Steve - but it's a lovely tune, I've just played it through on the pokerwork and is really catchy - so many thanks to Jane!
AL
Thanks Al! I'll tell Jan!
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Pete Dunk

  • Typo Expert
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3690
Re: Help please! ABC problem - need to debug tune
« Reply #5 on: January 22, 2011, 04:04:59 PM »

Again, I'm no kind of expert with abc at all but isn't it more usual to write the whole the of V:1 part followed by the whole of V:2? Does it make any difference if you write it that way?

I'm off to try the abc though the Tune-O-Tron, that will answer the question of whether it's a BarFly problem ...
Logged
Squeezing on the Isle of Oxney, UK
Primo (Serenellini) D/G
Isis D/G
Hohner B/E, G/C, C/F, Bb/Eb G/C/F
Liliputs D/G (G scale), C/F, Bb/Eb, Albrecht Custom D/G (G scale)

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Help please! ABC problem - need to debug tune
« Reply #6 on: January 22, 2011, 04:28:15 PM »

I've just tried it on abc2midi, and that gets it wrong too, the drone stops in about the second bar of the B part. No errors. Taking out the Q: line makes no difference, except to the tempo. It's doing the right thing, generating two note on commands at the start for the drone, but the timing is wrong. I checked this by starting it playing part way through and got no drone.

I also tried splitting the drone in half by taking out the tie at the end of the A part. I got an obscure error message about that, but the result was that it got it wrong twice.

It's a nice tune, we like it.  :||: :|||:

Edit: There's a facility in abc2midi for drones, which doesn't help with barfly

Code: [Select]
%%MIDI droneon

This turns on a continuous drone used in bagpipe music. The
drone consists of two notes (by default A, and A,,) played
on a bassoon at a MIDI loudness (velocity) 80. If you
can configure the drone sound using the %%MIDI drone command
described below.

%%MIDI droneoff

This turns off the drone.

%%MIDI drone n1 n2 n3 n4 n5

Configures the drone chord. n1 = MIDI program,
n2 = MIDI pitch 1, n2 = MIDI pitch 2, n4 = MIDI velocity 1,
and n5 = MIDI velocity 2. By default they have already
been set to 70 45 33 80 80.
« Last Edit: January 22, 2011, 04:36:43 PM by Bill the Farmer »
Logged
Bill of Old Shoreham Town

Anahata

  • This mind intentionally left blank
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 6373
  • Oakwood D/G, C/F Club, 1-rows in C,D,G
    • Treewind Music
Re: Help please! ABC problem - need to debug tune
« Reply #7 on: January 22, 2011, 05:04:07 PM »

Again, I'm no kind of expert with abc at all but isn't it more usual to write the whole the of V:1 part followed by the whole of V:2? Does it make any difference if you write it that way?

I think it completely doesn't matter. I've always done V1 and V2 lines interleaved. The software usually gets horribly upset if they don't have matching bars all the way though, but it doesn't car where you put the line
breaks.

I suppose anything's worth a try...
Logged
I'm a melodeon player. What's your excuse?
Music recording and web hosting: www.treewind.co.uk
Mary Humphreys and Anahata: www.maryanahata.co.uk
Ceilidh band: www.barleycoteband.co.uk

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping
Re: Help please! ABC problem - need to debug tune
« Reply #8 on: January 23, 2011, 06:53:25 PM »

Thanks for all the suggestions everyone. I'm still no nearer to solving the problem, other than thinking it might be a general ABC bug.
I'm pleased you like the New Venture tune  (:). It was originally written for smallpipes but it goes well enough on melodeon or concertina.
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

nemethmik

  • Guest
Re: Help please! ABC problem - need to debug tune
« Reply #9 on: January 24, 2011, 08:29:09 AM »

it might be a general ABC bug.
ABCMUS http://www.norbeck.nu/abcmus/
plays the tune as expected.
Logged

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping
Re: Help please! ABC problem - need to debug tune
« Reply #10 on: January 24, 2011, 08:54:16 AM »

it might be a general ABC bug.
ABCMUS http://www.norbeck.nu/abcmus/
plays the tune as expected.
Thanks, Miklos!
If it works properly on ABCMUS, it suggests that my problem could be a Barfly bug, not an error in my coding. ABCMUS is not MacOS software though  :(
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

nemethmik

  • Guest
Re: Help please! ABC problem - need to debug tune
« Reply #11 on: January 24, 2011, 09:12:49 AM »

If it works properly on ABCMUS, it suggests that my problem ... not an error in my coding
Really nice pipe-tune! Thank You for sharing.
The attached file is MIDI. Save the file and delete the MP3 file extension to make it playable.
UNfortunately files with MID extensions are not supported to upload.
Logged

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping
Re: Help please! ABC problem - need to debug tune
« Reply #12 on: January 24, 2011, 03:25:45 PM »

If it works properly on ABCMUS, it suggests that my problem ... not an error in my coding
Really nice pipe-tune! Thank You for sharing.
The attached file is MIDI. Save the file and delete the MP3 file extension to make it playable.
UNfortunately files with MID extensions are not supported to upload.
Miklos - thanks for the MIDI file!
It plays OK, but it is still not working as intended. In your midi file, the drones are restarting every bar, so you hear a distinct pulse, instead of a continuous smooth sound. This means that ABCMUS is not recognising the ties over the barlines, and therefore the same bug is present.
Thanks for trying anyway.
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Jim

  • Good talker
  • **
  • Offline Offline
  • Posts: 56
Re: Help please! ABC problem - need to debug tune
« Reply #13 on: January 24, 2011, 08:17:44 PM »

I ran this through abc2midi and then ran the output through midi2abc. The drone was rendered as:
Code: [Select]
L: 1/16

[D8-G,8-]|[D8-G,8-]|[D8-G,8-]|[D8-G,8-]|
[D8-G,8-]|[D8-G,8-]|[D8-G,8-]|[D8-G,8-]|
[D8-G,8-]|[D8-G,8-]|[D8-G,8-]|[D8-G,8-]|
[D8-G,8-]|[D8-G,8-]|[D8-G,8-]|[D8-G,8-]|
[D8-G,8-]|[D8-G,8-]|[D6G,6]
which looks correct although formatted slightly differently to the original. This suggests the midi conversion is happening properly.

I played the midi file and the drone dropped out after a while. I think that your problem is that the midi player has some kind of timeout that prevents a note being held on too long (in case of corrupted midi file or whatever). This would also explain why different people are seeing the drone held for different amounts of time.
Logged

Québécois

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1206
  • Accordez-vous donc, c'est si beau, l'accordéon!
Re: Help please! ABC problem - need to debug tune
« Reply #14 on: January 24, 2011, 09:47:16 PM »

It can indeed have to do with the software implementation of the MIDI functions in ABC.

When you look at a MIDI file, the start of a note (Note On) and the end of a note (Note Off) are two different messages.

A note that has infinite sustain (such as an organ note, as opposed to guitar or percussion) will sound until the -Note Off- is received. For example, if you are using a MIDI keyboard, then the note will sound until you release the key, sending a -Note Off- message.

In the present case, the program would need to send the -Note On- for the drone at the beginning of the tune, and the -Note Off- at the very end.
« Last Edit: January 24, 2011, 09:49:28 PM by Québécois »
Logged
Hohner Morgane D/G, pre-Erica Hohner in C/F and G/C,
Hohner Erica A/D, Roland FR-18

Stiamh

  • Old grey C#/D pest
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3541
    • Packie Manus Byrne
Re: Help please! ABC problem - need to debug tune
« Reply #15 on: January 25, 2011, 02:48:54 AM »

If it's any consolation, in abcmus a single-note drone plays correctly across the bar lines ( e.g. G,4- |: G,4- | G,4- | etc.).

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping
Re: Help please! ABC problem - need to debug tune
« Reply #16 on: January 25, 2011, 07:15:33 AM »

I think that your problem is that the midi player has some kind of timeout that prevents a note being held on too long (in case of corrupted midi file or whatever). This would also explain why different people are seeing the drone held for different amounts of time.
and
It can indeed have to do with the software implementation of the MIDI functions in ABC.
....
In the present case, the program would need to send the -Note On- for the drone at the beginning of the tune, and the -Note Off- at the very end.
Thank you both! I think you could well be on to something here. It is possible that there is a bug in the Barfly source code which is preventing this from happening. I am convinced that in earlier versions of Barfly this problem did not occur, as I have an old midi file generated by an earlier version of Barfly in which the drones played perfectly. I have attempted to contact Phil Taylor (author of Barfly) for his comments, but so far no reply (the Barfly software is quite old and the quoted e-mail address may no longer be valid.)

If it's any consolation, in abcmus a single-note drone plays correctly across the bar lines ( e.g. G,4- |: G,4- | G,4- | etc.).
Thanks, Steve! I tried this in Barfly, but unfortunately it still doesn't work for me. :(
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Steve_freereeder

  • Content Manager
  • Hero Member
  • ***
  • Offline Offline
  • Posts: 7511
  • MAD is inevitable. Keep Calm and Carry On
    • Lizzie Dripping
Re: Help please! ABC problem - Reply from Barfly author
« Reply #17 on: January 27, 2011, 09:56:25 AM »

I sent an e-mail to Phil Taylor, the author of Barfly, outlining my problem and received this very comprehensive reply, which I'd like to share with you all.....

> Dear Phil,
> I was wondering if you could please help. I am trying to get a continuous two-note
> drone to play under a melody, but the drones won’t play properly. It looks
> OK on staff notation display but it doesn't play correctly.


You are up against a serious problem here, and I don't see any proper solution.  The trouble is that there is a limit to the longest note that Quicktime Music can play (at least when that note is incorporated into a tune).

> As coded above, the playback of the melody is fine, but the accompanying
> drone cuts out halfway through bar 5, and I can't understand why. I think
> the error is somehow linked to either the Q: field in the header, or the
> ties (in the drone coding [G,4D4]- ).
>
> If I delete the tempo field Q:1/4=100 in the header the tune and drones play
> perfectly together throughout but at the wrong speed.


It is simply that the tune is being played faster, so the maximum duration of the drone notes is long enough to last until the end of the tune.  If you correct the tempo by changing the default tempo in Player Preferences you will find that it still stops before the tune is over.

> If I retain the tempo field Q:1/4=100 but delete the "-" symbols to give
> separated chords rather a continuous drone, it also plays perfectly together
> throughout at the correct tempo, but with separated chord accompaniment,
> which isn't what I want.
>
> Barfly is also flagging up an error as "Tie (-) used as slur" on every bar
> (except the 1st time bars (interesting!) ). Well - I am not trying to use a
> tie as a slur. I really, really, intend this to be a tie; how else do I
> write code for a continuous drone?


Technically it's bad abc to write [G,4D4]- | [G,4D4]- | etc. as the standard says that the tie has to be written next to the previous note, so you should write: [G,4-D4-] | [G,4-D4-] |.  That will tie both notes of the chord in the music as well.  BarFly thinks that you're trying to write slurs because of this (but it tries to make ties anyway).

This is what you said, Anahata! (:)     Phil continues........

BarFly can play drones in bagpipe music (it's a special exception which is only used when the K: field contains Hp or HP and you have selected bagpipe as the instrument for playing).  It does so by using a different method of generating the notes, basically by turning them on at the start of the tune and then turning them off at the end, so they are not actually part of the tune.

I've tried a number of work-arounds to see if I can get the effect you want.  I tried using the "Highlight Note Played" (which uses another playing method), but that doesn't work either (although it gives you an entertaining error message).

The nearest I can get is to use the "Play note" command from the Play menu to turn the drones on manually.  If it's not there already, use the Add an Instrument command to select the Choir Aahs2 sound. Then choose Play note to start it playing a G and then a D.  Then play the tune.  When the tune is over use Command-period to stop the drones. Not ideal I'm afraid. but it's the best I can do.

Cheers
Phil


So - there you have it; it's a QuickTime thing (see above), and not really solvable in current versions of BarFly and QuickTime. The fact that I got this to work a few years ago suggests that an older version of QuickTime didn't have the maximum note length specification, or else handled -Note On- and -Note Off- commands differently from now. 

Many thanks to all who have tried to help me. I do like this forum.  (:)
Logged
Steve
Sheffield, UK.
www.lizziedripping.org.uk

Bill the Farmer

  • Not quite so
  • Respected Sage
  • ****
  • Offline Offline
  • Posts: 497
  • Hohner Club, Liliput...
    • Bill Farmer
Re: Help please! ABC problem - need to debug tune
« Reply #18 on: January 27, 2011, 03:18:23 PM »

For the interest to anyone perusing this thread later, I tried out the droneon and droneoff midi commands that I posted about before with abc2midi and couldn't get it to work at all.
Logged
Bill of Old Shoreham Town

Stiamh

  • Old grey C#/D pest
  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3541
    • Packie Manus Byrne
Re: Help please! ABC problem - need to debug tune
« Reply #19 on: January 27, 2011, 03:44:38 PM »

No consolation department, again: Abcmus has a "Drone" field in the "Play tune" dialogue which accepts multiple notes (I tried up to 5 with success anyway).

This attached midi file renders Jan's tune using accordion for the melody and clarinet for the drones. I took a leaf out of Miklos' book and renamed it with a .doc extension so that I could attach it here.

Pages: [1] 2   Go Up
 


Melodeon.net - (c) Theo Gibb; Clive Williams 2010. The access and use of this website and forum featuring these terms and conditions constitutes your acceptance of these terms and conditions.
SimplePortal 2.3.5 © 2008-2012, SimplePortal