Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micro tonal scales #143

Closed
WiggyWire opened this issue Oct 16, 2018 · 8 comments
Closed

Micro tonal scales #143

WiggyWire opened this issue Oct 16, 2018 · 8 comments

Comments

@WiggyWire
Copy link

I see that you can use custom scales but can you do scales with greater than 12 tones? I would like to use 53 TET.

@Qirky
Copy link
Owner

Qirky commented Oct 16, 2018

Yes you can, there's some info here: http://docs.foxdot.org/docs/players/scales-and-tuning/

I don't know how to set up 53 TET but if you supply 53 values in Scale.default.set() for the scale and tuning then it should work...

@WiggyWire
Copy link
Author

Thanks, that is great news.

@WiggyWire
Copy link
Author

WiggyWire commented Oct 16, 2018

Sorry I am a bit confused, the documentation seems not to list the frequency just some list of floats. I tried to create a 24 tone scale but I get this error when I try and run a synth.

The following runs without error...

Scale.default.set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,23], tuning=[0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 7.5, 8.0, 8.5, 9.0, 9.5, 10.0, 10.5, 11.0, 11.5])

I can check the print(Scale.default) and it prints as you would expect..
>>> print(Scale.default) P[0, 1, 2, 3, 4, 5, 6, 7, ..., 16, 17, 18, 19, 20, 21, 22, 23]

but when you try and get a player to play a pattern with the scale there is an error.

>>> p1 >> pads([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]) Traceback (most recent call last): File "FoxDot/lib/TempoClock.py", line 420, in __run_block item.__call__() File "FoxDot/lib/TempoClock.py", line 799, in __call__ self.obj.__call__(*self.args, **self.kwargs) File "FoxDot/lib/Players.py", line 654, in __call__ self.send(verbose=(self.metro.solo == self and kwargs.get('verbose', True))) File "FoxDot/lib/Players.py", line 1489, in send self.send_osc_message(self.event, i, timestamp=timestamp, verbose=verbose, **kwargs) File "FoxDot/lib/Players.py", line 1546, in send_osc_message self.push_osc_to_server(packet, timestamp, verbose, **kwargs) File "FoxDot/lib/Players.py", line 1556, in push_osc_to_server message = self.new_message_header(packet) File "FoxDot/lib/Players.py", line 1662, in new_message_header freq, midinote = get_freq_and_midi(degree, octave, root, scale) File "FoxDot/lib/Scale.py", line 68, in get_freq_and_midi freq, midinote = scale.get_freq(degree, octave, root, get_midi=True) File "FoxDot/lib/Scale.py", line 182, in get_freq midinote = self.get_midi_note(degree, octave, root) File "FoxDot/lib/Scale.py", line 158, in get_midi_note pitch = self.get_tuned_note(index) File "FoxDot/lib/Scale.py", line 135, in get_tuned_note return self.tuning[tuning_index] TypeError: list indices must be integers, not float

I figure I must be doing something wrong. Is there a way I can get the frequency of the scale tones or directly input frequency when setting up a scale also? this is a map from middle C = 0.0 I think it said in the docs.

@Qirky
Copy link
Owner

Qirky commented Oct 17, 2018

I'm getting the same thing so will look into it

@Qirky
Copy link
Owner

Qirky commented Oct 17, 2018

So the issue is that the last value in the tuning needs to be the total number of semitones in the scale, i.e. how many to increase in a single octave, and this needs to be an integer. The reason for this was to avoid the user using another Tuning class. What about something like:

Scale.default.set(P[:24], tuning = P[:24] / 2, steps = 12)

And then have steps = 12 as a default?

@WiggyWire
Copy link
Author

WiggyWire commented Oct 17, 2018

So you can never have more than 12 tones in a scale being played at one time... I guess the work around would be to split the scale between however many multiples of 12 you need. Its like Arabic music would need 24 tones but you would only be using 7 at one time So I guess its easy enough. But yea if its a huge pain to implement I understand why you wouldn't want to do it.

@Qirky
Copy link
Owner

Qirky commented Oct 18, 2018

There's definitely room for improvement - the current system is a hacky version of a simple 12 tone scale system so I should have another go at it. Will keep you posted

@qantuum
Copy link

qantuum commented Dec 27, 2018

Hi there. I successfully managed to use a 17-EDO scale with respecting what is said @ post below.

This just did the trick :

edo_svteen = P[:18]*12/17
any_scale = P[0,2,5,7,8,10,11]
Scale.default.set(any_scale,tuning=edo_svteen)
b1 >> blip(P[:8])

I think I can just go like that for any EDO scale. I should try with something as strange as Bohlen-Pierce or Carlos Alpha...

So the issue is that the last value in the tuning needs to be the total number of semitones in the scale, i.e. how many to increase in a single octave, and this needs to be an integer. The reason for this was to avoid the user using another Tuning class. What about something like:

Scale.default.set(P[:24], tuning = P[:24] / 2, steps = 12)

And then have steps = 12 as a default?

@Qirky Qirky closed this as completed Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants