New developer first plugin - copy/paste, randomize and export bars

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

New developer first plugin - copy/paste, randomize and export bars

steinbil
Hi everyone,

I don’t know exactly how this mailing list/forum works, and I have limited programming experience, so please bear with me.
I’m a music teacher in Norway, and I want to create plugins to facilitate creating exercises for my students, but I need some help understanding what I can and cannot do with a plugin and how.

Here’s the idea for the first plugin I want to program:

The idea is for the plugin to output a pair of files, one exported audio file with a matching pdf.
I want the content of the files to be a randomized sequence of predefined bars containing unique rhythms.

I envision the plugin to work more or less like this (simplified):
1. The plugin gets X predefined bars as input (ex. through an opened score with X unique bars/selected bars)
2. The content of each bar gets stored in X variables/objects (maybe in an array/dictionary?)
3. Predefined bars are deleted, Y empty bars are created
3. A loop runs Y number of times
4. The loop makes a random choice of one of the stored variables/objects
5. The loop fills one bar with the content of the random stored variable/object
7. Loop ends when Y bars have been created/filled
8. Audio is exported
9. PDF is exported

These are my questions:
A) Is this feasible? Can I use a structure like the one I’ve described? Do I need to do in a completely different way?
B) Can I store the entire contents of 1 bar in an object and then add that to another bar (a copy/paste of sorts) and how?
C) If so: Should I create an array or dictionary (or something else) to store the different bars?
D) Is there a way of creating a random selection?

Any help or tips on what I need to read up on is greatly appreciated.

Best regards
Steinar Refsdsal


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: New developer first plugin - copy/paste, randomize and export bars

Bob Zawalich-3

It is hard to answer your question directly, but I will try to pull out a few things I can answer.

It is hard to say if the exact workflow you are suggesting would work, but you could probably accomplish what you want.

 

  1. You can create a passage selection in a score if you know the saves and bars you want to select.  See SelectPassage.
  2. You can open a score and read from it. Put it someplace easy to find, like the default scores folder or possibly the user manuscript paper folder.
  3. You can generate random numbers. See the functions with the word Random in them. You can probably make up bar numbers from such random numbers.
  4. You could store the objects from a bar in a Sparse Array, which is simpler to deal with in this case than a Dictionary. Sparse arrays and Dictionaries can hold objects, which “normal” arrays cannot.
  5. You can add or insert new bars
  6. Use bar.Clear() or bar. ClearNotesAndModifiers() to empty a bar.
  7. You can export audio and PDF.

 

 

Good luck! Have a look at some published plugins to get a sense for details.

 

Bob

 

From: Plugin-dev [mailto:[hidden email]] On Behalf Of Steinar Refsdal
Sent: Tuesday, September 26, 2017 9:31 AM
To: [hidden email]
Subject: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

Hi everyone,

 

I don’t know exactly how this mailing list/forum works, and I have limited programming experience, so please bear with me.

I’m a music teacher in Norway, and I want to create plugins to facilitate creating exercises for my students, but I need some help understanding what I can and cannot do with a plugin and how.

 

Here’s the idea for the first plugin I want to program:

 

The idea is for the plugin to output a pair of files, one exported audio file with a matching pdf.

I want the content of the files to be a randomized sequence of predefined bars containing unique rhythms.

 

I envision the plugin to work more or less like this (simplified):

            1. The plugin gets X predefined bars as input (ex. through an opened score with X unique bars/selected bars)

            2. The content of each bar gets stored in X variables/objects (maybe in an array/dictionary?)

            3. Predefined bars are deleted, Y empty bars are created

            3. A loop runs Y number of times

            4. The loop makes a random choice of one of the stored variables/objects

            5. The loop fills one bar with the content of the random stored variable/object

            7. Loop ends when Y bars have been created/filled

            8. Audio is exported

            9. PDF is exported

 

These are my questions:

A) Is this feasible? Can I use a structure like the one I’ve described? Do I need to do in a completely different way?

B) Can I store the entire contents of 1 bar in an object and then add that to another bar (a copy/paste of sorts) and how?

C) If so: Should I create an array or dictionary (or something else) to store the different bars?

D) Is there a way of creating a random selection?

 

Any help or tips on what I need to read up on is greatly appreciated.

 

Best regards

