Kara-Moon Forum
April 24, 2024, 09:34:30 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can go back to the main site here: Kara-Moon site
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Error  (Read 7295 times)
Piteur
Jr. Member
*
Posts: 13



« on: May 01, 2020, 04:21:21 PM »

Hello!

I'm having a curious problem.

Not understanding how to easily test the GROOVES embedded in MMA, I wrote 12 chord grid files, each one exploring 10 styles; I had each file processed by MMA. No problem at all. For instance, file01:

// Styles 1 à  9

Tempo 100
Groove Metronome2-4
z * 1

// 1
Groove 50srock
C
F
G7
E7
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 2
Groove 60srock
C
F
G7
E7
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 3
Groove 68march
C
F
G7
E7
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 4
Groove 68swing
C
F
G7
E7
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 5
Groove 8beat
C
F
G7
E7
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 6
Groove afro-cuban
C
F
G7
E7
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 7
Groove arpeggio4
C
F
G7
E7
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 8
Groove arpeggio68
C
F
G7
E7
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 9
Groove  arpeggiowaltz
C
F
G7
E7
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 10
Groove ballad
C
F
G7
E7
Am
Dm
D7
G7


I then wanted to do the same thing again with a single file, selecting, on the same principle, only the 4/4 grooves that I immediately liked (a selection of my favorites). As this:

// Styles Préférés ?

Tempo 100
Groove Metronome2-4
z * 1

// 001
Groove 50srock
C
F
G7
E7
Groove 50sRock1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 005
Groove 8Beat
C
F
G7
E7
Groove 8Beat1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 010
Groove Ballad
C
F
G7
E7
Groove Ballad1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 014
Groove Bebop
C
F
G7
E7
Groove BebopPlus
Am
Dm
D7
G7
Groove Metronome3
z * 1

// 015
Groove Beguine
C
F
G7
E7
Groove Beguine1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 022
Groove BoggieWoggie
C
F
G7
E7
Groove BoggieWoggie1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 023
Groove Bolero
C
F
G7
E7
Groove BoleroAlt
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 025
Groove BossaNova
C
F
G7
E7
Groove BossaNova1Sus
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 028
Groove BubbleRock
C
F
G7
E7
Groove BubbleRockPlus
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 032
Groove ChaCha
C
F
G7
E7
Groove ChaCha1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 035
Groove CountrySwing
C
F
G7
E7
Groove CountrySwing1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 040
Groove Dixie
C
F
G7
E7
Groove Dixie2
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 042
Groove DSoul
C
F
G7
E7
Groove DSoulPlus
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 049
Groove Folk
C
F
G7
E7
Groove FolkArticulated
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 050
Groove FolkBallad
C
F
G7
E7
Groove FolkBallad1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 052
Groove FolkyJazzGuitar
C
F
G7
E7
Groove FolkyjazzPiano
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 053
Groove FoxTrot
C
F
G7
E7
Groove FoxTrot1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 057
Groove HillCountry
C
F
G7
E7
Groove HillCountryPlus
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 062
Groove JazzRhumba
C
F
G7
E7
Groove JazzRhumbaPlus
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 068
Groove LightTango
C
F
G7
E7
Groove LightTango1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 070
Groove Mambo1
C
F
G7
E7
Groove Mambo3
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 073
Groove Merengue
C
F
G7
E7
Groove Merengue2
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 078
Groove ModernJazz
C
F
G7
E7
Groove ModernJazz1
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 080
Groove NiteJazz
C
F
G7
E7
Groove NiteJazzPlus
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 082
Groove PianoBallad
C
F
G7
E7
Groove PianoBallad2
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 084
Groove PopBallad
C
F
G7
E7
Groove PopBallad2
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 085
Groove Popspiritual
C
F
G7
E7
Groove PopspiritualPlus
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 088
Groove R&B-Ballad
C
F
G7
E7
Groove R&B-BalladPlus
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 090
Groove Rhumba
C
F
G7
E7
Groove Rhumba2
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 095
Groove Samba
C
F
G7
E7
Groove SambaSusPlus
Am
Dm
D7
G7


I receive the following message (the MID file is not generated):

piteur@MATERIEL-LX:~/Documents/MIDI FILES/STYLES MMA$ mma 'Aperçu des stylesPREF0.gril'
Error: <Line 219> <File:Aperçu des stylesPREF0.gril> No MIDI channel is available for BASS-HIGH, Try CHShare or Delete unused tracks


So I split the file in two, starting the second one at "//052" and adding at the beginning of the second one the tempo indications of the first one.

No problem with the 1st one (MID file well generated).

But new message with the second one:

piteur@MATERIEL-LX:~/Documents/MIDI FILES/STYLES MMA$ mma 'Aperçu des stylesPREF2.gril'
Warning: <Line 49> <File:/usr/share/mma/lib/stdlib/pianoballad.mma> Track BASS-
    ACCENT is shared with BASS. Changing voice may create conflict
Error: <Line 135> <File:Aperçu des stylesPREF2.gril> No MIDI channel is
    available for ARPEGGIO-LOW, Try CHShare or Delete unused tracks


In fact, if I give MMA
Tempo 100
Groove Metronome2-4
z * 1

// 080
Groove NiteJazz
C
F
G7
E7
Groove NiteJazzPlus
Am
Dm
D7
G7
Groove Metronome2-4
z * 1

// 082
Groove PianoBallad
C
F
G7
E7
Groove PianoBallad2
Am
Dm
D7
G7


… there's approximately the same bug
piteur@MATERIEL-LX:~/Documents/MIDI FILES/STYLES MMA$ mma TryPianoBallad
Warning: <Line 49> <File:/usr/share/mma/lib/stdlib/pianoballad.mma> Track BASS-
    ACCENT is shared with BASS. Changing voice may create conflict
Overwriting existing midi file (19 bars, 0.76 min / 0:45 m:s): 'TryPianoBallad.mid'


… but not with
Tempo 100
Groove Metronome2-4
z * 1

// 082
Groove PianoBallad
C
F
G7
E7
Groove PianoBallad2
Am
Dm
D7
G7


An idea? Any advice?

Many thanks…  Wink
« Last Edit: May 01, 2020, 04:27:20 PM by Piteur » Logged

Xubuntu 18.04 LTS
sciurius
Sr. Member
****
Posts: 443



« Reply #1 on: May 01, 2020, 05:15:07 PM »

Not understanding how to easily test the GROOVES embedded in MMA,

Have you tried the mma-gb tool that comes with mma?

Quote
piteur@MATERIEL-LX:~/Documents/MIDI FILES/STYLES MMA$ mma 'Aperçu des stylesPREF0.gril'
Error: <Line 219> <File:Aperçu des stylesPREF0.gril> No MIDI channel is available for BASS-HIGH, Try CHShare or Delete unused tracks


MMA requires a MIDI channel for each Track. The max. amount is 16. Most grooves use 3 or 4 tracks but quite often these are the same for different grooves. However, when using an enormous amount of unrelated grooves eventually you will hit the MIDI limit.

Note the use of 'unrelated'. Grooves that are designed to work together usually share the tracks.

If you run "mma -d 'Aperçu des stylesPREF0.gril' | grep MIDI" you can see the MIDI channels being allocated, starting with 10 for the all drums, and then 16, 15, 14, ..., until 1 -- and then you run out of channels.
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #2 on: May 01, 2020, 06:11:15 PM »

I guess the short answer is: Don't do this Smiley

Here's what's going on:

  1. you load a groove and that creates different voices. Each voice needs a "home" ... in this case the "home" is a MIDI channel. There are only 16 channels available in MIDI, and one (10) is reserved for drum tones.

  2. you load a new groove. It needs different voices. But, MMA never forgets things ... so a new voice needs a new channel. And, there are only 16 Smiley

There are solutions, none of which are "easy". For a detailed discussion see the manual section "ChannelShare" which details the problems (not MMA, but MIDI).

One quick solution would be use the "Delete" command before starting each section of your file. You could even use a macro and do the whole works: Delete $_TrackList. But, you'll get a whack of warnings about shared tracks ... not the best solution either.

I think it might be time to have a "ChannelReset" or "ChannelForget" command which will deal with this ... just dump out the current assignments and start over ... I don't see any problems with this and will do what I can in the next few days.

Lastly, to preview the "favorite" grooves ... you do know about the -V command line option? Much easier than a huge file (nearly 500 lines) that you have Smiley

Best,
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #3 on: May 01, 2020, 09:04:08 PM »

Just looked at some code ... we have a GrooveClear command that forces MMA to dump out existing definitions. I think we should add to that the non-destructive resetting of the MIDI channels at the same time. Comments?
Logged

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #4 on: May 02, 2020, 01:53:07 AM »

Still thinking about this ... and I _think_ a better solution might be to just reuse midi tracks when we run out. I _think_ the algorithm might be as simple as:

   - allocate a new track
       -- hmmm, all gone
             -- scan though the used ones and find the one
                 with the oldest entry in it.
             -- use that track. Print a warning(?)
   - continue.

My logic on this is that if all the tracks have been used up and we have a request for a new one it'll probably be just fine to append that to an existing, mostly not used anymore, track.

Comments?
 
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #5 on: May 02, 2020, 03:22:58 PM »

I would find it more logical to allocate MIDI tracks to MMA tracks based on track type. Just as all DRUM-* go to MIDI channel 10, you could do the same for all CHORD-*, BASS-* and so on.
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #6 on: May 02, 2020, 04:22:28 PM »

Good point. Thanks.

I've not started anything yet ... but thinking a bit about it all Smiley Next week I should have time.
Logged

My online life: http://www.mellowood.ca
Piteur
Jr. Member
*
Posts: 13



« Reply #7 on: May 03, 2020, 10:33:02 AM »

Have you tried the mma-gb tool that comes with mma?

No, I'm sorry: I don't understand its use. Where is the "howto" (if I can figure it out  Tongue) ?

Lastly, to preview the "favorite" grooves ... you do know about the -V command line option?

I don't understand how to link / connect MMA to Qsynth (or how to pass what it generates to a MIDI player -- VLC for example) .

I'm confused: there are definitely a lot of things I don't understand!  Sad  [ Thank you for your patience! ]

And first of all this: why don't instrument changes use program changes? In my personal MIDI files, I'm never limited by the 16 channels of the MIDI system (no musical piece with 16 simultaneous instruments, fortunately!).

For the record, I also sometimes use JJazzLab; I can apparently put as many groove changes as I want without ever getting "saturated"...

I would find it more logical to allocate MIDI tracks to MMA tracks based on track type. Just as all DRUM-* go to MIDI channel 10, you could do the same for all CHORD-*, BASS-* and so on.

That's it! (that's how I imagine it, with my little skills...)
 
« Last Edit: May 03, 2020, 11:22:36 AM by Piteur » Logged

Xubuntu 18.04 LTS
sciurius
Sr. Member
****
Posts: 443



« Reply #8 on: May 03, 2020, 02:05:07 PM »

MMA generates a midi file, you cannot directly connect it to Qsynth or other MIDI players.
Easiest is to install Timidity (if it is not already installed) and then configure in your .mmarc file:

SetMidiPlayer timidity

That should be sufficient to hear your songs. For example, "mma -P" will generate the midi file and play it immedeately.
Logged
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #9 on: May 03, 2020, 04:14:41 PM »

Of course MMA uses program changes. It's the only way to change instruments. The thing is that MMA doesn't want to clobber it's tracks and is quite conservative in this. A real-time program doesn't need to worry about the past ...

Hope it is all making sense Smiley
Logged

My online life: http://www.mellowood.ca
Piteur
Jr. Member
*
Posts: 13



« Reply #10 on: May 03, 2020, 05:42:45 PM »

Thanks, BDVP.

But I try to read the Manual and I see:

3.3 Track Descriptions

3.3.1 Drum
3.3.2 Chord
3.3.3 Arpeggio
3.3.4 Scale
3.3.5 Bass
3.3.6 Walk
3.3.7 Plectrum
3.3.8 Solo and Melody
3.3.9 Automatic Melodies

4.1 Defining a Pattern
4.1.1 Bass
4.1.2 Chord
4.1.3 Arpeggio
4.1.4 Walk
4.1.5 Scale
4.1.6 Aria
4.1.7 Plectrum
4.1.8 Drum
4.1.9 Drum Tone

Nothing exceeds 9 in each group (in between, some elements are obviously common).

Of course, I'm not a software designer  Undecided and, anyway, I don't know anything about how MMA actually works, but there is perhaps something in the order of optimization that must be achievable, I suppose. Isn't there?  Huh

In any case, I take a lot of pleasure in discovering the first/immediate possibilities of MMA, and I can only wish it works even better !  Smiley  Cheesy

Thank you very much for making this software available.

@SCIURIUS
Easiest is to install Timidity (if it is not already installed) and then configure in your .mmarc file:

SetMidiPlayer timidity

I'm really sorry, I've already tried that (I have read a little bit of the manual). I must be doing something stupid, because it's not working...

--- EDIT ---

Put into /usr/share/mma/includes/ the file : mmarc

mmarc has :

SetMidiPlayer timidity

Then :

piteur@MATERIEL-LX:/usr/share/mma/includes$ mma -d
Initialization has set LibPath set to ['/usr/share/mma/lib']
Initialization has set IncPath set to ['/usr/share/mma/includes']
Time: Time 4 TimeSig 4/4 Tabs=1,2,3,4.
Opening file 'mmarc'.
MidiPlayer set to 'timidity' Background=0 Delay=5.
File 'mmarc' closed.
MMA - Musical Midi Accompaniment
  Copyright 2003-19, Bob van der Poel. Version 20.02


