electro-music.org   Dedicated to experimental electro-acoustic
and electronic music
 
 Front Page  |  Radio  |  Forum  |  Media  |  Playlists  |  Wiki
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
pitch and time header
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [1 Post]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
andrewjmonks



Joined: Dec 30, 2008
Posts: 8
Location: Concord, MA

PostPosted: Fri Jan 02, 2009 7:00 pm    Post subject: pitch and time header Reply with quote  Mark this post and the followings unread

If chuck allowed you to include headers, I'd use this as a header.
As things stand, I copy and paste this into the beginning of everything to make my life easier. Given a float called BPM, it defines durs for common note values. To make sequencing easier, it also defines different frequencies as their note names. So to make middle C, you could use
Code:
c4 => whatever.freq

and for c sharp, you could use either
Code:
cs4 => whatever.freq

or
Code:
bf4 => whatever.freq

for b flat.

I use this a lot, so I thought I'd share.

Code:
//time
120 => float bpm;
(1/bpm)::minute => dur quarter;
.5::quarter => dur eighth;
2::quarter => dur half;
2::half => dur bar;
.5::eighth => dur sixteenth;
.5::sixteenth => dur thirtysecond;
2::bar => dur twobar;
.5::thirtysecond => dur sixtyfourth;
half/3 => dur triplet;
half/3 => dur quartertriplet;
quarter/3 => dur eigthtriplet;

//notes
Std.mtof(12) => float c0;
Std.mtof(13) => float cs0;
Std.mtof(13) => float df0;
Std.mtof(14) => float d0;
Std.mtof(15) => float ds0;
Std.mtof(15) => float ef0;
Std.mtof(16) => float e0;
Std.mtof(17) => float f0;
Std.mtof(18) => float fs0;
Std.mtof(18) => float gf0;
Std.mtof(19) => float g0;
Std.mtof(20) => float gs0;
Std.mtof(20) => float af0;
Std.mtof(21) => float a0;
Std.mtof(22) => float as0;
Std.mtof(22) => float bf0;
Std.mtof(23) => float b0;
Std.mtof(24) => float c1;
Std.mtof(25) => float cs1;
Std.mtof(25) => float df1;
Std.mtof(26) => float d1;
Std.mtof(27) => float ds1;
Std.mtof(27) => float ef1;
Std.mtof(28) => float e1;
Std.mtof(29) => float f1;
Std.mtof(30) => float fs1;
Std.mtof(30) => float gf1;
Std.mtof(31) => float g1;
Std.mtof(32) => float gs1;
Std.mtof(32) => float af1;
Std.mtof(33) => float a1;
Std.mtof(34) => float as1;
Std.mtof(34) => float bf1;
Std.mtof(35) => float b1;
Std.mtof(36) => float c2;
Std.mtof(37) => float cs2;
Std.mtof(37) => float df2;
Std.mtof(38) => float d2;
Std.mtof(39) => float ds2;
Std.mtof(39) => float ef2;
Std.mtof(40) => float e2;
Std.mtof(41) => float f2;
Std.mtof(42) => float fs2;
Std.mtof(42) => float gf2;
Std.mtof(43) => float g2;
Std.mtof(44) => float gs2;
Std.mtof(44) => float af2;
Std.mtof(45) => float a2;
Std.mtof(46) => float as2;
Std.mtof(46) => float bf2;
Std.mtof(47) => float b2;
Std.mtof(48) => float c3;
Std.mtof(49) => float cs3;
Std.mtof(49) => float df3;
Std.mtof(50) => float d3;
Std.mtof(51) => float ds3;
Std.mtof(51) => float ef3;
Std.mtof(52) => float e3;
Std.mtof(53) => float f3;
Std.mtof(54) => float fs3;
Std.mtof(54) => float gf3;
Std.mtof(55) => float g3;
Std.mtof(56) => float gs3;
Std.mtof(56) => float af3;
Std.mtof(57) => float a3;
Std.mtof(58) => float as3;
Std.mtof(58) => float bf3;
Std.mtof(59) => float b3;
Std.mtof(60) => float c4;
Std.mtof(61) => float cs4;
Std.mtof(61) => float df4;
Std.mtof(62) => float d4;
Std.mtof(63) => float ds4;
Std.mtof(63) => float ef4;
Std.mtof(63) => float e4;
Std.mtof(65) => float f4;
Std.mtof(66) => float fs4;
Std.mtof(66) => float gf4;
Std.mtof(67) => float g4;
Std.mtof(68) => float gs4;
Std.mtof(68) => float af4;
Std.mtof(69) => float a4;
Std.mtof(70) => float as4;
Std.mtof(70) => float bf4;
Std.mtof(71) => float b4;
Std.mtof(72) => float c5;
Std.mtof(73) => float cs5;
Std.mtof(73) => float df5;
Std.mtof(74) => float d5;
Std.mtof(75) => float ds5;
Std.mtof(75) => float ef5;
Std.mtof(76) => float e5;
Std.mtof(77) => float f5;
Std.mtof(78) => float fs5;
Std.mtof(78) => float gf5;
Std.mtof(79) => float g5;
Std.mtof(80) => float gs5;
Std.mtof(80) => float af5;
Std.mtof(81) => float a5;
Std.mtof(82) => float as5;
Std.mtof(82) => float bf5;
Std.mtof(83) => float b5;
Std.mtof(84) => float c6;
Std.mtof(85) => float cs6;
Std.mtof(85) => float df6;
Std.mtof(86) => float d6;
Std.mtof(87) => float ds6;
Std.mtof(87) => float ef6;
Std.mtof(88) => float e6;
Std.mtof(89) => float f6;
Std.mtof(90) => float fs6;
Std.mtof(90) => float gf6;
Std.mtof(91) => float g6;
Std.mtof(92) => float gs6;
Std.mtof(92) => float af6;
Std.mtof(93) => float a6;
Std.mtof(94) => float as6;
Std.mtof(94) => float bf6;
Std.mtof(95) => float b6;
Std.mtof(96) => float c7;
Std.mtof(97) => float cs7;
Std.mtof(97) => float df7;
Std.mtof(98) => float d7;
Std.mtof(99) => float ds7;
Std.mtof(99) => float ef7;
Std.mtof(100) => float e7;
Std.mtof(101) => float f7;
Std.mtof(102) => float fs7;
Std.mtof(102) => float gf7;
Std.mtof(103) => float g7;
Std.mtof(104) => float gs7;
Std.mtof(104) => float af7;
Std.mtof(105) => float a7;
Std.mtof(106) => float as7;
Std.mtof(106) => float bf7;
Std.mtof(107) => float b7;
Std.mtof(108) => float c8;
Std.mtof(109) => float cs8;
Std.mtof(109) => float df8;
Std.mtof(110) => float d8;
Std.mtof(111) => float ds8;
Std.mtof(111) => float ef8;
Std.mtof(112) => float e8;
Std.mtof(113) => float f8;
Std.mtof(114) => float fs8;
Std.mtof(114) => float gf8;
Std.mtof(115) => float g8;
Std.mtof(116) => float gs8;
Std.mtof(116) => float af8;
Std.mtof(117) => float a8;
Std.mtof(118) => float as8;
Std.mtof(118) => float bf8;
Std.mtof(119) => float b8;
Std.mtof(120) => float c9;
Std.mtof(121) => float cs9;
Std.mtof(121) => float df9;
Std.mtof(122) => float d9;
Std.mtof(123) => float ds9;
Std.mtof(123) => float ef9;
Std.mtof(124) => float e9;
Std.mtof(125) => float f9;
Std.mtof(126) => float fs9;
Std.mtof(126) => float gf9;
Std.mtof(127) => float g9;
Std.mtof(128) => float gs9;
Std.mtof(128) => float af9;
Std.mtof(129) => float a9;
Std.mtof(130) => float as9;
Std.mtof(130) => float bf9;
Std.mtof(131) => float b9;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [1 Post]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Log in
Username:     Password:      Log me on automatically each visit    


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2026 by electro-music.org