Steinar Refsdsal

 


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: New developer first plugin - copy/paste,

notenlektorat

Just a thought here: especially since all this is supposed to handle complete bars, it shouldn’t be necessary to store any objects in any kind of array or dictionary. There are practically unlimited numbers of clipboards available, so one can just select each bar in turn and then copy that selection into another clipboard. And then one just has to draw the used numbers randomly and paste in turn, using the clipboard with the drawn number.

 

Alex

 

From: Plugin-dev [mailto:[hidden email]] On Behalf Of Bob Zawalich
Sent: Mittwoch, 27. September 2017 21:06
To: 'A mailing list for Sibelius plug-in developers'
Subject: Re: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

It is hard to answer your question directly, but I will try to pull out a few things I can answer.

It is hard to say if the exact workflow you are suggesting would work, but you could probably accomplish what you want.

 

  1. You can create a passage selection in a score if you know the saves and bars you want to select.  See SelectPassage.
  2. You can open a score and read from it. Put it someplace easy to find, like the default scores folder or possibly the user manuscript paper folder.
  3. You can generate random numbers. See the functions with the word Random in them. You can probably make up bar numbers from such random numbers.
  4. You could store the objects from a bar in a Sparse Array, which is simpler to deal with in this case than a Dictionary. Sparse arrays and Dictionaries can hold objects, which “normal” arrays cannot.
  5. You can add or insert new bars
  6. Use bar.Clear() or bar. ClearNotesAndModifiers() to empty a bar.
  7. You can export audio and PDF.

 

 

Good luck! Have a look at some published plugins to get a sense for details.

 

Bob

 

From: Plugin-dev [[hidden email]] On Behalf Of Steinar Refsdal
Sent: Tuesday, September 26, 2017 9:31 AM
To: [hidden email]
Subject: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

Hi everyone,

 

I don’t know exactly how this mailing list/forum works, and I have limited programming experience, so please bear with me.

I’m a music teacher in Norway, and I want to create plugins to facilitate creating exercises for my students, but I need some help understanding what I can and cannot do with a plugin and how.

 

Here’s the idea for the first plugin I want to program:

 

The idea is for the plugin to output a pair of files, one exported audio file with a matching pdf.

I want the content of the files to be a randomized sequence of predefined bars containing unique rhythms.

 

I envision the plugin to work more or less like this (simplified):

            1. The plugin gets X predefined bars as input (ex. through an opened score with X unique bars/selected bars)

            2. The content of each bar gets stored in X variables/objects (maybe in an array/dictionary?)

            3. Predefined bars are deleted, Y empty bars are created

            3. A loop runs Y number of times

            4. The loop makes a random choice of one of the stored variables/objects

            5. The loop fills one bar with the content of the random stored variable/object

            7. Loop ends when Y bars have been created/filled

            8. Audio is exported

            9. PDF is exported

 

These are my questions:

A) Is this feasible? Can I use a structure like the one I’ve described? Do I need to do in a completely different way?

B) Can I store the entire contents of 1 bar in an object and then add that to another bar (a copy/paste of sorts) and how?

C) If so: Should I create an array or dictionary (or something else) to store the different bars?

D) Is there a way of creating a random selection?

 

Any help or tips on what I need to read up on is greatly appreciated.

 

Best regards

Steinar Refsdsal

 


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: New developer first plugin - copy/paste,

steinbil
Thank you so much, Bob and Alex!
You have given me several ideas for how to write this plugin, and others(!).

I have already been able to create an RNG, so now I just have to write the actual plugin.
I’ll let you know how it turns out.

Best regards

Steinar


On 27. september 2017 at 23.09.08, Alexander Plötz ([hidden email]) wrote:

Just a thought here: especially since all this is supposed to handle complete bars, it shouldn’t be necessary to store any objects in any kind of array or dictionary. There are practically unlimited numbers of clipboards available, so one can just select each bar in turn and then copy that selection into another clipboard. And then one just has to draw the used numbers randomly and paste in turn, using the clipboard with the drawn number.

 

Alex

 

From: Plugin-dev [mailto:[hidden email]] On Behalf Of Bob Zawalich
Sent: Mittwoch, 27. September 2017 21:06
To: 'A mailing list for Sibelius plug-in developers'
Subject: Re: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

