Author Topic: Looking for CLB file format specification, but CLD editing out of keyboard  (Read 1495 times)

0 Members and 1 Guest are viewing this topic.

Offline acorrias

Hi all,
I am a new owner of yamaha keyboard provider wih chord looper. I wish to develop an app to edit and save a clb file.

Is there someone that could share clb file format specifications?

thanks in advance

acorrias
« Last Edit: December 17, 2022, 01:32:34 PM by acorrias »
 

Offline pjd

Re: Looking for CLB file format specification
« Reply #1 on: December 14, 2022, 11:51:15 PM »
Welcome to Yamaha arrangers!

Unfortunately, Yamaha does not publish file formats (styles, multi-pads, chord looper, etc.) So, you have some work ahead of you.  :o

I recommend checking out this thread:

https://www.psrtutorial.com/forum/index.php?topic=52806.0

It contains a few clues about file formats. I have posted related information, too:

http://sandsoftwaresound.net/step-edit-chord-looper/

This post is about the CLD format. CLB files appear to be structured files containing eight slots. Each slot contains a snippet of MIDI (in SMF format) is a MIDI chord sequence itself.

I didn't work out CLB format because CLD was good enough to do what I needed to do.   :D

Hope this helps -- pj
 
The following users thanked this post: acorrias

Offline acorrias

Re: Looking for CLB file format specification
« Reply #2 on: December 15, 2022, 01:44:03 PM »
thanks.
I would like to develop a web app that lets you edit a chord file and download it in order to load inside genos/psx sx900.
that is a online tool that could be useful also for general users looking for standard chord progressions

ac
 

Offline tbaroghel

Re: Looking for CLB file format specification
« Reply #3 on: December 15, 2022, 03:04:43 PM »
Hi Acorrias,

I support your initiative, as I see two complementary objectives in it:
  • Enter 'difficult' progression off-line and use them live afterwards
  • Exchange such files with other users
Unfortunately, I do not think I can help you with the programming (I am stuck in the Visual Basic era), but one never knows. A least I can betat-test !

Best,

Thierry
Humbly returning to arrangers after many years, with a PSR-SX900
 

Offline pjd

Re: Looking for CLB file format specification
« Reply #4 on: December 16, 2022, 12:17:19 AM »
Hi --

Thanks for your question because it finally prodded me to post the Java code for my ChordPro to auto-accompaniment tool:

http://sandsoftwaresound.net/chordpro-auto-accompaniment/

The ChordPro looks something like:


{title: Amazing Grace}
{key: G}
{artist: Munsoncovers}
{time: 3/4}
{comment: SouthernGospel is stylecode 7812 3/4}
{comment: AmazingGospel is stylecode 5602 6/4}
{stylecode: 7812}
{tempo: 90}
{start_accomp}

# Introduction
[G][*IA]

# Verse
[G][*MA] Amazing [G7] Grace! (how [C] sweet the [G] sound)
That [G] saved a [G]wretch like [D] me! [D][*FA]
I [G][*MA] once was [G7] lost, but [C] now am [G] found,
Was [Em] blind, but [D] now I [G] see. [G][*FA]

# Ending
[G][*EA]


The translation tool (cp2mid) generates Yamaha chord MIDI messages and auto-accompaniment control. Some of the code could be used to build a CLD (or CLB) tool.

Hope this helps -- pj
 

Offline acorrias

Re: Looking for CLB file format specification
« Reply #5 on: December 17, 2022, 11:24:06 AM »
Hi all
I managed to develop a javascript that allows to create and save CLD files. You  have to specify, for now, your 4 chords inside an ascii file and you have to launch that file as a js script inside a nodejs enviroment. It creates the file from scratch with a batch CLI. 

It is very simple: it inserts four meta events chord name, according to the string "FF 7F 07 43 7B 01 cr ct bn bt" as specified at page 120 of PSX SX 900 data list manual.

I realize that is not very simple to set the right enviroment to launch the script, since this prototipe tool works under nodejs. I wish to share the tool to the user of the forum, but I need to know which is the mean knowledge that allows general users (not computers gurus) to  exec the script.

If someone is interested I used:
a) nodejs environment (you found lot of tutorials to use nodejs);

b) a customized, from me, javascript library to create and write midi files (https://github.com/dingram/jsmidgen); the customization consists in the class extension with a new function to save chord name meta events, as shown in the following lines of code:
        /**
    * add chord meta event
    * @param {number} cr - chord root
    * @param {number} ct - chord type
    * @param {number} bn - bass note
    * @param {number} bt - bass note
    * @param {number} [time=0] - The number of ticks since the previous event, defaults to 0.
    * @returns {Track} The current track.
    */
   Track.prototype.addChord2 = Track.prototype.chord2 = function(cr, ct,  time, bn, bt) {
      this.events.push(new MetaEvent({
         type: MetaEvent.SEQ_EVENT,
         data: [0x43, 0x7B, 0x01, cr, ct, bn || 0x7F, bt || 0x7F ],
         time: time ,
      }));
      return this;
   };

   
c) a js script file to launch:
var fs = require('fs');
var Midi = require('jsmidgen');
var file = new Midi.File();
var track2 = new Midi.Track();
file.addTrack(track2);
track2.setTempo(100);
track2.addChord2(0x31, 0x00, 0);
track2.addChord2(0x34, 0x00,512);
track2.addChord2(0x33, 0x00,512);
track2.addChord2(0x35, 0x00,512);
fs.writeFileSync('chord.mid', file.toBytes(), 'binary');



My idea is to create WEB yamaha tools, to edit pad, cld and clb files inside a computer and to move them to the keyboard (timing is more accurate when you create a cld file from script instead to edit it on the keyboard). The idea is to create a repository to store and edit standard chord progressions, tools that suggest the "next chord" accoding music theory and so on.

I wait for comments and I am ready to collaborate with other users to develop ideas and tools to expand the keyboard.


I provide a CLD sample (download chord.jpg and rename it to chord.mid or chord.cld) of the file just created tested with MixMaster, to let you see that the tool could generate. .

If you give a look ad the file with Mix Master, you could see tat it refers to C F E G chords according to this code segment:
track2.addChord2(0x31, 0x00, 0); 0x31 is the hex code of C, 0x00 is for Maj chord and the third parameter is the time (512 for a whole beat)
track2.addChord2(0x34, 0x00,512);
track2.addChord2(0x33, 0x00,512);
track2.addChord2(0x35, 0x00,512);

(please se note at the end of this post for chords names and type codes)

best regards

Alessandro

PS: I could share also the whole package if someone is interested.

Thanks to Dave Ingram (dingram) the github user that has developed the library that I have extended with the new function.

PS: my psr sx 900 specifies chord parameter at the page related to Chord Control (page 116). You have to be able to manage binary codes:
Chord Control F0 43 7E tt d1 d2 d3 d4 F7 –– O 
Type1 (tt=02)
11110000 F0 = Exclusive status
01000011 43 = YAMAHA ID
01111110 7E = Style
00000010 02 = type 1
0ddddddd d1 = chord root (cr)
0ddddddd d2 = chord type (ct)
0ddddddd d3 = bass note (bn)
0ddddddd d4 = bass type (bt)
11110111 F7 = End of Exclusive
cr : Chord Root 0fffnnnn
fff: b or #, nnnn: note(root)
0000nnnn 0n bbb 0fff0000 x0 reserved
0001nnnn 1n bb 0fff0001 x1 C
0010nnnn 2n b 0fff0010 x2 D
0011nnnn 3n natural 0fff0011 x3 E
0100nnnn 4n # 0fff0100 x4 F
0101nnnn 5n ## 0fff0101 x5 G
0110nnnn 6n ### 0fff0110 x6 A
0fff0111 x7 B
ct : Chord Type 0 – 34, 127
00000000 00 0 Maj 00010010 12 18 dim7
00000001 01 1 Maj6 00010011 13 19 7th
00000010 02 2 Maj7 00010100 14 20 7sus4
00000011 03 3 Maj7(#11) 00010101 15 21 7b5
00000100 04 4 Maj(9) 00010110 16 22 7(9)
00000101 05 5 Maj7(9) 00010111 17 23 7(#11)
00000110 06 6 Maj6(9) 00011000 18 24 7(13)
00000111 07 7 aug 00011001 19 25 7(b9)
00001000 08 8 min 00011010 1A 26 7(b13)
00001001 09 9 min6 00011011 1B 27 7(#9)
00001010 0A 10 min7 00011100 1C 28 Maj7aug
00001011 0B 11 min7b5 00011101 1D 29 7aug
00001100 0C 12 min(9) 00011110 1E 30 1+8
00001101 0D 13 min7(9) 00011111 1F 31 1+5
00001110 0E 14 min7(11) 00100000 20 32 sus4
00001111 0F 15 minMaj7 00100001 21 33 1+2+5
00010000 10 16 minMaj7(9) 00100010 22 34 cc
00010001 11 17 dim
bn : On Bass Note Same as Chord root
127:No bass chord
bt : Bass Chord Same as Chord type
127:No bass chord

 
« Last Edit: December 17, 2022, 01:39:14 PM by acorrias »