But :

piteur@MATERIEL-LX:/usr/share/mma/includes$ mma -V 50sRock
Traceback (most recent call last):
  File "/usr/bin/mma", line 74, in <module>
    import MMA.main
  File "/usr/share/mma/MMA/main.py", line 67, in <module>
    MMA.options.opts()
  File "/usr/share/mma/MMA/options.py", line 205, in opts
    op = open(tfile, "w")
IOError: [Errno 13] Permission denied: 'MMAtmp10357.mma'


So :

piteur@MATERIEL-LX:/usr/share/mma/includes$ sudo mma -V 50sRock
Creating new midi file (4 bars, 0.13 min / 0:08 m:s): 'MMAtmp10587.mid'
Playing MIDI 'MMAtmp10587.mid' with timidity.
Requested buffer size 32768, fragment size 8192
ALSA pcm 'default' set buffer size 32768, period size 8192 bytes
Playing MMAtmp10587.mid
MIDI file: MMAtmp10587.mid
Format: 1  Tracks: 6  Divisions: 192
Sequence: MMAtmp10587
Text: Created by MMA. Input filename: MMAtmp10587.mma
Text: DURATION: 8
Track name: Drum
Track name: Bass-Sax
Track name: Walk
Track name: Chord-Piano
Track name: Chord-Sax


Hurrah! Yippee!


Questions:

  • Why should I use SUDO? Another solution to avoid it? (How do I get the temporary file to be written to "home"? Because that's the problem maybe...)
  • Is it possible to get a global demo of the different variants of a groove? (other than: sudo mma -V <grooveA> && sudo mma -V <grooveB>... )
  • Do I have to do mma -d at the beginning of each session, when I plan to test grooves?

Many thanks again…  Smiley


« Last Edit: May 03, 2020, 10:36:43 PM by Piteur » Logged

Xubuntu 18.04 LTS
sciurius
Sr. Member
****
Posts: 443



« Reply #11 on: May 04, 2020, 06:16:02 AM »

The MIDI file is written in the current directory. You run mma from /usr/share/mma/includes which is a system directory you do not have access to.

Just cd to your home and run mma from there.

@Bob: I must agree that MMA can use a tad bit of improvement here... Either use real temp files, or a better error detection and handling. For example (paths.py, around line 294)

Code:
    elif gbl.playFile:
        import tempfile
        # Currently MMA requires a file name. It would be nice if it
        # could handle file objects...
        # Since otherwise we need to throw away the file handle.
        #(fd,outfile) = tempfile.mkstemp( prefix="MMA", suffix=".mid" )
        outfile = tempfile.mktemp( prefix="MMA", suffix=".mid" )
        MMA.exits.files.append(outfile)

« Last Edit: May 04, 2020, 08:27:11 AM by sciurius » Logged
sciurius
Sr. Member
****
Posts: 443



« Reply #12 on: May 04, 2020, 06:18:58 AM »

Of course, I'm not a software designer  Undecided and, anyway, I don't know anything about how MMA actually works, but there is perhaps something in the order of optimization that must be achievable,

Hey, Bob already promised to address this. And he always keeps his promises.
Logged
Piteur
Jr. Member
*
Posts: 13



« Reply #13 on: May 04, 2020, 09:16:17 AM »

The MIDI file is written in the current directory. You run mma from /usr/share/mma/includes which is a system directory you do not have access to.

Just cd to your home and run mma from there.


OK. Understood, now.


Hey, Bob already promised to address this. And he always keeps his promises.


Sorry; as I often don't understand everything immediately, I forget that others do!
« Last Edit: May 04, 2020, 09:23:50 AM by Piteur » Logged

Xubuntu 18.04 LTS
bvdp
Kara-Moon Master
****
Posts: 1437


WWW
« Reply #14 on: May 04, 2020, 04:37:36 PM »

The "includes" directory is for mma patterns and things. It is not for library (groove) files or init files. The layout is use is:

    mma  -- a directory for all things MMA
       lib -- the various library files
       includes  -- the pattern defines, etc
       songs  -- the different songs I have
       plugins -- the various plugins

All of this, other than "songs" is created by the installer.

A mmarc file in includes will not be found. I think the docs are clear. In the section "Paths" it states:
Code:
 When MMA starts it checks for initialization files. Only the first found file is processed. The following locations/files are checked (in order):

    mmarc — this is a normal file in the current directory.
    ~/.mmarc — this is an “invisible” file in the users home directory.
    /usr/local/etc/mmarc
    /etc/mmarc

Hope this helps.

Logged

My online life: http://www.mellowood.ca
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.092 seconds with 19 queries.