It is hard to answer your question directly, but I will try to pull out a few things I can answer.

It is hard to say if the exact workflow you are suggesting would work, but you could probably accomplish what you want.

 

  1. You can create a passage selection in a score if you know the saves and bars you want to select.  See SelectPassage.
  2. You can open a score and read from it. Put it someplace easy to find, like the default scores folder or possibly the user manuscript paper folder.
  3. You can generate random numbers. See the functions with the word Random in them. You can probably make up bar numbers from such random numbers.
  4. You could store the objects from a bar in a Sparse Array, which is simpler to deal with in this case than a Dictionary. Sparse arrays and Dictionaries can hold objects, which “normal” arrays cannot.
  5. You can add or insert new bars
  6. Use bar.Clear() or bar. ClearNotesAndModifiers() to empty a bar.
  7. You can export audio and PDF.

 

 

Good luck! Have a look at some published plugins to get a sense for details.

 

Bob

 

From: Plugin-dev [[hidden email]] On Behalf Of Steinar Refsdal
Sent: Tuesday, September 26, 2017 9:31 AM
To: [hidden email]
Subject: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

Hi everyone,

 

I don’t know exactly how this mailing list/forum works, and I have limited programming experience, so please bear with me.

I’m a music teacher in Norway, and I want to create plugins to facilitate creating exercises for my students, but I need some help understanding what I can and cannot do with a plugin and how.

 

Here’s the idea for the first plugin I want to program:

 

The idea is for the plugin to output a pair of files, one exported audio file with a matching pdf.

I want the content of the files to be a randomized sequence of predefined bars containing unique rhythms.

 

I envision the plugin to work more or less like this (simplified):

            1. The plugin gets X predefined bars as input (ex. through an opened score with X unique bars/selected bars)

            2. The content of each bar gets stored in X variables/objects (maybe in an array/dictionary?)

            3. Predefined bars are deleted, Y empty bars are created

            3. A loop runs Y number of times

            4. The loop makes a random choice of one of the stored variables/objects

            5. The loop fills one bar with the content of the random stored variable/object

            7. Loop ends when Y bars have been created/filled

            8. Audio is exported

            9. PDF is exported

 

These are my questions:

A) Is this feasible? Can I use a structure like the one I’ve described? Do I need to do in a completely different way?

B) Can I store the entire contents of 1 bar in an object and then add that to another bar (a copy/paste of sorts) and how?

C) If so: Should I create an array or dictionary (or something else) to store the different bars?

D) Is there a way of creating a random selection?

 

Any help or tips on what I need to read up on is greatly appreciated.

 

Best regards

Steinar Refsdsal

 

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: New developer first plugin - copy/paste,

steinbil
With a little help from a friend I’ve been able to almost complete the plugin to my liking, but I’m having problems exporting the sound file.

I’m using SaveAsAudio, but it returns false, even though I’m using Sibelius Sounds as my Playback Config.

Manual export Audio works fine, and I also tried Bob’s plugin “Export selection as Audio” which also uses SaveAsAudio method, and that works fine(!)

Since my plugin didn’t export any audio, I created this test which prints “false”.

score=Sibelius.ActiveScore;

test=score.SaveAsAudio("test");

Sibelius.MessageBox(test);


Any ideas why it fails, when the other plugin and manual export does not?


Best regards
Steinar


On 28. september 2017 at 00.19.54, Steinar Refsdal ([hidden email]) wrote:

Thank you so much, Bob and Alex!
You have given me several ideas for how to write this plugin, and others(!).

I have already been able to create an RNG, so now I just have to write the actual plugin.
I’ll let you know how it turns out.

Best regards

Steinar


On 27. september 2017 at 23.09.08, Alexander Plötz ([hidden email]) wrote:

Just a thought here: especially since all this is supposed to handle complete bars, it shouldn’t be necessary to store any objects in any kind of array or dictionary. There are practically unlimited numbers of clipboards available, so one can just select each bar in turn and then copy that selection into another clipboard. And then one just has to draw the used numbers randomly and paste in turn, using the clipboard with the drawn number.

 

Alex

 

From: Plugin-dev [mailto:[hidden email]] On Behalf Of Bob Zawalich
Sent: Mittwoch, 27. September 2017 21:06
To: 'A mailing list for Sibelius plug-in developers'
Subject: Re: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

It is hard to answer your question directly, but I will try to pull out a few things I can answer.

It is hard to say if the exact workflow you are suggesting would work, but you could probably accomplish what you want.

 

  1. You can create a passage selection in a score if you know the saves and bars you want to select.  See SelectPassage.
  2. You can open a score and read from it. Put it someplace easy to find, like the default scores folder or possibly the user manuscript paper folder.
  3. You can generate random numbers. See the functions with the word Random in them. You can probably make up bar numbers from such random numbers.
  4. You could store the objects from a bar in a Sparse Array, which is simpler to deal with in this case than a Dictionary. Sparse arrays and Dictionaries can hold objects, which “normal” arrays cannot.
  5. You can add or insert new bars
  6. Use bar.Clear() or bar. ClearNotesAndModifiers() to empty a bar.
  7. You can export audio and PDF.

 

 

Good luck! Have a look at some published plugins to get a sense for details.

 

Bob

 

From: Plugin-dev [[hidden email]] On Behalf Of Steinar Refsdal
Sent: Tuesday, September 26, 2017 9:31 AM
To: [hidden email]
Subject: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

Hi everyone,

 

I don’t know exactly how this mailing list/forum works, and I have limited programming experience, so please bear with me.

I’m a music teacher in Norway, and I want to create plugins to facilitate creating exercises for my students, but I need some help understanding what I can and cannot do with a plugin and how.

 

Here’s the idea for the first plugin I want to program:

 

The idea is for the plugin to output a pair of files, one exported audio file with a matching pdf.

I want the content of the files to be a randomized sequence of predefined bars containing unique rhythms.

 

I envision the plugin to work more or less like this (simplified):

            1. The plugin gets X predefined bars as input (ex. through an opened score with X unique bars/selected bars)

            2. The content of each bar gets stored in X variables/objects (maybe in an array/dictionary?)

            3. Predefined bars are deleted, Y empty bars are created

            3. A loop runs Y number of times

            4. The loop makes a random choice of one of the stored variables/objects

            5. The loop fills one bar with the content of the random stored variable/object

            7. Loop ends when Y bars have been created/filled

            8. Audio is exported

            9. PDF is exported

 

These are my questions:

A) Is this feasible? Can I use a structure like the one I’ve described? Do I need to do in a completely different way?

B) Can I store the entire contents of 1 bar in an object and then add that to another bar (a copy/paste of sorts) and how?

C) If so: Should I create an array or dictionary (or something else) to store the different bars?

D) Is there a way of creating a random selection?

 

Any help or tips on what I need to read up on is greatly appreciated.

 

Best regards

Steinar Refsdsal

 

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: New developer first plugin - copy/paste,

Bob Zawalich-3

Try using a full path name, including extension, for the file name.

 

There is often a problem if the sounds are not all VST/AU instruments, but it sounds as though you have that figured out.

 

From: Plugin-dev [mailto:[hidden email]] On Behalf Of Steinar Refsdal
Sent: Friday, September 29, 2017 7:14 AM
To: A mailing list for Sibelius plug-in developers <[hidden email]>
Subject: Re: [Plugin-dev] New developer first plugin - copy/paste,

 

With a little help from a friend I’ve been able to almost complete the plugin to my liking, but I’m having problems exporting the sound file.

 

I’m using SaveAsAudio, but it returns false, even though I’m using Sibelius Sounds as my Playback Config.

 

Manual export Audio works fine, and I also tried Bob’s plugin “Export selection as Audio” which also uses SaveAsAudio method, and that works fine(!)

 

Since my plugin didn’t export any audio, I created this test which prints “false”.

 

score=Sibelius.ActiveScore;

test=score.SaveAsAudio("test");

Sibelius.MessageBox(test);

 

Any ideas why it fails, when the other plugin and manual export does not?

 

Best regards

Steinar

 

 

On 28. september 2017 at 00.19.54, Steinar Refsdal ([hidden email]) wrote:

Thank you so much, Bob and Alex!

You have given me several ideas for how to write this plugin, and others(!).

 

I have already been able to create an RNG, so now I just have to write the actual plugin.

I’ll let you know how it turns out.

 

Best regards

 

Steinar

 

 

On 27. september 2017 at 23.09.08, Alexander Plötz ([hidden email]) wrote:

Just a thought here: especially since all this is supposed to handle complete bars, it shouldn’t be necessary to store any objects in any kind of array or dictionary. There are practically unlimited numbers of clipboards available, so one can just select each bar in turn and then copy that selection into another clipboard. And then one just has to draw the used numbers randomly and paste in turn, using the clipboard with the drawn number.

 

Alex

 

From: Plugin-dev [mailto:[hidden email]] On Behalf Of Bob Zawalich
Sent: Mittwoch, 27. September 2017 21:06
To: 'A mailing list for Sibelius plug-in developers'
Subject: Re: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

It is hard to answer your question directly, but I will try to pull out a few things I can answer.

It is hard to say if the exact workflow you are suggesting would work, but you could probably accomplish what you want.

 

  1. You can create a passage selection in a score if you know the saves and bars you want to select.  See SelectPassage.
  2. You can open a score and read from it. Put it someplace easy to find, like the default scores folder or possibly the user manuscript paper folder.
  3. You can generate random numbers. See the functions with the word Random in them. You can probably make up bar numbers from such random numbers.
  4. You could store the objects from a bar in a Sparse Array, which is simpler to deal with in this case than a Dictionary. Sparse arrays and Dictionaries can hold objects, which “normal” arrays cannot.
  5. You can add or insert new bars
  6. Use bar.Clear() or bar. ClearNotesAndModifiers() to empty a bar.
  7. You can export audio and PDF.

 

 

Good luck! Have a look at some published plugins to get a sense for details.

 

Bob

 

From: Plugin-dev [[hidden email]] On Behalf Of Steinar Refsdal
Sent: Tuesday, September 26, 2017 9:31 AM
To: [hidden email]
Subject: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

Hi everyone,

 

I don’t know exactly how this mailing list/forum works, and I have limited programming experience, so please bear with me.

I’m a music teacher in Norway, and I want to create plugins to facilitate creating exercises for my students, but I need some help understanding what I can and cannot do with a plugin and how.

 

Here’s the idea for the first plugin I want to program:

 

The idea is for the plugin to output a pair of files, one exported audio file with a matching pdf.

I want the content of the files to be a randomized sequence of predefined bars containing unique rhythms.

 

I envision the plugin to work more or less like this (simplified):

            1. The plugin gets X predefined bars as input (ex. through an opened score with X unique bars/selected bars)

            2. The content of each bar gets stored in X variables/objects (maybe in an array/dictionary?)

            3. Predefined bars are deleted, Y empty bars are created

            3. A loop runs Y number of times

            4. The loop makes a random choice of one of the stored variables/objects

            5. The loop fills one bar with the content of the random stored variable/object

            7. Loop ends when Y bars have been created/filled

            8. Audio is exported

            9. PDF is exported

 

These are my questions:

A) Is this feasible? Can I use a structure like the one I’ve described? Do I need to do in a completely different way?

B) Can I store the entire contents of 1 bar in an object and then add that to another bar (a copy/paste of sorts) and how?

C) If so: Should I create an array or dictionary (or something else) to store the different bars?

D) Is there a way of creating a random selection?

 

Any help or tips on what I need to read up on is greatly appreciated.

 

Best regards

Steinar Refsdsal

 

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com


_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com
Reply | Threaded
Open this post in threaded view
|

Re: New developer first plugin - copy/paste,

steinbil
A late reply, but i wanted to let you know that using the full path fixed the problem.

Thanks again

Steinar Refsdal

On 29 September 2017 at 23:20:14, Bob Zawalich ([hidden email]) wrote:

Try using a full path name, including extension, for the file name.

 

There is often a problem if the sounds are not all VST/AU instruments, but it sounds as though you have that figured out.

 

From: Plugin-dev [mailto:[hidden email]] On Behalf Of Steinar Refsdal
Sent: Friday, September 29, 2017 7:14 AM
To: A mailing list for Sibelius plug-in developers <[hidden email]>
Subject: Re: [Plugin-dev] New developer first plugin - copy/paste,

 

With a little help from a friend I’ve been able to almost complete the plugin to my liking, but I’m having problems exporting the sound file.

 

I’m using SaveAsAudio, but it returns false, even though I’m using Sibelius Sounds as my Playback Config.

 

Manual export Audio works fine, and I also tried Bob’s plugin “Export selection as Audio” which also uses SaveAsAudio method, and that works fine(!)

 

Since my plugin didn’t export any audio, I created this test which prints “false”.

 

score=Sibelius.ActiveScore;

test=score.SaveAsAudio("test");

Sibelius.MessageBox(test);

 

Any ideas why it fails, when the other plugin and manual export does not?

 

Best regards

Steinar

 

 

On 28. september 2017 at 00.19.54, Steinar Refsdal ([hidden email]) wrote:

Thank you so much, Bob and Alex!

You have given me several ideas for how to write this plugin, and others(!).

 

I have already been able to create an RNG, so now I just have to write the actual plugin.

I’ll let you know how it turns out.

 

Best regards

 

Steinar

 

 

On 27. september 2017 at 23.09.08, Alexander Plötz ([hidden email]) wrote:

Just a thought here: especially since all this is supposed to handle complete bars, it shouldn’t be necessary to store any objects in any kind of array or dictionary. There are practically unlimited numbers of clipboards available, so one can just select each bar in turn and then copy that selection into another clipboard. And then one just has to draw the used numbers randomly and paste in turn, using the clipboard with the drawn number.

 

Alex

 

From: Plugin-dev [mailto:[hidden email]] On Behalf Of Bob Zawalich
Sent: Mittwoch, 27. September 2017 21:06
To: 'A mailing list for Sibelius plug-in developers'
Subject: Re: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

It is hard to answer your question directly, but I will try to pull out a few things I can answer.

It is hard to say if the exact workflow you are suggesting would work, but you could probably accomplish what you want.

 

  1. You can create a passage selection in a score if you know the saves and bars you want to select.  See SelectPassage.
  2. You can open a score and read from it. Put it someplace easy to find, like the default scores folder or possibly the user manuscript paper folder.
  3. You can generate random numbers. See the functions with the word Random in them. You can probably make up bar numbers from such random numbers.
  4. You could store the objects from a bar in a Sparse Array, which is simpler to deal with in this case than a Dictionary. Sparse arrays and Dictionaries can hold objects, which “normal” arrays cannot.
  5. You can add or insert new bars
  6. Use bar.Clear() or bar. ClearNotesAndModifiers() to empty a bar.
  7. You can export audio and PDF.

 

 

Good luck! Have a look at some published plugins to get a sense for details.

 

Bob

 

From: Plugin-dev [[hidden email]] On Behalf Of Steinar Refsdal
Sent: Tuesday, September 26, 2017 9:31 AM
To: [hidden email]
Subject: [Plugin-dev] New developer first plugin - copy/paste, randomize and export bars

 

Hi everyone,

 

I don’t know exactly how this mailing list/forum works, and I have limited programming experience, so please bear with me.

I’m a music teacher in Norway, and I want to create plugins to facilitate creating exercises for my students, but I need some help understanding what I can and cannot do with a plugin and how.

 

Here’s the idea for the first plugin I want to program:

 

The idea is for the plugin to output a pair of files, one exported audio file with a matching pdf.

I want the content of the files to be a randomized sequence of predefined bars containing unique rhythms.

 

I envision the plugin to work more or less like this (simplified):

            1. The plugin gets X predefined bars as input (ex. through an opened score with X unique bars/selected bars)

            2. The content of each bar gets stored in X variables/objects (maybe in an array/dictionary?)

            3. Predefined bars are deleted, Y empty bars are created

            3. A loop runs Y number of times

            4. The loop makes a random choice of one of the stored variables/objects

            5. The loop fills one bar with the content of the random stored variable/object

            7. Loop ends when Y bars have been created/filled

            8. Audio is exported

            9. PDF is exported

 

These are my questions:

A) Is this feasible? Can I use a structure like the one I’ve described? Do I need to do in a completely different way?

B) Can I store the entire contents of 1 bar in an object and then add that to another bar (a copy/paste of sorts) and how?

C) If so: Should I create an array or dictionary (or something else) to store the different bars?

D) Is there a way of creating a random selection?

 

Any help or tips on what I need to read up on is greatly appreciated.

 

Best regards

Steinar Refsdsal

 

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com

_______________________________________________
Plugin-dev mailing list
[hidden email]
http://lists.avid.com/mailman/listinfo/plugin-dev_lists.avid.com